Pilih channel untuk memutar
$user, "password" => $pass, "deviceid" => $devId, "fcmtoken" => ""]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $body); curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json", "User-Agent: IndiHomeTV/6.0 (iOS)"]); $res = curl_exec($ch); $data = json_decode($res, true); curl_close($ch); return (isset($data['data']['token'])) ? ['bearer' => $data['data']['token'], 'signature' => $data['data']['signature_token']] : null; } if (!isset($_SESSION['bearer']) || isset($_GET['refresh'])) { $login = getNewToken($username, $password, $deviceId); if ($login) { $_SESSION['bearer'] = $login['bearer']; $_SESSION['signature'] = $login['signature']; } } $headers = ["Content-Type: application/json", "SignatureToken: " . ($_SESSION['signature'] ?? ''), "Authorization: Bearer " . ($_SESSION['bearer'] ?? ''), "User-Agent: IndiHomeTV/6.0 (iOS)"]; function getChannelList($headers) { $url = "https://api.indihometv.com/v6/ios/category/all-channel/"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $res = curl_exec($ch); return json_decode($res, true)['data'] ?? []; } function getPlayUrl($id, $headers) { if (!$id) return ''; $url = "https://api.indihometv.com/v6/ios/secure/play-auth-v3/"; $body = json_encode(["contenttype" => "tv", "id" => $id, "password" => "", "starttime" => 0, "endtime" => 0, "pin" => ""]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $body); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $res = curl_exec($ch); return json_decode($res, true)['data']['playurl'] ?? ''; } $channels = getChannelList($headers); $selectedId = $_GET['id'] ?? ''; $streamUrl = getPlayUrl($selectedId, $headers); ?>
Pilih channel untuk memutar