我想下载所有链接到 .XML 文件的 .mp3 文件,例如这个:http://blog.iso50.com/audio/pl17/playlist-wordtube.xml
有可用的工具吗?谢谢 Sarah
答案1
使用 Firefox 插件:全部击倒!!
答案2
假设您可以访问这两个工具wget
和,使用以下命令Perl
获取文件:playlist-wordtube.xml
$ wget http://blog.iso50.com/audio/pl17/playlist-wordtube.xml
playlist-wordtube.xml
现在,您可以使用以下 Perl 脚本从文件中查看要下载的文件:
$ perl -e 'while (<>) {if (/mp3<\/location>/) {s/^[^<]+<location>(.*)<\/location>/$1/; print;}}' < playlist-wordtube.xml | head
http://blog.iso50.com/audio/pl17/01-Awake.mp3
http://blog.iso50.com/audio/pl17/02-GardensVilla-Bullet-Train.mp3
http://blog.iso50.com/audio/pl17/03-Antiphon.mp3
http://blog.iso50.com/audio/pl17/04AtomsForPeace-Dropped.mp3
http://blog.iso50.com/audio/pl17/05Veaquis1.mp3
http://blog.iso50.com/audio/pl17/06Jade1.mp3
http://blog.iso50.com/audio/pl17/07JonHopkins.mp3
http://blog.iso50.com/audio/pl17/08MadmenLove.mp3
http://blog.iso50.com/audio/pl17/09Jet1.mp3
http://blog.iso50.com/audio/pl17/10Spiral.mp3
将上述脚本中的更改为print
,我们就可以回答您的问题:wget
perl
$ perl -e 'while (<>) {if (/mp3<\/location>/) {s/^[^<]+<location>(.*)<\/location>/$1/; `wget $_`;}}' < playlist-wordtube.xml
[LOTS OF INTERNET FILE TRANSFER HANDSHAKING MESSAGES]
$ ls -1 | head
01-Awake.mp3
02-GardensVilla-Bullet-Train.mp3
03-Antiphon.mp3
04AtomsForPeace-Dropped.mp3
05Veaquis1.mp3
06Jade1.mp3
07JonHopkins.mp3
08MadmenLove.mp3
09Jet1.mp3
10Spiral.mp3