找回密码
 立即注册
搜索
查看: 4979|回复: 25

上海 看东方、看看新闻

[复制链接]

213

主题

108

回帖

1234

积分

管理员

积分
1234
发表于 2025-6-15 09:07:32 | 显示全部楼层 |阅读模式
购买主题 已有 17 人购买  本主题需向作者支付 1 海贝 才能浏览

0

主题

137

回帖

321

积分

等离子电视迷

积分
321
发表于 2025-6-22 15:17:41 | 显示全部楼层
上海

3

主题

127

回帖

350

积分

等离子电视迷

积分
350
发表于 2025-6-22 16:43:59 | 显示全部楼层
东方卫视,id=

1

主题

74

回帖

227

积分

等离子电视迷

积分
227
发表于 2025-6-23 15:37:46 | 显示全部楼层
看看

0

主题

76

回帖

192

积分

彩电迷

积分
192
发表于 2025-6-24 11:05:58 | 显示全部楼层
谢谢分享

0

主题

15

回帖

32

积分

黑白电视迷

积分
32
发表于 2025-6-24 16:03:12 | 显示全部楼层
全部照 收,谢谢

0

主题

67

回帖

193

积分

彩电迷

积分
193
发表于 2025-6-28 05:01:28 | 显示全部楼层
谢谢分享

0

主题

19

回帖

46

积分

黑白电视迷

积分
46
发表于 2025-7-4 21:30:01 | 显示全部楼层
<?php

/*

四川卫视,sc.php?id=1

四川新闻,sc.php?id=2

四川经济,sc.php?id=3

四川文化旅游,sc.php?id=4

四川影视文艺,sc.php?id=5

四川妇女儿童,sc.php?id=6

四川星空购物,sc.php?id=7

四川乡村,sc.php?id=8

康巴卫视,sc.php?id=9

*/



//https://www.sctv.com/watchTV

//https://iptv.cc/forum.php?mod=viewthread&tid=5856&highlight=%E5%9B%9B%E5%B7%9D

//https://www.utao.tv/

//https://bgithub.xyz/VonChange/utao/releases



if (need_m3u8($id, $ts_url)) {

    $u = get_m3u8_url($id);

    $c = send_request($u, $ct);

    $c = replace_ts_urls($u, $c);

} else {

    $c = send_request($ts_url, $ct);

}

echo_content($ct, $c);







function need_m3u8(&$id, &$ts_url)

{

    $q = $_SERVER['QUERY_STRING'];

    $r = stripos($q, 'id=') === 0;

    if ($r)

        $id = $_GET['id'];

    else

        $ts_url = $q;

    return $r;

}



function get_m3u8_url($id)

{

    $u = 'http://api.vonchange.com/utao/sctv?tag='.$id;

    $r = file_get_contents($u);

    return $r;

}



function send_request($url, &$content_type)

{

    $ch = curl_init($url);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    curl_setopt($ch, CURLOPT_REFERER, 'https://www.sctv.com/');

    $res = curl_exec($ch);

    $content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);

    curl_close($ch);

    return $res;

}



function replace_ts_urls($m3u8_url, $m3u8_content)

{

    $dest_ts_path = dirname($m3u8_url)."/";

    $protocol = !empty($_SERVER['HTTPS']) ? 'https' : 'http';

    $self_part = "$protocol://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];

    return preg_replace_callback("/^((?!#).+)$/im",

        function ($matches) use ($self_part, $dest_ts_path) {

            if (!is_absolute_url($matches[1]))

                $ts = $dest_ts_path.$matches[1];

            else

                $ts = $matches[1];

            return "$self_part?$ts";

        },

        $m3u8_content

    );

}



function is_absolute_url($url) {

    return stripos($url, 'http:') === 0 || stripos($url, 'https:') === 0;

}



function echo_content($content_type, $content)

{

    header("Access-Control-Allow-Origin: *");

    header("Content-Type: $content_type");

    echo $content;

}

0

主题

12

回帖

28

积分

黑白电视迷

积分
28
发表于 2025-7-5 10:17:37 | 显示全部楼层
谢谢分享

0

主题

15

回帖

38

积分

黑白电视迷

积分
38
发表于 2025-7-6 11:58:40 | 显示全部楼层
高清吗
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋

创办于 2025 年 5 月 5 日

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