Skip to content

Commit dbbef4b

Browse files
Add files via upload
1 parent 0502dca commit dbbef4b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

codes/sxg.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
$channel = empty($_GET['id']) ? "CCTV-xw_4000" : trim($_GET['id']);
3+
$array = explode("_", $channel);
4+
$stream = "蜀小果可用IP/vod.rxip.sc96655.com/live/8ne5i_sccn/{$array[0]}_hls_pull/8ne5i_sccn,{$array[0]}_hls_pull_{$array[1]}K/";
5+
$timestamp = intval((time()-60)/6);
6+
$current = "#EXTM3U"."\r\n";
7+
$current.= "#EXT-X-VERSION:3"."\r\n";
8+
$current.= "#EXT-X-TARGETDURATION:6"."\r\n";
9+
$current.= "#EXT-X-MEDIA-SEQUENCE:{$timestamp}"."\r\n";
10+
for ($i=0; $i<6; $i++)
11+
{
12+
$current.= "#EXTINF:6,"."\r\n";
13+
$current.= $stream.rtrim(chunk_split($timestamp, 3, "/"), "/").".ts"."\r\n";
14+
$timestamp = $timestamp + 1;
15+
}
16+
header("Content-Type: text/plain");
17+
echo $current;

0 commit comments

Comments
 (0)