forked from snowleopardw/IPTV
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsxg.php
More file actions
17 lines (17 loc) · 760 Bytes
/
sxg.php
File metadata and controls
17 lines (17 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
$channel = empty($_GET['id']) ? "emdy4k_8000" : trim($_GET['id']);
$array = explode("_", $channel);
$stream = "http://livehkkp.chinamcache.com/live/8ne5i_sccn/{$array[0]}_hls_pull/8ne5i_sccn,{$array[0]}_hls_pull_{$array[1]}K/";
$timestamp = intval((time()-60)/6);
$current = "#EXTM3U"."\r\n";
$current.= "#EXT-X-VERSION:3"."\r\n";
$current.= "#EXT-X-TARGETDURATION:6"."\r\n";
$current.= "#EXT-X-MEDIA-SEQUENCE:{$timestamp}"."\r\n";
for ($i=0; $i<6; $i++)
{
$current.= "#EXTINF:6,"."\r\n";
$current.= $stream.rtrim(chunk_split($timestamp, 3, "/"), "/").".ts"."\r\n";
$timestamp = $timestamp + 1;
}
header("Content-Disposition: attachment; filename=playlist.m3u8");
echo $current;