找回密码
 注册需人工审核(节假日除外)
搜索
查看: 435|回复: 2

看兰州php

[复制链接]

签到天数: 226 天

[LV.7]炉火纯青

发表于 2025-2-12 18:14:45 | 显示全部楼层 |阅读模式
看兰州php 求解答  @  根据大佬帖子修改的 好像验证ip之类的
<?php
error_reporting(0);
date_default_timezone_set("PRC");
$ts = $_GET['ts']??'';
if ($ts){
        $decodedUts = urldecode($ts);
        $data = get_curl($decodedUts);
        header('Content-Type: video/MP2T');
        header("Content-Disposition: inline; filename={$ts}.ts");
        } else {
                $https = isset($_SERVER['HTTPS'])?'https':'http';//当前请求的主机使用的协议。
                $http_host = $_SERVER['HTTP_HOST'];//当前请求的主机名。
                $requestUri = $_SERVER['REQUEST_URI'];//获取当前请求的 URI
                $decodedUri = urldecode($requestUri);//URL解码
                $Uripath = explode('?',$decodedUri)[0];//strstr($decodedUri,'?',true);
                $urlp = "{$https}://{$http_host}{$Uripath}?ts=";
                $url = 'http://liveplus.lzr.com.cn/wlpd/HD/live.m3u8';
                $m3u8 = get_curl($url);
                $urlpath = dirname($url).'/';
                $m3u8s = explode("\n",trim($m3u8));
                $data = '';
                foreach($m3u8s as $m3u8l){
                        if (stripos($m3u8l,'.ts')!==false){
                                $data .= $urlp.urlencode($urlpath.$m3u8l).PHP_EOL;
                        } else {
                                $data .= $m3u8l.PHP_EOL;
                        }
                }
                header("Content-Type: application/vnd.apple.mpegurl");
                header("Content-Disposition: inline; filename=index.m3u8");
        }
echo $data;
exit;

function get_curl($url){
        $ch = curl_init($url);  
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_REFERER, 'https://lanzhoubcnew.zainanjing365.com/share/live/detailTv?resourceId=14&appscheme=gdmm-ailanzhou');
        $data = curl_exec($ch);
        curl_close($ch);
        return $data;
}
?>

人生没有彩排,每天都是直播。

Welcome to iptv.cc !

回复

使用道具 举报

签到天数: 266 天

[LV.8]自成一派

发表于 2025-2-12 18:50:37 | 显示全部楼层
本帖最后由 Wheiss 于 2025-2-12 18:57 编辑

加个浏览器UA如
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0');


https://iptv.cc/thread-5030-1-1.html
通用的没必要单独写源码

人生没有彩排,每天都是直播。

Welcome to iptv.cc !

回复

使用道具 举报

签到天数: 30 天

[LV.5]略有小成

发表于 2025-2-13 10:46:56 | 显示全部楼层
请问播放列表是多少啊?

人生没有彩排,每天都是直播。

Welcome to iptv.cc !

回复

使用道具 举报

本版积分规则

Archiver|手机版|小黑屋|IPTV论坛 | 管理员邮箱:a@8494.net

本站以兴趣爱好为宗旨,非经营性质,不以任何形式收取任何费用。IPTV论坛没有任何官方Q群,V群,T群,禁止留任何联系方式,请配合。

免责声明:本站上述内容来自网络,不得用于商业或非法用途,您必须在下载后24小时内,从设备中删除,否则后果自负。如内容侵犯您的版权、著作权,请联系我,第一时间处理。

GMT+8, 2025-3-12 12:21 , Processed in 0.091079 second(s), 17 queries .

IPTV论坛 创建于 2023年5月1日