找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 13055|回复: 18

PHP直播源代理是如何编写的?

[复制链接]
怎么就没有大神出来发发慈悲,出个Deom版的PHP直播源代理源码,让我们照葫芦画瓢,也学习下呢?
我的恩山、我的无线 The best wifi forum is right here.
zgr520 发表于 2020-1-21 20:19
河南代理

牛逼 咋用啊老乡
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报


谢谢楼主分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
zgr520 发表于 2020-1-21 20:36
上传hn.php文件入服务器  复制源码保存到hn.php内

南卫视,http://域名/hn.php?id=135

谢谢您的分享!还在学习中!这种是不是只是其中一种代理方式?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
谢谢楼主分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
不知道哪里出错,硬是用不了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
感谢分享,支持一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

头像被屏蔽
提示: 作者被禁止或删除 内容自动屏蔽
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

zgr520 发表于 2020-1-21 20:36
上传hn.php文件入服务器  复制源码保存到hn.php内

南卫视,http://域名/hn.php?id=135

感谢老乡
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

zgr520 发表于 2020-1-21 20:36
上传hn.php文件入服务器  复制源码保存到hn.php内

南卫视,http://域名/hn.php?id=135

请问这个源代码还能用么  为何我用了代理不出来?因为你发出来是没有换行的,我这样编辑是否有问题?
<?php
header('Content-Type: text/json;charset=utf-8');
$id = isset($_GET['id'])?$_GET['id']:135;  
$url="http://www.hntv.tv/soms4/web/jwzt/player/live_ipad_player.jsp?channelId=".$id."";  
$info=file_get_contents($url);  
preg_match('/video src="(.*?)"/i',$info,$m);
header('location:'.$m[1]);
?>
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

<?php

$pd=$_GET['pd'];
function getRandomString($len, $chars=null)  
{  
    if (is_null($chars)) {  
        $chars = "A1BCD3EFGH6IJK6LMN8OPQR9STU2VWXYZ0123456789";  
    }  
    mt_srand(10000000*(double)microtime());  
    for ($i = 0, $str = '', $lc = strlen($chars)-1; $i < $len; $i++) {  
        $str .= $chars[mt_rand(0, $lc)];  
    }  
    return $str;  
}  

$num=getRandomString(32);

if($_SERVER['HTTP_CLIENT_IP']){
     $onlineip=$_SERVER['HTTP_CLIENT_IP'];
}elseif($_SERVER['HTTP_X_FORWARDED_FOR']){
     $onlineip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
     $onlineip=$_SERVER['REMOTE_ADDR'];
}

$stbid=md5($onlineip);//这个是用IP作为设备码  固定的
//$stbid=md5($num);//这个是用随机字母数字作为设备码  随机的

//echo $stbid;

