山西省台及部分地方电视台代理源码
山西卫视, http://tv123.tttttttttt.top/sxtv.php?id=ws黄河电视台, http://tv123.tttttttttt.top/sxtv.php?id=hh山西经济与科技, http://tv123.tttttttttt.top/sxtv.php?id=jj山西影视, http://tv123.tttttttttt.top/sxtv.php?id=ys山西社会与法治, http://tv123.tttttttttt.top/sxtv.php?id=fz山西文体生活, http://tv123.tttttttttt.top/sxtv.php?id=wt
太原-1, http://tv123.tttttttttt.top/sxtv.php?id=ty朔州-1, http://tv123.tttttttttt.top/sxtv.php?id=sz忻州综合, http://tv123.tttttttttt.top/sxtv.php?id=xz阳泉新闻综合, http://tv123.tttttttttt.top/sxtv.php?id=yq大同-1, http://tv123.tttttttttt.top/sxtv.php?id=dt吕梁-1, http://tv123.tttttttttt.top/sxtv.php?id=ll晋中综合, http://tv123.tttttttttt.top/sxtv.php?id=jz长治-1, http://tv123.tttttttttt.top/sxtv.php?id=cz晋城新闻综合, http://tv123.tttttttttt.top/sxtv.php?id=jc临汾-1, http://tv123.tttttttttt.top/sxtv.php?id=lf运城-1, http://tv123.tttttttttt.top/sxtv.php?id=yc
<?php// 频道ID映射表$channel_map = [// 省级频道'ws' => ['t' => 1, 'id' => 'q8RVWgs', 'r' => 1000, 'name' => '山西卫视'],'hh' => ['t' => 1, 'id' => 'lce1mC4', 'r' => 800, 'name' => '黄河电视台'],'jj' => ['t' => 1, 'id' => '4j01KWX', 'r' => 800, 'name' => '山西经济与科技'],'ys' => ['t' => 1, 'id' => 'Md571Kv', 'r' => 800, 'name' => '山西影视'],'fz' => ['t' => 1, 'id' => 'p4y5do9', 'r' => 500, 'name' => '山西社会与法治'],'wt' => ['t' => 1, 'id' => 'agmpyEk', 'r' => 800, 'name' => '山西文体生活'],// 地市频道'ty' => ['t' => 2, 'id' => '11', 'name' => '太原-1'],'sz' => ['t' => 2, 'id' => '6', 'name' => '朔州-1'],'xz' => ['t' => 2, 'id' => '3', 'name' => '忻州综合'],'yq' => ['t' => 2, 'id' => '9', 'name' => '阳泉新闻综合'],'dt' => ['t' => 2, 'id' => '10', 'name' => '大同-1'],'ll' => ['t' => 2, 'id' => '1', 'name' => '吕梁-1'],'jz' => ['t' => 2, 'id' => '5', 'name' => '晋中综合'],'cz' => ['t' => 2, 'id' => '8', 'name' => '长治-1'],'jc' => ['t' => 2, 'id' => '7', 'name' => '晋城新闻综合'],'lf' => ['t' => 2, 'id' => '2', 'name' => '临汾-1'],'yc' => ['t' => 2, 'id' => '4', 'name' => '运城-1']];// 获取当前域名$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http';$domain = $_SERVER['HTTP_HOST'];$base_url = "$protocol://$domain";// 处理短IDif(isset($_GET['id']) && array_key_exists($_GET['id'], $channel_map)) {$channel_info = $channel_map[$_GET['id']];$t = $channel_info['t'];$id = $channel_info['id'];$r = isset($channel_info['r']) ? $channel_info['r'] : null;} else if (isset($_GET['t']) && isset($_GET['id'])) {// 保留原有参数方式$t = $_GET['t'];$id = $_GET['id'];$r = isset($_GET['r']) ? $_GET['r'] : null;} else {// 显示帮助信息echo "<h2>山西电视台频道列表</h2>";echo "<ul>";foreach($channel_map as $short_id => $info) {echo "<li>{$info['name']}, $base_url/kbs/sxtv.php?id=$short_id</li>";}echo "</ul>";echo "<p>使用方式: sxtv.php?id=频道ID</p>";exit;}if($t == 1) {$get_name = function($kt, $t = 1, $e = 'live') {$n = $kt;$timezone = new DateTimeZone('Asia/Shanghai');$o = new DateTime('now', $timezone);$dateString = $o->format('Y-m-d');$newDate = new DateTime($dateString, $timezone);$r = $newDate->getTimestamp() * 1000;$a = 0;$d = 0;$g = -1;$m = 0;for($a = 0; $a < strlen($n); $a++) {$b = ord($n[$a]);$d += $b;-1 != $g && ($m += $g - $b);$g = $b;}$l = base_convert((string)($d += $m), 10, 36);$s = base_convert((string)$r, 10, 36);$p = 0;for($a = 0; $a < strlen($s); $a++)$p += ord($s[$a]);$s = substr($s, 5) . substr($s, 0, 5);$c = abs($p - $d);$h = substr($s = strrev($l).$s, 0, 4);$u = substr($s, 4);$v = [];$date = new DateTime('@' . floor($r / 1000));$date->setTimezone($timezone);$day = $date->format('w');$f = $day % 2;for($a = 0; $a < strlen($n); $a++) {($a % 2 == $f)? $v[] = $s[$a % strlen($s)]: (($w = $a === 0 ? '' : $n[$a - 1])? (-1 == ($x = strpos($h, $w) !== false ? strpos($h, $w) : -1)? $v[] = $w: $v[] = $u[$x]): $v[] = $h[$a]);}return substr(strrev(base_convert((string)$c, 10, 36)) . implode('', $v), 0, strlen($n));};$n = $get_name($id);$l = "https://livehhhttps.sxrtv.com/lsdream/$id/$r/$n.m3u8";} else {$u = 'https://dyhhplus.sxrtv.com/tapi/custom/huawei_live_secret.jsp?itemId='.$id;$c = file_get_contents($u);$j = json_decode($c, true);$l = $j['data']['address'];}header('Access-Control-Allow-Origin: *');header('Location: '.$l);
http://tv123.tttttttttt.top/sxtv.php
夜雨聆风
