Skip to content

Instantly share code, notes, and snippets.

@MarioBinder
Last active October 22, 2019 07:09
Show Gist options
  • Select an option

  • Save MarioBinder/e781e28993096a2b66dff2290335161f to your computer and use it in GitHub Desktop.

Select an option

Save MarioBinder/e781e28993096a2b66dff2290335161f to your computer and use it in GitHub Desktop.
# via https://gist.github.com/shanselman/9a5f73071e41b46dfcf9585ed5e14085?WT.mc_id=-blog-scottha
Import-Module BitsTransfer
$path = $env:USERPROFILE + "\Downloads\"
$feedContent = ([xml](new-object net.webclient).downloadstring("https://channel9.msdn.com/Series/CSharp-101/feed/mp4"))
$cnt = 20
$feedContent.rss.channel.item | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = $url.Segments[-1]
$cnt = $cnt - 1
$file_name = $path + "$cnt" + "_" + $file
if (!(test-path $file)) {
$f = $url.OriginalString
$n = $f.Replace(".mp4", "_high.mp4")
echo $n, $file_name
Start-BitsTransfer -Source $n -Destination $file_name
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment