Created
January 1, 2022 11:17
-
-
Save book000/55537bac2ee00af400f6a237c2bd8979 to your computer and use it in GitHub Desktop.
Mirakurunを使いVLCでテレビを見れるようにプレイリストを作成するPHPスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$json = json_decode(file_get_contents("http://192.168.0.201:40772/api/channels?type=GR"), true); | |
print_r($json); | |
$list = [ | |
"#EXTM3U", | |
"#EXTVLCOPT:network-caching=1000", | |
"" | |
]; | |
foreach ($json as $object) { | |
$type = $object['type']; | |
$channel = $object['channel']; | |
$name = $object['name']; | |
if (!isset($object['services'][0])) { | |
continue; | |
} | |
$service = $object['services'][0]; | |
$service_id = $service['id']; | |
$service_name = $service['name']; | |
$list[] = "#EXTINF:-1," . $type . " - " . $name . " (" . $service_name . ")"; | |
$list[] = "http://192.168.0.201:40772/api/channels/GR/${channel}/services/${service_id}/stream/"; | |
} | |
file_put_contents(__DIR__ . "/tv_GR.m3u8", implode("\n", $list)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment