找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 733|回复: 1

[iptv信源 资源分享或寻求] 请问这个代理错在什么地方

[复制链接]
发表于 2020-12-30 17:52 | 显示全部楼层 |阅读模式
<?php
/**
      * 调用方式:xxx.php?id=xxx
      * 宜昌综合,3xgd.php?id=1
      * 宜昌生活,3xgd.php?id=2
      * 宜昌公共,3xgd.php?id=11
      */
$channel = empty($_GET['id']) ? '1' : trim($_GET['id']);
$cachefile = $_SERVER["DOCUMENT_ROOT"].'/Cache/3xgd/';
if(!is_dir($cachefile))mkdir($cachefile, 0777, true);
$cachefile .= $channel;
if(file_exists($cachefile)&&filemtime($cachefile)>time()-3000){
$playurl = file_get_contents($cachefile);
}else{
$json_content = '{"info": "\u0000"}';
$json_key = json_decode($json_content,true);
$content = _getInfo('', 0);
preg_match("|js_decrpyt\('(.*?)'|i",$content, $encrypt_data);
preg_match("|set\-cookie: acw_tc=(.*?);|i",$content, $js_cookie);
$getjsinfo = _getInfo($js_cookie[1], 1);
preg_match("|var key = '(.*?)';|i",$getjsinfo, $js_key);
preg_match("|var iv = '(.*?)';|i",$getjsinfo, $js_iv);
$encrypt_key = $js_key[1].$json_key['info'];
$encrypt_iv = base64_decode($js_iv[1]);
$encrypt_data = $encrypt_data[1];
$decrypt_data = openssl_decrypt($encrypt_data, 'aes-128-cbc', $encrypt_key, OPENSSL_ZERO_PADDING, $encrypt_iv);
$playurl = str_replace($json_key['info'], "", $decrypt_data);
file_put_contents($cachefile,$playurl);
}
header("Location: ".str_replace("waplive.", "applive.", $playurl));
function _getInfo($cookie, $mode){
$url = $mode==0 ? "http://m.3xgd.com/live/tv/channelid/{$channel}.html" : "http://m.3xgd.com/live/geturl";
$referer = $mode==0 ? "http://m.3xgd.com/" : "http://m.3xgd.com/live/tv/channelid/1.html";
if($mode==0){
$header = array("Connection: keep-alive",'Cache-Control: max-age=0','Upgrade-Insecure-Requests: 1',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Accept-Language: zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-CN;q=0.6',
);
} else {
$header = array('Connection: keep-alive','Accept: */*','Accept-Language: zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-CN;q=0.6','Cookie: acw_tc='.$cookie);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Linux; Android 10; 360safe Plus Build/QKQ1.190910.002; wv) AppleWebKit/537.36 (KHTML, like Gecko)');
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}
?>
连id都不用http://gnp638pw06.xg3.1134184.xyz/22.php

我的恩山、我的无线 The best wifi forum is right here.
发表于 2020-12-30 23:55 | 显示全部楼层
$url = $mode == 0 ? "http://m.3xgd.com/live/tv/channelid/{$channel}.html" : "http://m.3xgd.com/live/geturl";

{$channel}没有作为参数传进入?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-29 23:05

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表