Download index.php from xadssa/php-test: direct link, hf CLI and curl.
- Browser
- Download file 825 Bytes
-
https://huggingface.co/spaces/xadssa/php-test/resolve/main/index.php
- Command line
-
hf download hf://spaces/xadssa/php-test/index.php
-
curl -L -o index.php https://huggingface.co/spaces/xadssa/php-test/resolve/main/index.php
825 Bytes
| date_default_timezone_set("Asia/Shanghai"); | |
| $channel = empty($_GET['id']) ? "cctv16hd4k/15000000" : trim($_GET['id']); | |
| $stream = "http://223.111.117.11/liveplay-kk.rtxapp.com/live/program/live/{$channel}/"; | |
| $timestamp = substr(time(), 0, 9) - 7; | |
| $current = "#EXTM3U" . PHP_EOL; | |
| $current .= "#EXT-X-VERSION:3" . PHP_EOL; | |
| $current .= "#EXT-X-TARGETDURATION:3" . PHP_EOL; | |
| $current .= "#EXT-X-MEDIA-SEQUENCE:{$timestamp}" . PHP_EOL; | |
| for ($i = 0; $i < 3; $i++) { | |
| $timematch = $timestamp . '0'; | |
| $timefirst = date('YmdH', $timematch); | |
| $current .= "#EXTINF:3," . PHP_EOL; | |
| $current .= $stream . $timefirst . "/" . $timestamp . ".ts" . PHP_EOL; | |
| $timestamp = $timestamp + 1; | |
| } | |
| header("Content-Type: application/vnd.apple.mpegurl"); | |
| header("Content-Disposition: attachment; filename=index.m3u8"); | |
| echo $current; |