Skip to content

Commit

Permalink
百事通
Browse files Browse the repository at this point in the history
  • Loading branch information
redrainl authored Feb 2, 2023
1 parent d301bc2 commit 1252e3a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions php/bestv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
date_default_timezone_set("Asia/Shanghai");
$timefirst = date('YmdH', time());
$channel = empty($_GET['id']) ? "cctv16hd4k/15000000" : trim($_GET['id']);
$array = explode("/", $channel);
//$ip = trim($_GET['ip']);
$url= "223.109.53.49/liveplay-kk.rtxapp.com";
$url= "117.184.239.60/liveplay-kk.rtxapp.com";
$stream = "http://" . $url . "/live/program/live/{$array[0]}/{$array[1]}/";
$timestamp = substr(time(), 0, 9) - 7;
$current = "#EXTM3U" . "\r\n";
$current .= "#EXT-X-VERSION:3" . "\r\n";
$current .= "#EXT-X-TARGETDURATION:3" . "\r\n";
$current .= "#EXT-X-MEDIA-SEQUENCE:{$timestamp}" . "\r\n";
for ($i = 0; $i < 3; $i++) {
$current .= "#EXTINF:3," . "\r\n";
$current .= $stream . $timefirst . "/" . $timestamp . ".ts" . "\r\n";
$timestamp = $timestamp + 1;
}
header("Content-Disposition: attachment; filename=playlist.m3u8");
echo $current;
?>

0 comments on commit 1252e3a

Please sign in to comment.