$ts=array(

"cctv1hd"=>"7780104586873900361",
"cctv1fhd"=>"5000000010000030810",
"cctv2"=>"6712427732700951500",
"cctv3"=>"4871512150101568971",
"cctv3fhd"=>"5000000002000020548",
"cctv4"=>"6529283685694841127",
"cctv5fhd"=>"5000000010000016619",
"cctv5hd"=>"5922040007130019836",
"cctv6fhd"=>"5000000010000018433",
"cctv6hd"=>"5919402815101985320",
"cctv7"=>"7319070262144570132",
"cctv8fhd"=>"5000000010000018377",
"cctv8hd"=>"8845820895945979833",
"cctv9"=>"5000000001000024017",
"cctv10hd"=>"9092756522938817434",
"cctv10fhd"=>"5000000010000016738",
"cctv11"=>"5934529806195667858",
"cctv12"=>"7353916194983371497",
"cctv13"=>"5644425207501602420",
"cctv14hd"=>"4698841642605267773",
"cctv14fhd"=>"5000000010000023358",
"cctv15"=>"6270544915670196140",
"hnwsfhd"=>"5000000010000030452",
"hnwshd"=>"8374060722965940334",
"dfwsfhd"=>"5000000010000032246",
"jswsfhd"=>"5000000010000018509",
"zjwsfhd"=>"5000000010000017320",
"zjwshd"=>"7751216754229369822",
"bjwsfhd"=>"5000000010000011502",
"hljwsfhd"=>"5000000010000031107",
"hljwshd"=>"9186015289302635496",
"gdwshd"=>"6933976477918927839",
"gdwsfhd"=>"5000000010000030417",
"szwsfhd"=>"5000000010000024026",
"sdwsfhd"=>"5000000010000027763",
"hubwsfhd"=>"5000000010000022140",
"ahwshd"=>"8519359625922101359",
"ahwsfhd"=>"5000000001000027288",
"dfwshd"=>"6319317455932234634",
"dnwshd"=>"6058511135162408190",
"dnwsfhd"=>"5000000001000005829",
"lnwshd"=>"5393821316758187099",
"lnwsfhd"=>"5000000001000008940",
"jxwshd"=>"4625292887079171688",
"jxwsfhd"=>"5000000001000032154",
"tjwshd"=>"4966692255080753870",
"tjwsfhd"=>"5000000001000030788",
"scws"=>"7490243799257182211",
"shxw"=>"7487426726248458200",
"shys"=>"4624908642496875994",
"wxtyhd"=>"5000000010000017540",
"shdsjhd"=>"6607701200248700905",
"shdsjfhd"=>"5000000010000032212",
"shdshd"=>"6789517052815334336",
"shwyhd"=>"6032059665143203976",
"shjshd"=>"7081356299464623208",
"dycjhd"=>"6617141658685778844",
"dycjhd2"=>"5000000010000027146",
"shsshd"=>"8538616372715313491",
"shssfhd"=>"5000000002000019634",
"dsjchd"=>"5000000002000004412",
"bst01"=>"5000000001000001116",
"bst02"=>"5000000001000002898",
"bst03"=>"5000000001000004876",
"bst04"=>"5000000001000004953",
"bst05"=>"5000000001000006777",
"bst06"=>"5000000001000017342",
"bst07"=>"5000000001000018009",
"bst08"=>"5000000001000019233",
"bst09"=>"5000000001000023256",
"djsjhd"=>"5000000001000022620",
"jsqchd"=>"5000000002000004828",
"xkkt"=>"7253543213338128343",
"fztd"=>"9001547084732463424",
"dsjc"=>"6458566386506430130",
"hxjc"=>"6550198305014687851",
"hxjchd"=>"5000000002000009455",
"jbtyhd"=>"5000000002000029972",
"dmxchd"=>"5000000002000023636",
"dmxc"=>"9072176337701960899",
"yxfy"=>",6006066787099938055",
"dfcj"=>"7061949425579508455",
"jsqc"=>"6674152167754937164",
"qcxj"=>"5379866194427087552",
"gzws"=>"9201427986773758105",
"jlws"=>"7365582553698000803",
"cqws"=>"7530473587484726181",
"gxws"=>"4676357582335641620",
"henws"=>"7384596500152929578",
"hanws"=>"6187345409661409786",
"qhws"=>"7493614642381322513",
"hebws"=>"9037187833113630344",
"nmgws"=>"7331079758781182663",
"sxws"=>"9149348477727203604",
"xjws"=>"5648045890196605092",
"ynws"=>"6779252864642956855",
"btws"=>"8683210039696467587",
"gsws"=>"4777644378750257549",
"nxws"=>"7511214846664648726",
"shxws"=>"9042434207492183547",
"xmws"=>"5084893189220221988",
"jykt"=>"8812606677069767341",
"kkse"=>"7851974109718180595",
"jjkt"=>"4739906347743456369",
"xzws"=>"5381760837640571168",
"xzws2"=>"5000000002000021549",
"dfws"=>"6322338140530063287",
"dfdy"=>"6656174342854977929",
"cetv1"=>"7489076744391846994",
"cetv1fhd"=>"5000000002000002652",

"yxfyhd"=>"5000000002000027005",
"jspdhd"=>"5000000001000021713",
"shwyhd"=>"5000000010000030951",
"xfc"=>"5000000010000004266",
"qjs"=>"5000000010000006249",
"mlyy"=>"5000000010000008656",
"jspd"=>"5000000010000026105",
        );





        $routedx=array('61.139.103.234','113.17.170.151'); //电信线路随机
        $dxip=$routedx[rand(0,1)];
       
        $routeyd=array('183.224.35.12','183.203.26.13');//移动线路随机
        $ydip=$routeyd[rand(0,1)];
       
                $routedx1=array('101.75.248.85','113.17.170.151'); //电信联通线路
        $dxip1=$routedx1[rand(0,1)];
/*
61.139.103.234//四川省南充市 电信
183.224.35.12//云南省baidu市 移动
183.203.26.13   //山西省太原市 移动
113.17.170.151 //广西壮族自治区南宁市 电信
*/


$ch=  curl_init("http://cache.ott.ystenlive.itv.cmvideo.cn/index.m3u8?stbId=".$stbid."&Contentid=".$ts[$pd]."&channel-id=bestzb&livemode=1");

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);

$info = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
curl_exec($ch);

$info = str_replace("http://","",$info);

//$live="http://".$dxip."/".$info;//电信线路
//$live="http://113.17.170.151/".$info;//电信线路101.75.248.85
//$live="http://".$ydip."/".$info;//移动线路
$live="http://".$dxip1."/".$info;//电信联通线路

echo $live;
//header('location:'.$live);







?>
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

请问15楼,这个代理文件应该怎样使用啊?直播源的格式是怎样的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
做个标记。。。。。。。。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

taishanshoufu 发表于 2020-3-3 18:15
请问15楼,这个代理文件应该怎样使用啊?直播源的格式是怎样的

index.php?pd=cctv1hd
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

在哪里,看不见啊啊啊啊啊
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-27 02:34

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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