进入www.ting88.com的网站,把歌手专辑页面的URL复制到文本框中再提交就可以得到歌曲的下载路径,如:http://www.ting88.com/MusicList/4141.htm
源程序如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
on error resume next dim id,url,getCode,m,i,j,s,d,ns,nd,num,name id=trim(request.querystring("id")) '1.获取原网页所有内容 Function getHTTPPage(url) dim http set http=Server.createobject("Microsoft.XMLHTTP") Http.open "GET",url,false Http.send() if Http.readystate<>4 then exit function end if getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312") set http=nothing if err.number<>0 then err.Clear End function '2.编码转换 Function BytesToBstr(body,Cset) dim objstream set objstream = Server.createObject("adodb.stream") objstream.Type = 1 objstream.Mode =3 objstream.Open objstream.Write body objstream.Position = 0 objstream.Type = 2 objstream.Charset = Cset BytesToBstr = objstream.ReadText objstream.Close set objstream = nothing End Function '得到明码URL function MyReplace(ConvStr) ConvStr=replace(ConvStr,"YVI","1") ConvStr=replace(ConvStr,"ESR","2") ConvStr=replace(ConvStr,"SXN","3") ConvStr=replace(ConvStr,"STI","4") ConvStr=replace(ConvStr,"WFU","5") ConvStr=replace(ConvStr,"LQU","6") ConvStr=replace(ConvStr,"QGI","7") ConvStr=replace(ConvStr,"BLA","8") ConvStr=replace(ConvStr,"JFU","9") ConvStr=replace(ConvStr,"LSN","0") ConvStr=replace(ConvStr,"XPG","/") ConvStr=replace(ConvStr,"XQD",".") ConvStr=replace(ConvStr," ","") ConvStr=replace(ConvStr,"%20","") ConvStr=replace(ConvStr,"KWD","Wma") MyReplace=ConvStr end function if id="1" then url=trim(request.form("txturl")) if url="" then response.redirect("GetMusic.asp") response.end() end if 'url="http://www.ting88.com/MusicList/1454.htm" s=0 d=0 ns=0 nd=0 getCode=getHTTPPage(url) num=mid(getCode,instrrev(getCode,". name=mid(getCode,instr(getCode,"歌手姓名:")+5,10) '获取歌手 m="http://218.75.78.189/33445566/" response.write "<center>该面页共找到 " & name & "的 <span style="color: red;">" & num& "</span> 首歌曲" & "" response.write " <table width="'80%'" border="'1'" cellspacing="'0'" cellpadding="'0'"> <tbody> <tr> <td>页面URL:<a href="'"" target="'_blank'">" & url & "</a></td> </tr> </tbody> </table> <hr width="'80%'" />" response.write " <table width="'80%'" border="'0'" cellspacing="'0'" cellpadding="'0'" bgcolor="'#A4C8FF'"> <tbody> <tr> <td> " for i=1 to num s=instr(i+s,getCode,"checked"" value='") d=instr(i+d,getCode,"KWD'>") ns=instr(i+ns,getCode,"word=") nd=instr(i+nd,getCode,"&inc=") response.write "" next response.write " <table width="'100%'" border="'0'" cellspacing="'1'" cellpadding="'2'"> <tbody> <tr> <td align="center" bgcolor="'#FFFFFF'">序号</td> <td align="center" bgcolor="'#FFFFFF'">歌名</td> <td align="center" bgcolor="'#FFFFFF'">操作</td> </tr> <tr> <td align="center" bgcolor="'#FFFFFF'">" & i & "</td> <td bgcolor="'#FFFFFF'"><a href="'"">" & mid(getCode,ns+5,nd-ns-5) & "</a></td> <td align="center" bgcolor="'#FFFFFF'"><a href="'"">下载</a></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </center>" end if |
1 |
获取专辑歌曲的URL地址 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<form action=""GetMusic.asp?id=1"" method=""post"" name=""form1"">? <table width="'80%'" border="'0'" cellspacing="'0'" cellpadding="'0'" align=""center"" bgcolor="'#A4C8FF'"> <tbody> <tr> <td> <table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""2"" align=""center""> <tbody> <tr> <td height=""30"">获取专辑歌曲的URL地址</td> </tr> <tr> <td bgcolor=""#FFFFFF"" height=""30"">网页地址: <input id=""txturl"" type=""text"" name=""txturl"" size=""80"" maxlength=""100"" /></td> </tr> <tr> <td bgcolor=""#FFFFFF"" height=""30""><input type=""submit"" name=""Submit"" value=""提" /> <input id=""Reset"" type=""reset"" name=""Reset"" value=""重" /></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> ? </form> |