Parašė avice· 2015 Bal. 24 11:04:06
#2
function checksong($server,$file) {
$ch = curl_init("http://www.zippyshare.com/rest/publicStats/forFile/www".$server."/".$file."?");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$x=json_decode(curl_exec($ch),true);
return ($x['filename']==NULL?false:true);
curl_close($ch);
}
//www43.zippyshare.com/v/2668248/file.html
if(!checksong('43','2668248')){
// trinam
}
Atsimenu buvau ir lengvesi varianta sugalvojes kuris sukasi labai greitai, kuris neatsiuncia turinio i serveri, o tiesiog patikrina headers, jei puslapis neegzistuoja tuomet dainos nera, bet neberandu.
Redagavo avice· 2015 Bal. 24 11:04:41