Skip to content

Instantly share code, notes, and snippets.

@nzthiago
Forked from erichexter/download.ps1
Last active December 18, 2015 05:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nzthiago/5736907 to your computer and use it in GitHub Desktop.
Save nzthiago/5736907 to your computer and use it in GitHub Desktop.
Download TechEd North America videos with video code prepended to file name
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$rss = (new-object net.webclient)
#Set the username for windows auth proxy
#$rss.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials
$a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/RSS/mp4high"))
$a.rss.channel.item | foreach{
$code = $_.comments.split("/") | select -last 1
$url = New-Object System.Uri($_.enclosure.url)
$file = $code + "-" + $_.creator + "-" + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "") + ".mp4"
if (!(test-path $file))
{
$file
$wc = (New-Object System.Net.WebClient)
#Set the username for windows auth proxy
#$wc.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials
$wc.DownloadFile($url, $file)
}
}
@ciphertxt
Copy link

Forked and added some logic to retry the downloads if the transfer got cut off for some reason. https://gist.github.com/ciphertxt/9656900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment