Merhaba, uygulamamda trgoals'ın spor yayınlarını kullanıyorum. Ama artık elimle değiştirmekten çok yorulduğum için bu işlemi otomatikleştirmeye karar verdim. Tr goals bildiğiniz üzere sub domain sistemi ile çalışıyor. Mesela: [Sadece kayıtlı ve aktif kullanıcılar bağlantıları görebilir.] Kayıt Olmak İçin Tıklayınız...
PHP kkodumun bu alt domaini otomatik olarak bulmasını sağlamaya çalıştım ama site ile aynı domaini buluyor. mesela [Sadece kayıtlı ve aktif kullanıcılar bağlantıları görebilir.] Kayıt Olmak İçin Tıklayınız... Ve ben bunu nasıl düzeltebileceğimi bir türlü bulamadım.
Aşağıda php kodunu veriyorum, isteyen çaladabilir zaten o kadarda büyük bir şey değil.
PHP Code:
<?php
$targetAddress = 'https://trgoals490.xyz';
$otherAddresses = [
'https://trgoals491.xyz',
'https://trgoals492.xyz',
'https://trgoals493.xyz',
'https://trgoals494.xyz',
'https://trgoals495.xyz',
'https://trgoals496.xyz',
'https://trgoals497.xyz',
'https://trgoals498.xyz',
'https://trgoals499.xyz',
'https://trgoals500.xyz',
'https://trgoals501.xyz',
'https://trgoals502.xyz',
'https://trgoals503.xyz',
'https://trgoals504.xyz',
'https://trgoals505.xyz',
'https://trgoals506.xyz',
'https://trgoals507.xyz',
'https://trgoals508.xyz',
'https://trgoals509.xyz',
'https://trgoals510.xyz',
'https://trgoals511.xyz',
'https://trgoals512.xyz',
'https://trgoals513.xyz',
'https://trgoals514.xyz',
'https://trgoals515.xyz',
'https://trgoals516.xyz',
'https://trgoals517.xyz',
'https://trgoals518.xyz',
'https://trgoals519.xyz',
'https://trgoals520.xyz'
];
function isAddressAccessible($address) {
$timeout = 15;
$ch = curl_init($address);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return ($httpCode === 200);
}
function findYayin1M3U8($subdomain) {
$yayin1M3U8 = "https://$subdomain.trgoals490.xyz/yayin1.m3u8";
echo "<script>window.location.href = '$yayin1M3U8';</script>";
}
if (isAddressAccessible($targetAddress)) {
$parsedUrl = parse_url($targetAddress);
$subdomain = explode('.', $parsedUrl['host'])[0];
findYayin1M3U8($subdomain);
} else {
foreach ($otherAddresses as $address) {
if (isAddressAccessible($address)) {
$parsedUrl = parse_url($address);
$subdomain = explode('.', $parsedUrl['host'])[0];
findYayin1M3U8($subdomain);
break;
}
}
echo '<p>Unable to connect to any domain.</p>';
}
?>