Update bestv.php

pull/12/head
肥羊 3 years ago committed by GitHub
parent 26611afff9
commit 2b3e8c76b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      codes/bestv.php

@ -4,16 +4,16 @@ $channel = empty($_GET['id']) ? "cctv16hd4k/15000000" : trim($_GET['id']);
$array = explode("/", $channel);
$stream = "http://tt-live.bestvcdn.com.cn/live/program/live/{$array[0]}/{$array[1]}/";
$timestamp = substr(time(), 0, 9) - 7;
$timematch = $timestamp . '0';
$timefirst = date('YmdH', $timematch);
$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++) {
$timematch = $timestamp . '0';
$timefirst = date('YmdH', $timematch);
$current .= "#EXTINF:3," . "\r\n";
$current .= $stream . $timefirst . "/" . $timestamp . ".ts" . "\r\n";
$timestamp = $timestamp + 1;
}
header("Content-Disposition: attachment; filename=playlist.m3u8");
echo $current;
echo $current;

Loading…
Cancel
Save