本帖最后由 tjinlina2010 于 2011-7-26 00:32 编辑
qiyi.com (必須是http://www.qiyi.com/yinyue/***/***.html)
我不知道是否所有人都有這問題,但我有。
主要更新圖片問題
- }elseif('qiyi.com' == $host){
- $content = file_get_contents($link);
- preg_match_all("/title[\w\W]:[\w\W]"(.*?)",/i",$content,$str2);
- preg_match_all("/videoId[\w\W]:[\w\W]"(.*?)",/i",$content,$str3);
- preg_match_all("/albumId[\w\W]:[\w\W]"(.*?)",/i",$content,$str4);
- preg_match_all("/tvId[\w\W]:[\w\W]"(.*?)",/i",$content,$str5);
- $title = iconv('UTF-8', 'GB18030', $str2[1][0]); //得到視頻標題
- $str1 = parse_url($link);
- preg_match_all("/\/(.*?)\//i",$str1['path'],$str);
- $vdate = $str[1][0]; //得到日期
- $vcode = $str3[1][0];
- $albid = $str4[1][0]; //所在專輯ID
- $vinid = $str5[1][0]; //視頻ID
- //生成圖片和視頻URL
- $img[1][0] = "http://www.qiyipic.com/thumb/".$vdate."/a".$albid."_160_90.jpg";
- $geturl = "http://player.video.qiyi.com/".$vcode;
- }
- $str[0] = $img[1][0];
- $str[1] = $title;
- $str[2] = $geturl;
- $str[3] = $message;
- if($str){
- return $str;
- }
- }
复制代码
1.換成(utf-8合適)
- }elseif('qiyi.com' == $host){
- $content = file_get_contents($link);
- preg_match_all("/title[\w\W]:[\w\W]"(.*?)",/i",$content,$str2);
- preg_match_all("/videoId[\w\W]:[\w\W]"(.*?)",/i",$content,$str3);
- preg_match_all("/albumId[\w\W]:[\w\W]"(.*?)",/i",$content,$str4);
- preg_match_all("/tvId[\w\W]:[\w\W]"(.*?)",/i",$content,$str5);
- $title = $str2[1][0]; //得到視頻標題
- //url : "http://www.qiyi.com/yinyue/20110712/4708a7bb0dbf0c0b.html",
- preg_match_all("/url[\w\W]:[\w\W]"http:\/\/www.qiyi.com\/yinyue\/([\w\-]+)\/?/i",$content,$str);
- $vdate = $str[1][0]; //得到日期
- $vcode = $str3[1][0];
- $albid = $str4[1][0]; //所在專輯ID
- $vinid = $str5[1][0]; //視頻ID
- //生成圖片和視頻URL
- $img[1][0] = "http://www.qiyipic.com/thumb/".$vdate."/a".$albid."_160_90.jpg";
- $geturl = "http://player.video.qiyi.com/".$vcode;
- }
- $str[0] = $img[1][0];
- $str[1] = $title;
- $str[2] = $geturl;
- $str[3] = $message;
- if($str){
- return $str;
- }
- }
复制代码
2.換成(gbk)
- }elseif('qiyi.com' == $host){
- $content = file_get_contents($link);
- preg_match_all("/title[\w\W]:[\w\W]"(.*?)",/i",$content,$str2);
- preg_match_all("/videoId[\w\W]:[\w\W]"(.*?)",/i",$content,$str3);
- preg_match_all("/albumId[\w\W]:[\w\W]"(.*?)",/i",$content,$str4);
- preg_match_all("/tvId[\w\W]:[\w\W]"(.*?)",/i",$content,$str5);
- $title = iconv('UTF-8', 'GB18030', $str2[1][0]); //得到視頻標題
- //url : "http://www.qiyi.com/yinyue/20110712/4708a7bb0dbf0c0b.html",
- preg_match_all("/url[\w\W]:[\w\W]"http:\/\/www.qiyi.com\/yinyue\/([\w\-]+)\/?/i",$content,$str);
- $vdate = $str[1][0]; //得到日期
- $vcode = $str3[1][0];
- $albid = $str4[1][0]; //所在專輯ID
- $vinid = $str5[1][0]; //視頻ID
- //生成圖片和視頻URL
- $img[1][0] = "http://www.qiyipic.com/thumb/".$vdate."/a".$albid."_160_90.jpg";
- $geturl = "http://player.video.qiyi.com/".$vcode;
- }
- $str[0] = $img[1][0];
- $str[1] = $title;
- $str[2] = $geturl;
- $str[3] = $message;
- if($str){
- return $str;
- }
- }
复制代码
|