载入中
自定义HTML载入中... loading
下载百度top500歌曲的shell[修改版2007-04-11] [原创 2007-04-11 10:30:03]  删除... 
字体变小 字体变大

百度做了改版,因此原来网上的top500下载程序不能用了。针对新版百度作了修改。

你只要有一个linux主机,并且有执行shell脚本的权限,就可以一网打尽baidu的top500歌曲。

脚本部分借鉴了:http://spaces.abccba.net/cache/14.htm

主机上需要安装wget,tr,pcregrep ,sed等软件包。

以下是程序清单:

#!/bin/sh
wget http://list.mp3.baidu.com/topso/mp3topsong.html -O mp3topsong.html
cat mp3topsong.html | tr \" \\n | pcregrep 'http:\/\/mp3\.baidu\.com\/.+word=.+\+.*' > list.raw

while read line
do
  line=`echo $line\&lm=0`;
  wget $line -O temp.html;
  songtemp=`cat temp.html | tr \" \\\n | pcregrep 'http:\/\/202\.108\.23\.172\/m'| head -1`;
  songtemp=`echo $songtemp|tr [:blank:] %20`;
  wget $songtemp -O songtemp.html;
  url=`cat songtemp.html | tr \" \\\n | pcregrep mp3$ | pcregrep ^http:// | head -1`;
  title=`echo $songtemp| tr '=' \\\n | pcregrep 'baidusg.+\&word' | sed 's/baidusg,//' | sed 's/\&word//'`;
  title=`echo $title\.mp3`;
  wget $url -O $title;
done < 'list.raw'

所属版块: 科技
票数:
什么是“我顶”?
点击数:    评论数:
本文章引用通告地址(TrackBack Ping URL)为:
本文章尚未被引用。
发表评论
大 名:
(不填写则显示为匿名者)
网 址:
(您的网址,可以不填)
标 题:
内 容:
请根据下图中的字符输入验证码:
(您的评论将有可能审核后才能发表)
和讯个人门户 v1.0 | 和讯部落 | 客服中心