腾讯微云外链
百度,360,金山……之前的網盤大戰終于落幕。360無限空間獲勝……
話說騰訊的10T也可以了,不多說了。下面是微云外連:
?
<?php
//最后更新時間:2013-12-12
//構造微云分享地址
preg_match('|\/.+\/(\w+)\.|', $_SERVER['REQUEST_URI'], $res);
$key = $res ? $res[1] : exit("Url format error!");
$url = $referer = "http://share.weiyun.com/$key";
//獲取源碼,匹配出下載地址
$src = curl_get_contents($url, "");
preg_match('|shareInfo = (.*);|Ui', $src, $res);
$json = $res ? json_decode($res[1]) : exit("Can not get shareInfo!");
//拼接歌曲鏈接
$songurl = implode("", array(
"http://".$json->dl_svr_host,
":".$json->dl_svr_port,
"/ftn_handler",
"/".$json->dl_encrypt_url,
"?fname=".urlencode($json->filename),
));
header("Location: $songurl");
//用curl獲取網頁源碼
function curl_get_contents($url, $referer) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_REFERER, $referer);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us)");
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
$src = curl_exec($curl);
curl_close($curl);
return $src;
}
?>
?
?
保存weiyun.php文件,ok.
?
如果分享地址為:
http://share.weiyun.com/37b92875f407f6d595c6eab92792d41a
則外鏈地址為:
http://xxx/weiyun.php/37b92875f407f6d595c6eab92792d41a.mp3
總結
- 上一篇: android在Service中弹出Di
- 下一篇: iOS培训章节——C++函数的重载