Yazar Panda - ait Kullanıcı Resmi (Avatar)
Yazar Panda
07.01.2024, 10:33
Üyelik tarihi 08.29.2022
8 konu

Easyizle.com PHP Yardımı?

Herkese merhaba dostlar, abiler...


Easyizle.com için bir php yaptım, bu php,embed URL'sini çekerek oynatmasını sağlayacak.
Ancak şöyle bir sorun var ki, embed URL'sinden sonra #ExtM3u outputunu veren bir list URL'si var, PHP'nin oraya yönlenmesini sağlayamıyorum.
Mümkün ise bir göz atıp fikir verebilir misiniz?


Şimdiden Teşekkürler...


Easyizle.com PHP'si:


<?php
$serie = isset($_GET['serie']) ? $_GET['serie'] : null;
$season = isset($_GET['season']) ? $_GET['season'] : null;
$episode = isset($_GET['episode']) ? $_GET['episode'] : null;


if ($serie && $season && $episode) {
$easyizleUrl = "https://easyizle.com/dizi/{$serie}/sezon-{$season}/bolum-{$episode}";


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $easyizleUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
curl_close($ch);


if (preg_match('/<iframe[^>]+src="([^"]+hdmomplayer\.com\/embed\/[^"]+)"[^>]*>/', $response, $matches)) {
$embedUrl = $matches[1];

header("Location: play.php?embedUrl=" . $embedUrl);
exit;
} else {
echo "Embed URL'si bulunamadı.";
}
} else {
echo "Lütfen geçerli bir dizi, sezon ve bölüm girin.";
}
?>


Play.php:


<?php
$embedUrl = isset($_GET['embedUrl']) ? $_GET['embedUrl'] : null;


if ($embedUrl) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $embedUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Referer: [Sadece kayıtlı ve aktif kullanıcılar bağlantıları görebilir.] Kayıt Olmak İçin Tıklayınız..'
));
$response = curl_exec($ch);


$effectiveUrl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
curl_close($ch);


if (preg_match('/^https:\/\/hdmomplayer\.com\/list\/([^"]+)$/', $effectiveUrl, $matches)) {
$listUrl = $effectiveUrl;


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $listUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Referer: $embedUrl" // List URL'ye referer ekle
));
$listResponse = curl_exec($ch);
curl_close($ch);


if ($listResponse) {
if (preg_match('/#EXTM3U.*$/s', $listResponse, $playlist)) {
header("Content-Type: application/x-mpegURL");
echo $playlist[0];
} else {
echo "M3U8 playlist bulunamadı.";
}
} else {
echo "List URL'sinden veri alınamadı.";
}
} else {
echo "List URL'si bulunamadı.";
}
} else {
echo "Geçerli bir embed URL'si sağlanamadı.";
}
?>