Skip to content
WONGCW 網誌
  • 首頁
  • 論壇
  • 微博
  • 壁紙下載
  • 免費圖床
  • 視頻下載
  • 聊天室
  • SEO工具
  • 支援中心
  • 表格製作
  • More
    • 在線名片
    • 網頁搜索
    • 天氣預報
    • 二維碼生成器
    • WordPress 插件及主題下載
  • Search Icon

WONGCW 網誌

記錄生活經驗與點滴

爱奇艺解析源码

爱奇艺解析源码

2018-12-11 Comments 0 Comment
  1. <?php   
  2. echo Iqiyi::parse($url);  
  3.   
  4. class Iqiyi  
  5. {  
  6.     /** 
  7.      * [parse 解析网页获取视频ID] 
  8.      * @param  [type] $url  [description] 
  9.      * @return [type]       [description] 
  10.      */  
  11.     public static function parse($url)  
  12.     {  
  13.         $html = self::curl($url);  
  14.   
  15.         if($html){  
  16.             preg_match(‘#vid”:”(.*)”,#iU’,$html,$vids); 
  17.             preg_match(‘#tvId”:(.*),”#iU’,$html,$tvids); 
  18.             preg_match(‘#param\[\’isMember\’\]\s*=\s*”(.*)”;#’,$html,$bool); 
  19.             preg_match(‘#tvName:”(.*)”#iU’,$html,$tvName); 
  20.             preg_match(‘#property=”og:image”\s*content=”(.*)”#’,$html,$images); 
  21.             if (!$vids[1]) { 
  22.                 preg_match(‘#data-player-videoid=”(.*)”#iU’,$html,$vids); 
  23.             } 
  24.             if (!$tvids[1]) { 
  25.                 preg_match(‘#data-player-tvid=”(.*)”#iU’,$html,$tvids); 
  26.             } 
  27.             if (!$tvName[1]) { 
  28.                 preg_match(‘#name=”irTitle”\s*content=”(.*)”#’,$html,$tvName); 
  29.             } 
  30.             $ids[‘uid’] = empty($_uid[1])?””:$_uid[1];                          //用户需从cookie里P00010获取,请自行修改 
  31.             $ids[‘qyid’] = empty($_qyid[1])? “d56mj2ujli317a4mvdxq5i73”:$_qyid[1];//用户需从cookie里QC006获取,请自行修改 
  32.             $ids[‘agenttype’] = 13; 
  33.             $ids[‘type’] = ‘mp4’; 
  34.             $time = number_format(microtime(true),3,”,”); 
  35.             $ids[‘sgti’] = “{$ids[‘agenttype’]}_{$ids[‘qyid’]}_{$time}”; 
  36.  
  37.             $ids[‘title’] = $tvName[1]; 
  38.             $ids[‘member’] = $bool[1];//是否为付费视频 
  39.             $ids[‘vid’] = $vids[1]; 
  40.             $ids[‘tvid’] = $tvids[1]; 
  41.             $ids[‘image’] = isset($images[1]) ? $images[1] : ”; 
  42.             $ids[‘src’] = ‘02020031010000000000’; 
  43.             $ids[‘url’] = $url; 
  44.             $ids[‘ref’] = $url; 
  45.  
  46.             $api = ‘https://mixer.video.iqiyi.com/jp/mixin/videos/’.$ids[‘tvid’]; 
  47.             $html = self::curl($api,$ids); 
  48.             $html = str_replace(‘var tvInfoJs=’,”,$html); 
  49.             $json = json_decode($html,true); 
  50.  
  51.             $ids[‘title’] = isset($json[‘name’]) ? $json[‘name’] : $ids[‘title’]; 
  52.             $ids[‘des’] = isset($json[‘des’]) ? $json[‘des’] : $ids[‘des’]; 
  53.             $ids[‘poster’] = isset($json[‘imageUrl’]) ? str_replace(“.jpg”, “_480_270.jpg”,$json[‘imageUrl’]) : str_replace(“.jpg”, “_480_270.jpg”,$ids[‘image’]) ;  
  54.  
  55.             //print_r($ids);exit; 
  56.  
  57.             // 
  58.             // 
  59.             // 
  60.             $videoinfo = self::get_video($ids); 
  61.             return json_encode($videoinfo); 
  62.         } 
  63.  
  64.     } 
  65.     /** 
  66.      * [get_tmts_video 解析视频地址] 
  67.      * @param  [type] $tvid [description] 
  68.      * @param  [type] $vid  [description] 
  69.      * @return [type]       [description] 
  70.      */ 
  71.     public static function get_video($ids) 
  72.     { 
  73.         if($ids[‘member’]===’true’){//付费视频 
  74.             $url = ‘./yun/?url=’.$ids[‘url’]; 
  75.             $videoinfo[‘code’] = 200; 
  76.             $videoinfo[‘play’] = ‘iframe’; 
  77.             //$videoinfo[‘msg’] = $ids[‘title’] . ‘为爱奇异VIP资源!VIP资源全网搜索中….’; 
  78.             $videoinfo[‘data’][‘url’] = $url;  
  79.             return $videoinfo;exit; 
  80.         }else{ 
  81.             $api = self::get_tmts_data($ids); 
  82.             $ids[‘cookie’] = ‘P00001=’; 
  83.             $content = self::curl($api,$ids); 
  84.         } 
  85.  
  86.         $body = preg_replace(“#var tvInfoJs=#”,””,$content); 
  87.  
  88.         $json = json_decode($body,true); 
  89.         //print_r($json);exit; 
  90.  
  91.         if ($json[‘code’]==’A00000′ && isset($json[‘data’])){ 
  92.             $data = $json[‘data’]; 
  93.             $vidl = $data[‘vidl’];              //视频地址列表 
  94.                 $datainfo[‘code’] = 200; 
  95.                 $datainfo[‘play’] = ‘ajax’; 
  96.                 $datainfo[‘type’] = ‘iqiyi’; 
  97.                 $datainfo[‘msg’] = ”; 
  98.                 $datainfo[‘data’][“vid”] = $ids[‘vid’]; 
  99.                 $datainfo[‘data’][“tvid”] = $ids[‘tvid’]; 
  100.                 $datainfo[‘data’][“uid”] = $ids[‘uid’]; 
  101.                 $datainfo[‘data’][“qyid”] = $ids[‘qyid’]; 
  102.                 $datainfo[‘data’][“type”] = $ids[‘type’]; 
  103.                 $datainfo[‘data’][“src”] = $ids[‘src’]; 
  104.                 $datainfo[‘data’][“agenttype”] = $ids[‘agenttype’]; 
  105.                 $datainfo[‘data’][“jsdir”] = GlobalBase::https_url().’/static’; 
  106.                 $datainfo[‘data’][“poster”] = $ids[‘poster’]; 
  107.  
  108.         } 
  109.         return $datainfo; 
  110.     } 
  111.     public static function get_tmts_url($ids) {//付费视频提交cookie 
  112.         preg_match(‘#P00010=(\d+);#iU’,COOKIE_IQIYI,$_uid); 
  113.         preg_match(‘#QC006=(.*);#iU’,COOKIE_IQIYI,$_qyid); 
  114.         $domain = “http://cache.m.iqiyi.com”;  
  115.         $uid = emptyempty($_uid[1])?””:$_uid[1];                         //用户需从cookie里P00010获取,请自行修改 
  116.         $qyid = empty($_qyid[1])? “d56mj2ujli317a4mvdxq5i73”:$_qyid[1];//用户需从cookie里QC006获取,请自行修改 
  117.         $agenttype = 13; 
  118.         $time = number_format(microtime(true),3,”,”); 
  119.         $type = $_REQUEST[‘isphone’] == 0 ? ‘m3u8′:’mp4’; 
  120.         $tm = mb_substr($time,0,11); 
  121.         $sgti = “{$agenttype}_{$qyid}_{$time}”; 
  122.         $src = ‘1702633101b340d8917a69cf8a4b8c7c’ ; // “02020031010000000000”; 
  123.         $tmtsreq = “/jp/tmts/”.$ids[‘tvid’].”/”.$ids[‘vid’].”/?uid={$uid}&cupid=qc_100001_100186&platForm=h5&qyid={$qyid}&agenttype={$agenttype}&type={$type}&rate=2&sgti={$sgti}&qdv=1&qdx=n&qdy=x&qds=0&tm={$tm}&src={$src}”;//platForm=PHONE 
  124.         $vf= md5($tmtsreq.”t6hrq6k0n6n6k6qdh6tje6wpb62v7654″); //参数校验码 
  125.         $url = $domain.$tmtsreq.”&vf={$vf}”; 
  126.  
  127.         //echo $url;eixt; 
  128.  
  129.         return $url; 
  130.     } 
  131.  
  132.     public static function get_mp4_data($ids) {//付费视频提交cookie 
  133.         preg_match(‘#P00010=(\d+);#iU’,COOKIE_IQIYI,$_uid); 
  134.         preg_match(‘#QC006=(.*);#iU’,COOKIE_IQIYI,$_qyid); 
  135.         $domain = “http://cache.m.iqiyi.com”;  
  136.         $uid = emptyempty($_uid[1])?””:$_uid[1];                         //用户需从cookie里P00010获取,请自行修改 
  137.         $qyid = empty($_qyid[1])? “d56mj2ujli317a4mvdxq5i73”:$_qyid[1];//用户需从cookie里QC006获取,请自行修改 
  138.         $agenttype = 13; 
  139.         $time = number_format(microtime(true),3,”,”); 
  140.         $type = $_REQUEST[‘isphone’] == 0 ? ‘m3u8′:’mp4’; 
  141.         $tm = mb_substr($time,0,11); 
  142.         $sgti = “{$agenttype}_{$qyid}_{$time}”; 
  143.         $src=’02020031010010000000′; 
  144.         $a=’/tmts/’.$ids[‘tvid’].’/’.$ids[‘vid’].’/?uid=&platForm=h5&agenttype=13&type=mp4&k_ft1=8&rate=2&p=&codeflag=1&qdv=1&qdx=n&qdy=x&qds=0&t=’.$tm.’&src=’.$src; 
  145.         $vf=md5($a.’3sj8xof48xof4tk9f4tk9ypgk9ypg5ul’); 
  146.         $api=’http://cache.m.iqiyi.com’.$a.’&vf=’.$vf; 
  147.         return $api; 
  148.     } 
  149.  
  150.     public static function get_tmts1_url($ids) { 
  151.         preg_match(‘#P00010=(\d+);#iU’,COOKIE_IQIYI,$_uid); 
  152.         preg_match(‘#QC006=(.*);#iU’,COOKIE_IQIYI,$_qyid); 
  153.         $domain = “https://cache.m.iqiyi.com”;  
  154.         $uid = emptyempty($_uid[1])?””:$_uid[1];                         //用户需从cookie里P00010获取,请自行修改 
  155.         $qyid = empty($_qyid[1])? “d56mj2ujli317a4mvdxq5i73”:$_qyid[1];//用户需从cookie里QC006获取,请自行修改 
  156.         $agenttype = 13; 
  157.         $time = number_format(microtime(true),3,”,”); 
  158.  
  159.         $type = $_REQUEST[‘isphone’] == 0 ? ‘m3u8′:’mp4’; 
  160.         $tm = mb_substr($time,0,11); 
  161.         $sgti = “{$agenttype}_{$qyid}_{$time}”; 
  162.         $src = “02020031010000000000”; 
  163.         $authkey = md5(”.$time.$tvid); 
  164.         $tmtsreq = “/jp/tmts/”.$ids[‘tvid’].”/”.$ids[‘vid’].”/?uid=&cupid=qc_100001_100186&platForm=h5&qyid=”.$qyid.”&agenttype=13&type=mp4&nolimit=&k_ft1=8&rate=2&sgti=”.$sgti.”&codeflag=1&preIdAll=&qd_v=1&qdy=a&qds=0&tm=”.$tm.”&src=02020031010000000000″;//platForm=PHONE 
  165.  
  166.         $vf= md5($tmtsreq.”u6fnp3eok0dpftcq9qbr4n9svk8tqh7u”); //参数校验码 
  167.         $url = $domain.$tmtsreq.”&vf={$vf}”; 
  168.  
  169.         return $url; 
  170.     } 
  171.     public static function get_tmts2_url($ids) {//付费视频提交cookie 
  172.         preg_match(‘#P00010=(\d+);#iU’,COOKIE_IQIYI,$_uid); 
  173.         preg_match(‘#QC006=(.*);#iU’,COOKIE_IQIYI,$_qyid); 
  174.         $domain = “http://cache.m.iqiyi.com”;  
  175.         $uid = emptyempty($_uid[1])?””:$_uid[1];                         //用户需从cookie里P00010获取,请自行修改 
  176.         $qyid = empty($_qyid[1])? “d56mj2ujli317a4mvdxq5i73”:$_qyid[1];//用户需从cookie里QC006获取,请自行修改 
  177.         $agenttype = 12; 
  178.         $time = number_format(microtime(true),3,”,”); 
  179.         $type = $_REQUEST[‘isphone’] == 0 ? ‘m3u8′:’mp4’; 
  180.         $tm = mb_substr($time,0,11); 
  181.         $sgti = “{$agenttype}_{$qyid}_{$time}”; 
  182.         //$src = “02020031010000000000”; 
  183.         //$tmtsreq = “/jp/tmts/{$tvid}/{$vid}/?uid={$uid}&cupid=qc_100001_100186&platForm=h5&qyid={$qyid}&agenttype={$agenttype}&type={$type}&rate=2&sgti={$sgti}&qdv=1&qdx=n&qdy=x&qds=0&tm={$tm}&src={$src}”;//platForm=PHONE 
  184.         //$vf= md5($tmtsreq.”3sj8xof48xof4tk9f4tk9ypgk9ypg5ul”); //参数校验码 
  185.  
  186.         $t = time(); 
  187.         $k = “d5fb4bd9d50c4be6948c97edd7254b0e”; 
  188.         $src = “76f90cbd92f94a2e925d83e8ccd22cb7”; 
  189.         $sc=md5($t.$k.$vid); 
  190.         $url=’http://cache.m.iqiyi.com/jp/tmts/’.$ids[‘tvid’].’/’.$ids[‘vid’].’/?t=’.$t.’&sc=’.$sc.’&src=’.$src; 
  191.         return $url; 
  192.     } 
  193.     public static function get_app_data($ids) {  //app端的vf算法 
  194.         preg_match(‘#P00010=(\d+);#iU’,COOKIE_IQIYI,$_uid); 
  195.         preg_match(‘#QC006=(.*);#iU’,COOKIE_IQIYI,$_qyid); 
  196.  
  197.         $uid = empty($_uid[1])?””:$_uid[1];      
  198.  
  199.         $platForm = “h5”; 
  200.  
  201.         $agenttype = “13”; 
  202.  
  203.         $type = “m3u8”; 
  204.  
  205.         $nolimit = 0; 
  206.  
  207.         $k_ft1 = 8; 
  208.  
  209.         $rate = 4; 
  210.  
  211.         $p = “”; 
  212.  
  213.         $codeflag = “1”; 
  214.  
  215.         $qdv = “1”; 
  216.  
  217.         $qdx = “n”; 
  218.  
  219.         $qdy = “x”; 
  220.  
  221.         $qds = 0; 
  222.  
  223.         $__jsT = “sgve”; 
  224.  
  225.         $qyid = empty($_qyid[1])? “d56mj2ujli317a4mvdxq5i73”:$_qyid[1];//用户需从cookie里QC006获取,请自行修改 
  226.  
  227.         $time = number_format(microtime(true),3,”,”); 
  228.  
  229.         $tm = mb_substr($time,0,11); 
  230.  
  231.         $sgti = “{$agenttype}_{$qyid}_{$time}”; 
  232.  
  233.         $src = “02028001010000000000”; 
  234.  
  235.         $tmtsreq = “/tmts/”.$ids[‘tvid’].”/”.$ids[‘vid’].”/?uid={$uid}&platForm={$platForm}&agenttype={$agenttype}&qyid={$qyid}&platForm=IPHONE&type={$type}&nolimit={$nolimit}&k_ft1={$k_ft1}&rate={$rate}&p={$p}&codeflag={$codeflag}&qdv={$qdv}&qdx={$qdx}&qdy={$qdy}&qds={$qds}&__jsT={$__jsT}&t={$tm}&src={$src}”; 
  236.  
  237.         $vf= md5($tmtsreq.”3sj8xof48xof4tk9f4tk9ypgk9ypg5ul”); //参数校验码 
  238.         $url = ‘https://cache.m.iqiyi.com’.$tmtsreq.”&vf={$vf}”; 
  239.         //echo $url;exit; 
  240.  
  241.         return $url; 
  242.     } 
  243.  
  244.     public static function get_vps_data($ids){ //pc 端接口 
  245.         preg_match(‘#P00010=(\d+);#iU’,COOKIE_IQIYI,$_uid); 
  246.         preg_match(‘#QC006=(.*);#iU’,COOKIE_IQIYI,$_qyid); 
  247.  
  248.         $host = ‘http://cache.video.qiyi.com’; 
  249.  
  250.         $src = ‘/vps?tvid=’.$ids[‘tvid’].’&vid=’.$ids[‘vid’].’&v=0&qypid=’.$ids[‘tvid’].’_12&src=1702633101b340d8917a69cf8a4b8c7c&platforms=PC_APP&t=’.GlobalBase::getMillisecond().’&k_tag=1&type=mp4&k_uid=’.self::get_macid().’&rs=1′; 
  251.  
  252.         //$vf = self::get_vf($src); 
  253.         $vf= md5($src.”u6fnp3eok0dpftcq9qbr4n9svk8tqh7u”); 
  254.  
  255.         $api = $host . $src . ‘&vf=’ . $vf; 
  256.  
  257.         if($ids[‘member’]===’true’){//付费视频 
  258.             $ids[‘cookie’] = COOKIE_IQIYI; 
  259.             $data = self::curl($api,$ids); 
  260.         }else{ 
  261.             $data = self::curl($api,$ids); 
  262.         } 
  263.  
  264.         //print_r($data);exit; 
  265.  
  266.         $data = json_decode($data,true); 
  267.  
  268.         if ($data[‘code’] == ‘A00000’) { 
  269.             $list = $data[‘data’][‘vp’][‘tkl’][0][‘vs’]; 
  270.             $dom = $data[‘data’][‘vp’][‘du’]; 
  271.             foreach ($list as $key => $value) { 
  272.                 switch ($value[‘bid’]) { 
  273.                     case 1: 
  274.                         $def = ‘普清’; 
  275.                         break; 
  276.                     case 2: 
  277.                         $def = ‘高清’; 
  278.                         break; 
  279.                     case 4: 
  280.                         $def = ‘超清’; 
  281.                         break; 
  282.                     case 96: 
  283.                         $def = ‘流畅’; 
  284.                         break; 
  285.                 } 
  286.  
  287.                 foreach ($value[‘fs’] as $k => $v) { 
  288.                     $a[$k][‘file’] = self::get_pc_url_data($dom.$v[‘l’],$ids); 
  289.                     $a[$k][‘duration’] = $v[‘d’]/1000; 
  290.                     $a[$k][‘bytesTotal’] = $v[‘b’]; 
  291.                 } 
  292.                 if ($value[‘bid’] == 4) { 
  293.                     $_loc[0][‘video’] = $a; 
  294.                     $_loc[0][‘type’] = ‘mp4’; 
  295.                     $_loc[0][‘weight’] = 10; 
  296.                     $_loc[0][‘definition’] = $def; 
  297.                 } 
  298.                 if ($value[‘bid’] == 2) { 
  299.                     $_loc[1][‘video’] = $a; 
  300.                     $_loc[1][‘type’] = ‘mp4’; 
  301.                     $_loc[1][‘weight’] = 10; 
  302.                     $_loc[1][‘definition’] = $def; 
  303.                 } 
  304.                 if ($value[‘bid’] == 1) { 
  305.                     $_loc[2][‘video’] = $a; 
  306.                     $_loc[2][‘type’] = ‘mp4’; 
  307.                     $_loc[2][‘weight’] = 10; 
  308.                     $_loc[2][‘definition’] = $def; 
  309.                 } 
  310.  
  311.             } 
  312.             for ($i=0; $i <= 2 ; $i++) { 
  313.                 if ($_loc[$i] == ”) { 
  314.                 continue; 
  315.             } 
  316.             $key_arrays[]=$_loc[$i]; 
  317.         } 
  318.         } 
  319.         $videoinfo[‘code’] = 200; 
  320.         $videoinfo[‘data’][‘poster’] = $ids[‘poster’]; 
  321.         $videoinfo[‘play’] = ‘mp4_list’; 
  322.         $videoinfo[‘data’][‘video’][0] = $key_arrays[0]; 
  323.  
  324.         print_r(json_encode($videoinfo));exit; 
  325.     } 
  326.  
  327.     public static function get_tmts_data($ids){  
  328.         $t = time()*1000; 
  329.         $src = “76f90cbd92f94a2e925d83e8ccd22cb7”; 
  330.         $key = “d5fb4bd9d50c4be6948c97edd7254b0e”; 
  331.         $vid = $ids[‘vid’]; 
  332.         $tvid = $ids[‘tvid’]; 
  333.         $sc = md5($t.$key.$vid); 
  334.         $url = “http://cache.m.iqiyi.com/jp/tmts/$tvid/$vid/?t=$t&sc=$sc&src=$src”;  
  335.         return $url;  
  336.     }  
  337.   
  338.     public static function get_pc_url_data($url,$ids){  
  339.         $data = file_get_contents($url);  
  340.   
  341.         $data = json_decode($data,true);  
  342.   
  343.         $u = $data[‘l’];  
  344.         return $u;  
  345.     }  
  346.   
  347.     public static function get_macid(){  
  348.         //”’获取macid,此值是通过mac地址经过算法变换而来,对同一设备不变”’  
  349.         $macid=”;  
  350.         $chars = ‘abcdefghijklnmopqrstuvwxyz0123456789’;  
  351.         $size = strlen($chars);  
  352.         for ($i=0; $i < 32 ; $i++) {   
  353.             $a = mt_rand(0,($size-1));  
  354.             $macid .= $chars[$a];  
  355.         }  
  356.         return $macid;  
  357.     }  
  358.     public static function get_vf($url_params){  
  359.         $sufix=”;  
  360.         for ($i=0; $i <8 ; $i++) {   
  361.             for ($j=0; $j <4 ; $j++) {   
  362.                 $v4 = 13 * (66 * $j + 27 * $i) % 35;  
  363.   
  364.                 if ($v4 >= 10) {  
  365.                     $v8 = $v4 + 88;  
  366.                 } else {  
  367.                     $v8 = $v4 + 49;  
  368.                 }  
  369.   
  370.                 $sufix .= chr($v8);  
  371.   
  372.             }  
  373.             $url_params .= $sufix;  
  374.         }  
  375.         //echo $url_params;exit;  
  376.         $vf = md5($url_params);  
  377.         return $vf;  
  378.     }  
  379.     public static function iqiyi_curl($url, $params = array()) {  
  380.         $ip = emptyempty($params[“ip”]) ? GlobalBase::rand_ip() : $params[“ip”];  
  381.         $header = array(‘X-FORWARDED-FOR:’.$ip,’CLIENT-IP:’.$ip); 
  382.         if(isset($params[“httpheader”])){ 
  383.             $header = array_merge($header,$params[“httpheader”]); 
  384.         } 
  385.         $referer = empty($params[“ref”]) ? $url : $params[“ref”]; 
  386.         $user_agent = empty($params[“ua”]) ? $_SERVER[‘HTTP_USER_AGENT’] : $params[“ua”] ; 
  387.  
  388.         $ch = curl_init();                                                      //初始化 curl 
  389.         curl_setopt($ch, CURLOPT_URL, $url);                                    //要访问网页 URL 地址 
  390.         curl_setopt($ch, CURLOPT_HTTPHEADER, $header);                          //伪装来源 IP 地址 
  391.         curl_setopt($ch, CURLOPT_REFERER, $referer);                            //伪装网页来源 URL 
  392.         curl_setopt($ch, CURLOPT_USERAGENT,$user_agent);                        //模拟用户浏览器信息 
  393.         curl_setopt($ch, CURLOPT_NOBODY, false);                                //设定是否输出页面内容 
  394.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                         //返回字符串,而非直接输出到屏幕上 
  395.         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, false);                        //连接超时时间,设置为 0,则无限等待 
  396.         curl_setopt($ch, CURLOPT_TIMEOUT, 3600);                                //数据传输的最大允许时间超时,设为一小时 
  397.         curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);                       //HTTP验证方法 
  398.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);                        //不检查 SSL 证书来源 
  399.         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);                        //不检查 证书中 SSL 加密算法是否存在 
  400.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);                         //跟踪爬取重定向页面 
  401.         curl_setopt($ch, CURLOPT_AUTOREFERER, true);                            //当Location:重定向时,自动设置header中的Referer:信息 
  402.         curl_setopt($ch, CURLOPT_ENCODING, ”);                                 //解决网页乱码问题 
  403.         curl_setopt($ch, CURLOPT_HEADER, empty($params[“header”])?false:true);  //不返回 header 部分 
  404.         if(!empty($params[“fields”])){ 
  405.             curl_setopt($ch, CURLOPT_POST, true);                                  //设置为 POST  
  406.             curl_setopt($ch, CURLOPT_POSTFIELDS,$params[“fields”]);                //提交数据 
  407.         } 
  408.         if(!empty($params[“cookie”])){ 
  409.             curl_setopt($ch, CURLOPT_COOKIE, $params[“cookie”]);                  //从字符串传参来提交cookies 
  410.         } 
  411.         if(!empty($params[“proxy”])){ 
  412.             curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);                  //代理认证模式 
  413.             curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);                  //使用http代理模式 
  414.             curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);  
  415.             curl_setopt($ch, CURLOPT_PROXY, “58.251.230.220:9797”);   //代理服务器地址 host:post的格式 
  416.             if(!empty($params[“proxy_userpwd”])){ 
  417.                 curl_setopt($ch, CURLOPT_PROXYUSERPWD, $params[“proxy_userpwd”]); //http代理认证帐号,username:password的格式 
  418.             } 
  419.         } 
  420.         $data = curl_exec($ch);                                                 //运行 curl,请求网页并返回结果 
  421.         curl_close($ch);                                                        //关闭 curl 
  422.         return $data; 
  423.     } 
  424.     public static function curl($url,$ids) 
  425.     { 
  426.         $params[“ua”] = !empty($ids[‘ua’]) ? $ids[‘ua’] : “Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36”; 
  427.         $params[“ip”] = “14.21.98.117”;//伪装为固定IP,否则会报异地登录,会封号,不要更改 
  428.         if (isset($ids[‘cookie’])) { 
  429.             $params[“cookie”] = $ids[‘cookie’]; 
  430.         } 
  431.         $params[“ref”] = “https://www.iqiyi.com”;  
  432.   
  433.         //$params[“proxy”] = PROXY;  
  434.         //return GlobalBase::iqiyi_curl($url,$params);  
  435.         return self::iqiyi_curl($url,$params);  
  436.     }  
  437. }  

分享此文:

  • 分享到 Twitter(在新視窗中開啟)
  • 按一下以分享至 Facebook(在新視窗中開啟)
  • 分享到 WhatsApp(在新視窗中開啟)
  • 按一下以分享到 Telegram(在新視窗中開啟)
  • 分享到 Pinterest(在新視窗中開啟)
  • 分享到 Reddit(在新視窗中開啟)
  • 按一下即可分享至 Skype(在新視窗中開啟)
  • 按一下即可以電子郵件傳送連結給朋友(在新視窗中開啟)
  • 點這裡列印(在新視窗中開啟)

相關


教學資源

Post navigation

PREVIOUS
美拍解析源码
NEXT
乐视解析源码

發表迴響 取消回覆

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料。

More results...

Generic filters
Exact matches only
Search in title
Search in content
Search in excerpt
Filter by 分類
網站公告
Featured
限時免費
ESET NOD32
WINDOWS 10 &11 INSIDER PREVIEW
Windows 軟件下載
系統軟件
辦公軟件
圖像處理
影音媒體
網絡軟件
應用軟件
Mac 軟件下載
安卓軟件下載
網絡資訊
Mac資訊
Linux資訊
VPS資訊
NASA資訊
金融資訊
WhatsApp Stickers教學
WordPress資訊
WeChat資訊
PHP資訊
Plesk資訊
TensorFlow
教學資源
開源程序
網頁工具
SEO工具
醫療健康
旅遊及消閒
其他資訊
Content from
Content to
2018 年 12 月
一 二 三 四 五 六 日
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« 11 月   1 月 »

分類

  • 網站公告
  • 限時免費
  • ESET NOD32
  • WINDOWS 10 &11 INSIDER PREVIEW
  • Windows 軟件下載
  • 系統軟件
  • 辦公軟件
  • 圖像處理
  • 影音媒體
  • 網絡軟件
  • 應用軟件
  • Mac 軟件下載
  • 安卓軟件下載
  • 網絡資訊
  • Mac資訊
  • Linux資訊
  • VPS資訊
  • NASA資訊
  • WhatsApp Stickers教學
  • WordPress資訊
  • WeChat資訊
  • PHP資訊
  • Plesk資訊
  • TensorFlow
  • 教學資源
  • 開源程序
  • 網頁工具
  • SEO工具
  • 醫療健康
  • 旅遊及消閒
  • 其他資訊

彙整

近期文章

  • 芯擎科技宣布中國首款7納米車規級座艙芯片“龍鷹一號”正式量產供貨 2023-03-30
  • 第69次遠征任務在國際空間站正式啟動 2023-03-30
  • “最強算力”洗衣液男子瓶子藏104片CPU入境被海關查獲 2023-03-30
  • 用戶吐槽下載視頻會員到期不能看客服回復稱需重新開通會員 2023-03-30
  • 谷歌向歐盟投訴微軟:雲業務存在反競爭行為 2023-03-30
  • 《龍貓》舞台劇11月再次演出英國倫敦比肯中心上演 2023-03-30
  • 北海道高中生開發超小型衛星10月發射到國際空間站 2023-03-30
  • 澳大利亞多地暴雨洪災泳池頻現劇毒漏斗蜘蛛最快15分鐘致死 2023-03-30
  • 《小飛俠》全員角色海報首發精靈不是唯一黑人主角 2023-03-30
  • 騰訊數據庫性能破世界紀錄每分鐘處理8.14億筆交易 2023-03-30

熱門文章與頁面︰

  • ESET NOD32 LICENSE KEY (UPDATED 2023-01-17)
  • Autodesk AutoCAD 2021 正式版註冊版-簡體/繁體中文/英文版
  • DP vs HDMI 誰才是遊戲玩家最佳選擇?
  • 打車叫到特斯拉不會開門很尷尬?官方介紹開關門方法
  • NVIDIA H100 Hopper加速計算卡上市:配備80GB顯存價格超24萬元
  • 世界上有多少個國家
  • Windows及OFFICE激活密鑰+電話激活教程–自用
  • Chrome開啟硬體加速, 顯示顏色變淡
  • 盜版Windows 7還能免費升級Windows 10嗎?
  • Autodesk AutoCAD 2020.1 正式版-簡體中文/繁體中文/英文

投遞稿件

歡迎各界人士投遞稿件到admin@wongcw.com

請提供以下資料:

1.你的名字

2.你的電郵

3.分類目錄

4.文章標題

5.文章摘要

6.文章內容

7.文章來源

 

聯繫我們

查詢,投稿,商務合作:
​admin@wongcw.com
​技術支援:
​support@wongcw.com
​客户服務:
​cs@wongcw.com

QQ群:833641851

快帆

MALUS

極度掃描

DMCA.com Protection Status

WONGCW 網誌

  • 免責聲明
  • 捐助我們
  • ThemeNcode PDF Viewer
  • ThemeNcode PDF Viewer SC
  • Events

服務器提供

本站使用之服務器由ikoula提供。

聯繫我們

查詢,投稿,商務合作:
​admin@wongcw.com
​技術支援:
​support@wongcw.com
​客户服務:
​cs@wongcw.com

QQ群:833641851

© 2023   All Rights Reserved.