|
那就搞 iptv222
代码。。
<?php
$id = $_GET['id'];
$pid = $_GET['pid'];
preg_match_all("/\('\?(.*?)'\)/",data('https://player.ggiptv.com/iptv.php?tid=wintv123',''),$token);
preg_match_all('/<script>(.*?)<\/script>/',data('https://player.ggiptv.com/iptv.php?'.$token[1][$id],''),$javascript);
//var_dump($token);
preg_match_all('/(.*?)="(.*?)";/',$javascript[1][1],$js);
preg_match_all('/(.*?) = "([^"]*?)";/',$javascript[1][2],$js2);
//var_dump($javascript[1][1]);
//var_dump($javascript[1][2]);
//var_dump($js2[2][0]);
//var_dump($js[2][1]);
$javascript = strrev(bdecodeb($js2[2][0],strrev($js[2][1])));
//header('location:'.$data);
//var_dump($javascript);
preg_match_all('/(.*?) = (.*?);/',$javascript,$vars);
//var_dump($vars);
preg_match('/=(.*?)&/',strst(0).strst(1).strst(2).strst(3).strst(4).strst(5).strst(6).strst(7).strst(8).strst(9).strst(10),$token);
if ($id == '0' || $id == '1' || $id == '2') {
$php = 'ifeng';
} else {
$php = 'tl';
};
header('location:'.data('https://p.ggiptv.com/v/'.$php.'.php?token='.$token[1].'&id='.$pid,'play'));
function strst($b) {
$data = preg_replace('/"|ps\./','',strs($b,0).strs($b,1).strs($b,2).strs($b,3).strs($b,4).strs($b,5).strs($b,6).strs($b,7).strs($b,8).strs($b,9).strs($b,10).strs($b,11).strs($b,12).strs($b,13).strs($b,14).strs($b,15).strs($b,16).strs($b,17).strs($b,18).strs($b,19).strs($b,20).strs($b,21).strs($b,22).strs($b,23).strs($b,24).strs($b,25).strs($b,26).strs($b,27).strs($b,28).strs($b,29).strs($b,30).strs($b,31).strs($b,32).strs($b,33).strs($b,34));
return $data;
};
function bdecode($data) {
$keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
$a1 = null;
$a2 = null;
$a3 = null;
$h1 = null;
$h2 = null;
$h3 = null;
$h4 = null;
$bits = null;
$i = 0;
$ac = 0;
$dec = '';
$tmp_arr = [];
if (!$data) {
return $data;
};
$data . '';
do {
$h1 = strpos($keyStr, $data[$i++]);
$h2 = strpos($keyStr, $data[$i++]);
$h3 = strpos($keyStr, $data[$i++]);
$h4 = strpos($keyStr, $data[$i++]);
$bits = $h1 << 18 | $h2 << 12 | $h3 << 6 | $h4;
$a1 = $bits >> 16 & 0xff;
$a2 = $bits >> 8 & 0xff;
$a3 = $bits & 0xff;
if ($h3 == 64) {
$tmp_arr[$ac++] = chr($a1);
} else if ($h4 == 64) {
$tmp_arr[$ac++] = chr($a1).chr($a2);
} else {
$tmp_arr[$ac++] = chr($a1).chr($a2).chr($a3);
};
} while ($i < mb_strlen($data));
$dec = implode('', $tmp_arr);
return $dec;
};
function bdecodeb($str, $key) {
$string = bdecode($str);
$len = mb_strlen($key);
$code = '';
for ($i = 0; $i < mb_strlen($string); $i++) {
$k = $i % $len;
$code .= chr(uniord($string[$i]) ^ uniord($key[$k]));
};
$stra = bdecode($code);
return $stra;
};
function strs($a,$s) {
global $vars;
preg_match_all('/".."\.sp|".."|"."/',preg_replace('/\(""\)/','',$vars[2][$a]),$strs);
if (preg_match('/\.sp/',$strs[0][$s])) {
return strrev($strs[0][$s]);
} else {
return $strs[0][$s];
};
};
function uniord($str, $from_encoding = false) {
$from_encoding = $from_encoding ? $from_encoding : 'UTF-8';
if (strlen($str) == 1) {
return ord($str);
};
$str = mb_convert_encoding($str, 'UCS-4BE', $from_encoding);
$tmp = unpack('N', $str);
return $tmp[1];
};
function data($url,$method) {
if (!$method) {
$method == '';
};
if ($method == '') {
$ua = 'AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36 MicroMessengeriptv/1.3.3 VideoPlayer Html5Plus/1.0';
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_USERAGENT,$ua);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, false);
$data=curl_exec($ch);
curl_close($ch);
return $data;
};
if ($method == 'play') {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$ret = curl_exec($ch);
$info = curl_getinfo($ch);
$retURL = $info['url'];
curl_close($ch);
return $retURL;
};
}; |
|