复制代码 代码如下:
<?php
//–调用方法/demo.php?url=/d/file/titlepic/y404 />
echo getyoukuflv($_get[‘url’]);
function getyoukuflv($url){
preg_match(“#id_(.*?)\.html#”,$url,$out);
$id=工作总结格式$out[1];
$content=get_curl_contents(‘/d/file/titlepic/0d2wimqaal />
$data=json_decode($content);
foreach($data->data[0]->streamfileids as $k=>$v){
$sid=getsid();
$fileid=getfileid($v,$data->data[0]->ed);
$one=($data->data[0]->gs->$k);
if($k == ‘flv’ || $k == ‘mp4’) return “http://f.youku.com/player/getflvpath/sid/{$sid}_00/st/{$k}/fileid/{$fileid}?k={$one[0]->k}”;
continue;
}
}
function get_curl_contents($url, $cond = 5){
if(!function_exists(&八年级数学教学反思#8216;curl_init’)) die(‘php.ini未开启php_curl.dll’);
$c = curl_init();
curl_topt($c,curlopt_url,$url);
$uragent=$_rver[‘http_ur_agent’];
curl_topt($c,curlopt_uragent,$uragent);
curl_topt($c,curlopt_header,0);
curl_topt($c,curlopt_timeout,$cond);
curl_topt($c,curlopt_returntransfer, true);
$cnt = curl_exec($c);
$cnt=mb_check_encoding($cnt,’utf-8′)?iconv(‘五一图片2021新图片gbk’,’utf-8//ignore’,$cnt):$cnt; //字符编码转换
curl_clo($c);
return $cnt;
}
function getsid() {
$sid = time().(rand(0,9000)+10000);
return $sid;
}
function getkey($key1,$key2){
$a = hexdec($key1);
$b = $a ^ 0xa55aa5a5;
$b = dechex($b);
return $key2.$b;
}
function getfileid($fileid,$ed) {
$mixed = getmixstring($ed);
$ids = explode(“*”,$fileid);
unt($ids[count($ids)-1]);
$realid = “”;
for ($i=0;$i < 阅兵仪式作文count($ids);++$i) {
$idx = $ids[$i];
$realid .= substr($mixed,$idx,1);
}
return $realid;
}
function getmixstring($ed) {
$mixed = “”;
$source = “abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz/\\:._-1234567890”;
$len = strlen($sourc汤天奇e);
for($i=0;$i< $len;++$i){
$ed = ($ed * 211 + 30031) % 65536;
$index = ($ed / 65536 * strlen($source));
$c = substr($source,$index,1);
$mixed .= $c;
$source = str_replace($c, “”,$source);
}
return $mixed;
}
?>
本文发布于:2023-04-06 10:15:31,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/64a3165746ae21c0d07fd2750339cb5f.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:解析获取优酷视频真实下载地址的PHP源代码.doc
本文 PDF 下载地址:解析获取优酷视频真实下载地址的PHP源代码.pdf
留言与评论(共有 0 条评论) |