求助:青海电视台php代理,请求不到数据
青海电视台:http://www.qhbtv.com/new_index/live/folder2646/,使用php代理时,请求不到数据返回的是 302,大神帮忙看下,该怎么写。<?php
error_reporting(0);
$id = $_GET['id']??'qhws';
$n = [
'qhws' => 3,//青海卫视
'qhjs' => 2,//青海经视
'qhds' => 4,//青海都市
];
$ch = curl_init('http://v.qhbtv.com/m2o/channel/channel_info.php?id='.$n[$id]);
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, 'http://v.qhbtv.com/');
$d = curl_exec($ch);
curl_close($ch);
$playurl = json_decode($d,1)['m3u8'];
header('location:'.$playurl);
//echo $playurl;
?> 本帖最后由 jiteloozz 于 2024-6-22 17:45 编辑
测试代理: http://mmitv.top/pltv/qhtv.php
静态无需代理。
http://stream.qhbtv.com/qhsh/sd/live.m3u8
青海卫视,http://stream.qhbtv.com/qhws/sd/live.m3u8
青海都市,http://stream.qhbtv.com/qhds/sd/live.m3u8
青海经视,http://stream.qhbtv.com/qhsh/sd/live.m3u8
安多卫视,http://stream.qhbtv.com/adws/sd/live.m3u8
页:
[1]