| I had a blast last week at TechEd but because of scheduling conflicts, and me sleeping in the Resource Center I missed some of the sessions I wanted to see. Fortunately this morning my Twitter and blog feed has been sprouting ways do download the scripts like the dandelions sprout in my yard in the spring. I found one I liked on Github that downloaded all of the videos in MP4 format, but it didn’t download the accompanying PPTX files. I tweaked their script some so it would get the MP4s and the PPTXs. It will also check locally for them before it downloads them, so you can run it more than once. As a speaker, I know I don’t always get my PPTXs turned in like I’m supposed to, so some of those might be popping up over the next few days.
Here’s the script I used:
# Originally published at https://gist.github.com/nzthiago/5736907 # I took that script and added the PPTX pieces, and a few comments # If you like it, leave me a comment # If you don't like it, complain to Github. :)
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath $rss = (new-object net.webclient)
# Grab the RSS feed for the MP4 downloads $a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/RSS/mp4high"))
# Walk through each item in the feed $a.rss.channel.item | foreach{ $code = $_.comments.split("/") | select -last 1 # Grab the URL for the MP4 file $url = New-Object System.Uri($_.enclosure.url) # Create the PPTX URL from the MP4 URL $urlpptx = ($_.enclosure.url).replace(".mp4",".pptx") # Create the local file name for the MP4 download $file = $code + "-" + $_.creator + "-" + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "") + ".mp4" # Create the local file name for the PPTX download $filepptx = $code + "-" + $_.creator + "-" + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "") + ".pptx" # Make sure the PPTX file doesn't already exist if (!(test-path $filepptx)) { # Echo out the file that's being downloaded $filepptx $wc = (New-Object System.Net.WebClient) # Download the PPTX file $wc.DownloadFile($urlpptx, $filepptx) } # Make sure the MP4 file doesn't already exist if (!(test-path $file)) { # Echo out the file that's being downloaded $file
# Download the MP4 file $wc.DownloadFile($url, $file) } }
Sorry for the crappy PowerShell formatting. You can download the full script here. All the usual warnings apply. This script will dull the knives in your kitchen, and leave soap scum in the shower. Be careful when you run that, it downloaded about 65 GB of stuff when I ran it last.
tk
ShortURL: http://www.toddklindt.com/TechEd2013Downloads |