PHP- Kodu:
<?php
$Live = $_GET['id'];
$Playlist = '{
"videoId": "'.$Live.'",
"context": {
"client": {
"clientName": "IOS",
"clientVersion": "16.46",
"hl": "en"
}
},
"playbackContext": {
"contentPlaybackContext": {
"html5Preference": "HTML5_PREF_WANTS",
"signatureTimestamp": "19096"
}
},
"racyCheckOk": true,
"contentCheckOk": true
}';
$ch = curl_init('https://www.youtube.com/youtubei/v1/player');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$Playlist");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Origin: https://www.youtube.com',
'X-YouTube-Client-Version: 16.46',
'X-Goog-PageId: Vd95c53d6',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0',
'X-YouTube-Client-Name: 5',
'Content-Type: application/json; charset=utf-8',
'Host: www.youtube.com',
'Connection: Keep-Alive',
'Cache-Control: no-cache',
));
$site = curl_exec($ch);
curl_close ($ch);
$site = str_replace('\\','',$site);
preg_match('#"hlsManifestUrl": "(.*?)"#', $site, $icerik);
$Link = $icerik[1];
header ("Location: $Link");
?>