Skip to content

Instantly share code, notes, and snippets.

@r4dian
Last active August 7, 2017 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r4dian/2b64b2ebe7b76776a31c to your computer and use it in GitHub Desktop.
Save r4dian/2b64b2ebe7b76776a31c to your computer and use it in GitHub Desktop.
$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