yf1197565391 发表于 2024-11-11 22:01:23

贵州php

<?php
$id = isset($_GET['id'])?$_GET['id']:'gzws';
$n = [
    "gzws" => "tv/ch01",//贵州卫视
    "gzgg" => "tv/ch02",//贵州公共
    "gzwy" => "tv/ch03",//贵州影视
    "gzsh" => "tv/ch04",//贵州生活
    "gzfz" => "tv/ch05",//贵州法制
    "gzkj" => "tv/ch06",//贵州科教
    "gzjj" => "tv/ch09",//贵州经济
    "gzjygw" => "tv/ch10",//贵州家有购物
    "gzyd" => "tv/ch13",//贵州移动
    "fm946" => "fm/94_6",//综合广播
    "fm989" => "fm/98_9",//经济广播
    "fm916" => "fm/91_6",//音乐广播
    "fm952" => "fm/95_2",//交通广播
    "fm972" => "fm/97_2",//旅游广播
    "fm900" => "fm/90_0",//故事广播
    ];
$m3u8 = json_decode(file_get_contents('https://api.gzstv.com/v1/'.$n[$id].'/?stream_url'))->stream_url;
$host = parse_url($m3u8)["host"];
print_r(preg_replace("/(.*?.ts)/i","https://$host/live/$1",getdata($m3u8)));
function getdata($url){
   $ch = curl_init($url);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
   curl_setopt($ch, CURLOPT_REFERER, 'https://www.gzstv.com/');
   $result = curl_exec($ch);
   curl_close($ch);
   return $result;
   }
?>

金生丽水 发表于 2024-11-12 07:56:41

谢谢楼主的分享

zmjwy168 发表于 2024-11-12 10:02:22

测试好像看不了哦

evilSays 发表于 2024-11-12 10:29:47

不能用,不用试了

sc9900 发表于 2024-11-12 10:44:00

本帖最后由 sc9900 于 2024-11-12 10:47 编辑

官网也不行……

zow1990 发表于 2024-11-13 01:04:06

切片也要REFERER

zjcheng 发表于 2024-11-15 02:28:29

evilSays 发表于 2024-11-12 10:29
不能用,不用试了

http://kaniptv.com/forum.php?mod=viewthread&tid=3&extra=page%3D2&mobile=2

zjcheng 发表于 2024-11-15 02:28:45

evilSays 发表于 2024-11-12 10:29
不能用,不用试了

http://kaniptv.com/forum.php?mod=viewthread&tid=3&extra=page%3D2&mobile=2
页: [1]
查看完整版本: 贵州php