Merhaba...
Bir dsmart paneli yapmaya çalışıyorum, ancak kanalın player'lar ve exo player'da oynatılmasını bir türlü sağlayamadım.
Mesela fx.php'yi çalıştırdığımda, #ExtM3u
#Ext Version3
gibi bir output almam gerekirken, bu php dosyası direkt fx.m3u8'i indiriyor ve not defterinde düzenlersem bu output'u görebiliyorum.
Ancak jwplayer, exo player gibi player'lar bunu desteklemiyor.
Düzeltmem için yardımcı olabilirseniz çok mutlu olurum, şimdiden çok teşekkür ederim:
dsmart-login.php:
<?php
function getToken() {
$url = "https://api-crm4.ercdn.com/membership/login/mobile?key=ac3f095f717f2665f3e8787d8f62ebc1";
$curl = curl_init($url);
$data = array(
"mobile" => "+90xxx",
"password" => "",
"rememberMe" => true
);
$jsonData = json_encode($data);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonData);
$headers = array(
"Content-Type: application/json",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3";
curl_setopt($curl, CURLOPT_USERAGENT, $userAgent);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
$header = substr($response, 0, $header_size);
curl_close($curl);
preg_match('/token:\s*([^\s]+)/i', $header, $matches);
$token = isset($matches[1]) ? $matches[1] : null;
return $token;
}
?>
fx.php:
<?php
include 'dsmartlogin.php';
$url = "https://crm-ticket4.ercdn.com/ticket/session/content?publicKey=ac3f095f717f2665f3e8787d8f62ebc1 ";
$data = array(
"Id" => 16203,
"Type" => 7,
"Products" => array(
array(
"ProductId" => 376,
"PackageName" => "D-Smart Mega",
"Bundle" => "dsmart",
"Grade" => 300,
"LicenseName" => "Mega Suresiz"
)
)
);
$jsonData = json_encode($data);
$token = getToken();
for ($i = 1; $i <= 25; $i++) {
if ($i % 5 == 1 && $i > 1) {
$token = getToken();
}
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonData);
$headers = array(
"Content-Type: application/json",
"token: $token",
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0",
"Origin: https://www.dsmartgo.com.tr",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
$header = substr($resp, 0, $header_size);
$body = substr($resp, $header_size);
curl_close($curl);
echo "Body:\n$body\n";
}
?>