PoshCode Archive  Artifact Content

Artifact 8973b4e65c1747d508c1850207b215c8dd1804f0c469aed2cf9f69988d3b7504:

  • File playlist-com-music-cache.ps1 — part of check-in [5dfd9a7814] at 2018-06-10 12:57:10 on branch trunk — a one liner to download playlist.com music to a cache directory. (user: unknown size: 628)

# encoding: ascii
# api: powershell
# title: playlist.com music cache
# description: a one liner to download playlist.com music to a cache directory.
# version: 0.1
# license: CC0
# x-poshcode-id: 1429
# x-derived-from-id: 1437
# x-archived: 2011-01-17T07:46:47
#
#

#put the playlist.com playlist number into $pl
$pl = 14870805259;

([xml](new-object system.net.webclient).downloadstring("http://pl.playlist.com/pl.php?playlist=$([int]($pl/256))")).playlist.tracklist.track | % {try { $a= $_.tracktitle;$a;(new-object system.net.webclient).downloadfile($_.originallocation,"c:\musiccache\$a.mp3") } catch { } }