Personally like Songtaste website songs, download methods are endless, but as programmers if not know the principle of the method is really ashamed. The first simple point of course has a sniffer such as Google plug-in, but the principle of this tool is not very well understood. Today, we summarize the actual download links for some of the songs on the Songtaste website. Thank you very much for http://www.crifan.com/'s songtaste song Downloader ~ Learning a lot of content.
1. Open the source code of the Songtaste website, search <div id= "playicon" style= "margin-left:-12px" >. The next piece of div content and then the key to get the real song URL.
< Span class= "Webkit-html-attribute-name" > 2. Next a div of the format of the source paste as follows: &NBSP;
<div style= ' Display:none; ' > <a href= "javascript:playmedia1 (' Playicon ', ' Player ', ' B988a3d864d81432c381d8aa2f1f63b1e5f39744a99ab1911d6bfbb557876cd10a66e196e50166602f1ced3fe51ffc51 ', ' 355 ', ' 68 ', ' B3a7a4e64bcd8aabe4cabe0e55b57af5 ', ' http://m2 ', ' 1357638 ', 0); Listenlog (1357638, 0); " > <b> Listen now</b> </a> (<a href=" javascript:; "Onclick=window.open ("/ playmusic.php?song_id=1357638 ", ' popwin_kt ', ' menubar=no,location=no,resizable=no,scrollbars=no,status=no,width= 50,height=50 '); > Eject play </a>) </div><script src= "/stflashplayer/js/swfobject.js" ></script><script> var flashvars = {}; var params = {menu: "false", scale: "Noscale", allowFullScreen: "true", allowScriptAccess: "Always", Wmode: "Transparent"};p arams.allowscriptaccess= "Always";p arams.haspriority= "true";p arams.swliveconnect= "true"; var attributes = {id: " Stwebplayer "};swfobject.embedswf" ("/stflashplayer/stplayer_1.12.swf", "Stwebplayer", "360", "70", "10.0.0", "/ Stflashplayer/expressinstall.swf ", flashvars, params, attributes); function Swfready () {var strurl =" b988a3d864d81432c 381d8aa2f1f63b1e5f39744a99ab1911d6bfbb557876cd10a66e196e50166602f1ced3fe51ffc51 "; var Head = "http://m2."; var type = "B3a7a4e64bcd8aabe4cabe0e55b57af5"; var iscopy = "0"; if (Strurl.indexof (' rayfile ') >0 && iscopy <= 0) {var songurl = Head + strurl + getsongtype (type); var obj = {name: "When I look back at you for a moment (the TV show You and Me)", Url:songurl, Isshowlogo: "0", Isautoreplay:1, isautoplay:0}; Setsonginfo (obj); } flashplay ("B988a3d864d81432c381d8aa2f1f63b1e5f39744a99ab1911d6bfbb557876cd10a66e196e50166602f1ced3fe51ffc51", "1357638", "0"); Listenlog ("1357638 "," 0 ");} function Setsonginfo (obj) {try {var stplayerswfobj = Swfobject.getobjectbyid ("Stwebplayer"); Stplayerswfobj.setsonginfo (obj); } catch (e) {alert (e.description); }}function Playaudio () {var stplayerswfobj = Swfobject.getobjectbyid ("Stwebplayer"); Stplayerswfobj.playaudio ();} function Pauseaudio () {var stplayerswfobj = Swfobject.getobjectbyid ("Stwebplayer"); Stplayerswfobj.pauseaudio ();} function Playerplaystart () {}function playerpaused () {}function Flashplay (strurl,st_songid,t) {$.ajax ({type: ' POST '), URL: '/time.php ', Cache:false, data: ' str= ' +strurl+ ' &sid= ' +st_songid+ ' &t= ' +t, DataType: ' HTML ', success : function (data) {if (data) {var obj = {name: "When I look back at your moment (TV show You and me as the end song)", Ur L:data, Isshowlogo: "0", Isautoreplay:1, isautoplay:0}; Setsonginfo (obj); if (Data.indexof (' duomi.com '); 0) {$ ("#show_logo"). Show (); }}}, Error:function (data) {}});} </script><div id= "Stwebplayer" >
3. The main content is the area of red label, JS variable name also betrayed the real Song URL link, here see Songtaste song true link source is rayfile network disk, direct use of var Songurl = Head + strURL + Getsongtype (type) for stitching. The definition of the Getsongtype (type) function is here: http://image.songtaste.com/inc/main.js
function Getsongtype (md5code) {switch (md5code) {case "7d99bb4c7bd4602c342e2bb826ee8777": Return ". wma"; Break;case " 25e4f07f5123910814d9b8f3958385ba ": Return". Wma "; Break;case" 51bbd020689d1ce1c845a484995c0cce ": Return". WMA "; Break;case" B3a7a4e64bcd8aabe4cabe0e55b57af5 ": Return". mp3 "; Break;case" d82029f73bcaf052be8930f6f4247184 ": Return ". MP3 "; Break;case" 5fd91d90d9618feca4740ac1f2e7948f ": Return". Mp3 "; break;}}
So according to the above method can be very simple splicing out the existence of the network disk of those real songs link ;
Next is the Ajax asynchronous to get a real link to the song, in fact, it is very easy;
Later can also find another important function is here, the logic and the second part of the red area is similar to the same, the function should be the same, if the first can be located here can also easily get a real URL link.
Media linkfunction playmedia1 (Playicon, Strid,strurl,intwidth,intheight,type, head,st_songid,t) {Playicon.replace ("", "%20"), Strid.replace ("", "%20"), var Objdiv=document.getelementbyid (Strid);d Ocument.getelementbyid (Playicon). Style.display= ' None '; if (!objdiv) return false;if (objdiv.style.display!= ' None ') {objdiv.innerhtml= '; o Bjdiv.style.display= ' None ';} else {if (Strurl.indexof (' rayfile ') >0) {var songurl = Head + strurl + getsongtype (type); Objdiv.innerhtml=makemedia_ HTML (songurl,intwidth,intheight); objdiv.style.display= ' block ';} else {$.ajax {type: ' POST ', url: '/time.php ', Cache:false,data: ' str= ' +strurl+ ' &sid= ' +st_songid+ ' &t= ' +t, DataType: ' HTML ', success:function (data) {//alert (data), if (data) {objdiv.innerhtml=makemedia_html (Data,intwidth, Intheight) objdiv.style.display= ' block ', if (Data.indexof (' duomi.com ') > 0) {$ ("#show_logo"). Show ();}}},error: function (data) {//alert (' Error ');}});}}
4. As can be seen from the callout code above, another way to get a real link is to send a request for/time.php, the requested data format: ' str= ' +strurl+ ' &sid= ' +st_songid+ ' &t= ' +t, Because the PHP file cannot be opened, here is a real URL link using the Postman Impersonation request: Here's what I get for a specific URL instance;
This gives you another way to get a true link to a URL.
Songtaste website song Real URL get