Last active
August 7, 2017 09:38
-
-
Save r4dian/2b64b2ebe7b76776a31c to your computer and use it in GitHub Desktop.
This file contains 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
$dir = $env:USERPROFILE + "\Music\Podcasts" | |
$episodes = 5 | |
$urls = @( "http://theblacktapes.libsyn.com/rss", | |
"http://www.theblackdogma.com/tbd/?feed=podcast", | |
"http://impulseproject.info/feed/podcast/", | |
"http://spkmdl.libsyn.com/rss", | |
"http://www.ultimathule.info/xml/Ultima_Thule_Ambient_Music_Radio.xml", | |
"http://rwm.macba.cat/api/en/all_podcast/80.xml", | |
"http://alifewellwasted.com/feed/atom/", | |
"http://nightvale.libsyn.com/rss", | |
"http://www.kahvi.org/podcast.php", | |
"http://feeds.feedburner.com/headphonecommutepodcast", | |
"http://feeds.feedblitz.com/farpastpostPodcasts", | |
"http://brainwashed.com/podcast/podcast_rss.xml", | |
"http://liminal.libsyn.com/rss" | |
) | |
cd $dir | |
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath | |
foreach ($url in $urls) { | |
$a = ([xml](new-object net.webclient).downloadstring($url)) | |
$a.rss.channel.item[0..($episodes-1)] | foreach{ | |
$url = New-Object System.Uri($_.enclosure.url) | |
$file = [System.IO.Path]::GetFileName($url) | |
$file | |
if (!(test-path $file)) | |
{ | |
(New-Object System.Net.WebClient).DownloadFile($url, $file) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment