Batch download BUILD 2012 videos

I didn’t get to go to //build this year (sniff), so I’m going to download a bunch of session recordings for offline viewing.

One way to do this is to use a PowerShell script (I found one here, based on this).

Last year, I just used the script as it was. This time, I’ve modified the  the script code so it also creates a “sidecar” file with the session title and summary:

 1: cd "C:\build2012"

 2: [Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath

 3: $a = ([xml](new-object net.webclient).downloadstring("http://channel9.msdn.com/Events/Build/2012/RSS/mp4"))

 4: $a.rss.channel.item | foreach {

 5:     $url = New-Object System.Uri($_.enclosure.url)

 6:     $file = $url.Segments[-1]

 7:     $file

 8:

 9:     $linkurl = New-Object System.Uri($_.link)

 10:     $session = $linkurl.Segments[-1]

 11:

 12:     $descfile = $session + " - " + $_.title + ".txt"

 13:     $descfile = $descfile.Replace(':', '_')

 14:     $descfile

 15:     $_.summary

 16:     if (!(test-path $descfile))

 17:     {

 18:         New-Item -ItemType file -Name $descfile

 19:         Add-Content -Path $descfile -Value $_.summary

 20:     }

 21:     if (!(test-path $file))

 22:     {

 23:         (New-Object System.Net.WebClient).DownloadFile($url, $file)

 24:     }

 25: }

As before, you may not want all the videos. So you can do this with the string in line 3:

http://channel9.msdn.com/Events/Build/2012/RSS/mp4?t=windows-phone

The available filters (for the t parameter) are:

.NET
Advertising
Analytics
Application-Lifecycle-Management
ASP.NET
C/C++
C++
Cloud
Contracts
Data
Design
Device-apps
DirectX
Gaming
Graphics
Hadoop
HTML5
Internet-Explorer-10
JavaScript
Keynote
Kinect
LightSwitch
Line-of-business
Localization
Media
Microsoft-8
Microsoft-design-language
Networking
Office
Performance
Reading
SharePoint
Shopping
Team-Foundation-Server
Testing
Tiles
Touch
TypeScript
User-Interaction
UX
Visual-Studio
Windows-8
Windows-Azure
Windows-Phone
Windows-Phone-Apps
Windows-Runtime
Windows-Server
Windows-Store
Windows-Store-app
Windows-Store-apps
WinJS
XAML
Xbox

If you’re just interested in the slides, use a query like this:

http://channel9.msdn.com/Events/Build/2012/RSS/slides

In general, the query can be constructed like this:

http://channel9.msdn.com/Events/Build/2012/RSS/
[type]?t=[tag]&term=[free text]

Where [type] can be one of: wmv, wmvhigh, mp4, slides

You can add multiple t arguments.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.