Last active
October 22, 2019 07:09
-
-
Save MarioBinder/e781e28993096a2b66dff2290335161f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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