16.3.2020, 20:33
To mi Kodi taky ukazuje 50 ale po chvili se to prepne na 25. V mx playeru to ale ukazuje, ze tam je proud s 50fps.
Hodnocení tématu:
OTT/IPTV - jednodušeji to už nejde
|
<?php
#login
$username = "xx";
$password = "yy";
#params
$channel = rawurlencode($_GET["ch"]);
$type = $_GET["d"];
$res = $_GET["r"];
# token
$data = array('grant_type' => 'password', 'client_id' => 'tef-web-portal-etnetera','client_secret' => '2b16ac9984cd60dd0154f779ef200679','username' => ''.$username.'','password' => ''.$password.'', 'platform_id' => '231a7d6678d00c65f6f3b2aaa699a0d0', 'language' => 'cs');
$ch = curl_init('https://oauth.o2tv.cz/oauth/token');
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: oauth.o2tv.cz', 'User-Agent: okhttp/3.12.2', 'Accept-Encoding: gzip', 'Connection: Keep-Alive', 'Content-Type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$token = $j["access_token"];
curl_close($ch);
# configuration
$ch = curl_init('https://app.o2tv.cz/sws/subscription/settings/subscription-configuration.json');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-NanguTv-Device-Id: 172c533453e1b16e', 'X-NanguTv-Device-Name: Nexus 7', 'X-NanguTv-App-Version: Android#6.8.1', 'Host: oauth.o2tv.cz', 'User-Agent: okhttp/3.12.2', 'Accept-Encoding: gzip', 'Connection: Keep-Alive', 'Content-Type: application/x-www-form-urlencoded', 'X-NanguTv-Access-Token: '.$token.''));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$subscription_code = $j["subscription"];
#streaming
$uris = 'https://app.o2tv.cz/sws/server/streaming/uris.json?serviceType=LIVE_TV&deviceType='.$type.'&streamingProtocol=HLS&subscriptionCode='.$subscription_code.'&channelKey='.$channel.'&resolution='.$res.'&encryptionType=NONE';
$ch = curl_init($uris);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-NanguTv-Device-Id: 172c533453e1b16e', 'X-NanguTv-Device-Name: Nexus 7', 'X-NanguTv-App-Version: Android#6.8.1', 'Host: oauth.o2tv.cz', 'User-Agent: okhttp/3.12.2', 'Accept-Encoding: gzip', 'Connection: Keep-Alive', 'Content-Type: application/x-www-form-urlencoded', 'X-NanguTv-Access-Token: '.$token.''));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$url = $j['uris'][0]['uri'];
header('Location: '.$url.'');
?>
<?php
#login
$username = "email";
$password = "heslo";
# token
$data = array('grant_type' => 'password', 'client_id' => 'tef-web-portal-etnetera','client_secret' => '2b16ac9984cd60dd0154f779ef200679','username' => ''.$username.'','password' => ''.$password.'', 'platform_id' => '231a7d6678d00c65f6f3b2aaa699a0d0', 'language' => 'cs');
$ch = curl_init('https://oauth.o2tv.cz/oauth/token');
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: oauth.o2tv.cz', 'User-Agent: okhttp/3.12.2', 'Accept-Encoding: gzip', 'Connection: Keep-Alive', 'Content-Type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$token = $j["access_token"];
echo $token;
curl_close($ch);
# configuration
$ch = curl_init('https://app.o2tv.cz/sws/subscription/settings/subscription-configuration.json');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-NanguTv-Device-Id: 172c533453e1b16e', 'X-NanguTv-Device-Name: Nexus 7', 'X-NanguTv-App-Version: Android#6.8.1', 'Host: oauth.o2tv.cz', 'User-Agent: okhttp/3.12.2', 'Accept-Encoding: gzip', 'Connection: Keep-Alive', 'Content-Type: application/x-www-form-urlencoded', 'X-NanguTv-Access-Token: '.$token.''));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$subscription_code = $j["subscription"];
echo '</br>'.$subscription_code;
curl_close($ch);
#save data
$file = fopen("./o2tv_data.txt", "w");
fwrite($file, $token."\n".$subscription_code);
fclose($file);
?>
<?php
#params
$channel_input = explode(".m3u8", $_GET["ch"]);
$channel_input = $channel_input[0];
$array = array('1' => 'O2 Sport HD', '2' => 'O2 Fotbal HD', '3' => 'O2 Tenis HD');
$arr = $array[$channel_input];
$channel = rawurlencode($arr);
$type = "STB";
$resolution = "HD";
#read data
$lines = file("o2tv_data.txt", FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
$data = array_chunk($lines, 3);
$token = $data[0][0];
$subscription_code = $data[0][1];
#streaming
$uris = 'https://app.o2tv.cz/sws/server/streaming/uris.json?serviceType=LIVE_TV&deviceType='.$type.'&streamingProtocol=HLS&subscriptionCode='.$subscription_code.'&channelKey='.$channel.'&encryptionType=NONE';
$ch = curl_init($uris);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-NanguTv-Device-Id: 172c533453e1b16e', 'X-NanguTv-Device-Name: Nexus 7', 'X-NanguTv-App-Version: Android#6.8.1', 'Host: oauth.o2tv.cz', 'User-Agent: okhttp/3.12.2', 'Accept-Encoding: gzip', 'Connection: Keep-Alive', 'Content-Type: application/x-www-form-urlencoded', 'X-NanguTv-Access-Token: '.$token.''));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$j = json_decode($result,true);
$j = $j['uris'];
foreach($j as $v){
$q = $v['resolution'];
if ($q == $resolution) {
$url = $v['uri'];
}
}
header('Location: '.$url.'');
?>
/home/hts/o2tv/login2.sh
access_token : NThkZmU3NzYtNzhiZi00YzYyLTgwY2MtYjlhNjg1YWY5ZD89
refresh_token : ZGExMTRjMjMtOGI3MS00MjRhLTk4NWEtYmEwNWI1OTYwMW15
expires_in : 3153599999
ERROR: Bad registration
[/share/Public/_o2tv] # ./login.sh
1st authentication method will be used!
WARNING: 1st authentication method not succeeded, 2nd authentication method will be used!
2nd authentication method succeded!
ERROR: Bad registration
[/share/Public/_o2tv] # ls
config.json* config.json.sample* encode1.sed* encode2.sed* login.sh* playlist.sh* streamer.sh*