22.12.2020, 12:00
Je už nějak vyřešený problém s Telly a možnost sledovat pouze jeden program na jednom zařízení ?
Hodnocení tématu:
Playlist 4NET (DigiTV, Poda, ...)
|
(10.6.2020, 10:06)Saros Napsal(a): Telly v php
Token + párování:
Kód:<?php
#login
$url = 'https://backoffice0-vip.tv.itself.cz/api/device/pairDeviceByLogin/';
$ch = curl_init($url);
$jsonData = array('id_brand' => 2, 'login' => 'login','password' => 'heslo');
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$token = $j["token"];
curl_close($ch);
#echo $token;
#save token
$file = fopen("./token.txt", "w");
fwrite($file, $token);
fclose($file);
#pairing
$url = 'https://backoffice0-vip.tv.itself.cz/api/device/completeDevicePairing/';
$ch = curl_init($url);
$jsonData = array('device_token' => $token, 'device_type_code' => 'ANDROID_4_4PLUS','model' => 'xiaomi', 'name' => 'Redmi Note 7','serial_number' => 'unknown');
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$res = $j["success"];
curl_close($ch);
echo $res;
?>
Playlist:
Kód:<?php
#read token
$lines = file("token.txt", FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
$data = array_chunk($lines, 3);
$token = $data[0][0];
#echo $token;
#playlist
$url = 'https://backoffice0-vip.tv.itself.cz/api/device/getSources/';
$ch = curl_init($url);
$jsonData = array('device_token' => $token);
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$res = $j["channels"];
curl_close($ch);
$file = fopen("./telly.m3u8", "w");
fwrite($file, '#EXTM3U'."\n");
foreach($res as $ch){
$name = $ch["name"];
echo $name."<br/>";
$url = $ch["content_sources"][0]["stream_profile_urls"]["adaptive"];
fwrite($file, '#EXTINF:-1,'.$name."\n".$url."\n");
}
fclose($file);
?>
(10.6.2020, 10:06)Saros Napsal(a): Telly v php
Token + párování:
Kód:<?php
#login
$url = 'https://backoffice0-vip.tv.itself.cz/api/device/pairDeviceByLogin/';
$ch = curl_init($url);
$jsonData = array('id_brand' => 2, 'login' => 'login','password' => 'heslo');
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$token = $j["token"];
curl_close($ch);
#echo $token;
#save token
$file = fopen("./token.txt", "w");
fwrite($file, $token);
fclose($file);
#pairing
$url = 'https://backoffice0-vip.tv.itself.cz/api/device/completeDevicePairing/';
$ch = curl_init($url);
$jsonData = array('device_token' => $token, 'device_type_code' => 'ANDROID_4_4PLUS','model' => 'xiaomi', 'name' => 'Redmi Note 7','serial_number' => 'unknown');
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$res = $j["success"];
curl_close($ch);
echo $res;
?>
Playlist:
Kód:<?php
#read token
$lines = file("token.txt", FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
$data = array_chunk($lines, 3);
$token = $data[0][0];
#echo $token;
#playlist
$url = 'https://backoffice0-vip.tv.itself.cz/api/device/getSources/';
$ch = curl_init($url);
$jsonData = array('device_token' => $token);
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$res = $j["channels"];
curl_close($ch);
$file = fopen("./telly.m3u8", "w");
fwrite($file, '#EXTM3U'."\n");
foreach($res as $ch){
$name = $ch["name"];
echo $name."<br/>";
$url = $ch["content_sources"][0]["stream_profile_urls"]["adaptive"];
fwrite($file, '#EXTINF:-1,'.$name."\n".$url."\n");
}
fclose($file);
?>
(01.11.2021, 12:39)pohoda6 Napsal(a): to php nejde uz delsi dobu, ale da se to obejit.Staci, kdyz mas stary playlist generovany starym playlistem. Prihlas se do telly a dej vygenerovat nove pripojeni prez chrom prohlizec. zapni kanal a dej v chromu moznost pro vyvojare. tam se ti zobrazi danej token a atd. ten vloz do stareho linku a voala mas hotovo. :-)
(26.10.2021, 21:08)shumi21 Napsal(a):(10.6.2020, 10:06)Saros Napsal(a): Telly v php
Token + párování:
Kód:<?php
#login
$url = 'https://backoffice0-vip.tv.itself.cz/api/device/pairDeviceByLogin/';
$ch = curl_init($url);
$jsonData = array('id_brand' => 2, 'login' => 'login','password' => 'heslo');
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$token = $j["token"];
curl_close($ch);
#echo $token;
#save token
$file = fopen("./token.txt", "w");
fwrite($file, $token);
fclose($file);
#pairing
$url = 'https://backoffice0-vip.tv.itself.cz/api/device/completeDevicePairing/';
$ch = curl_init($url);
$jsonData = array('device_token' => $token, 'device_type_code' => 'ANDROID_4_4PLUS','model' => 'xiaomi', 'name' => 'Redmi Note 7','serial_number' => 'unknown');
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$res = $j["success"];
curl_close($ch);
echo $res;
?>
Playlist:
Kód:<?php
#read token
$lines = file("token.txt", FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
$data = array_chunk($lines, 3);
$token = $data[0][0];
#echo $token;
#playlist
$url = 'https://backoffice0-vip.tv.itself.cz/api/device/getSources/';
$ch = curl_init($url);
$jsonData = array('device_token' => $token);
$jsonDataEncoded = json_encode($jsonData);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$res = $j["channels"];
curl_close($ch);
$file = fopen("./telly.m3u8", "w");
fwrite($file, '#EXTM3U'."\n");
foreach($res as $ch){
$name = $ch["name"];
echo $name."<br/>";
$url = $ch["content_sources"][0]["stream_profile_urls"]["adaptive"];
fwrite($file, '#EXTINF:-1,'.$name."\n".$url."\n");
}
fclose($file);
?>
Ide niekomu tento script? mne nechce nacitat toket...vcera to este islo ....
EDIT: ok vyriesene..sry za spam