zerodytrash / YouTube-Internal-Clients

A python script that discovers hidden YouTube API clients. Just a research project.
440 stars 37 forks source link

Links only work for 20 seconds #7

Open AlexTeplov45 opened 1 year ago

AlexTeplov45 commented 1 year ago

Please tell me what am I doing wrong? My links only work for 20 seconds, and they should work for 6 hours. Or shouldn't they? Here is my script PHP

$ytid = 'XqgYj8atJqo';
$data = '{"contentCheckOk": true,"context": {"client": {"androidSdkVersion": 31,"clientName": "ANDROID","clientVersion": "17.36.4", "gl": "EN","hl": "en","osName": "Android","osVersion": "12", "platform": "MOBILE"}, "user": {"lockedSafetyMode": false },},"racyCheckOk": true,"videoId": "'.$ytid.'"}';
$heder = array('Host: www.youtube.com','Content-Type: application/json','User-Agent: com.google.android.youtube/17.36.4 (Linux; U; Android 12; GB) gzip','Origin: https://www.youtube.com','Referer: https://www.youtube.com/','Accept-Language: en-EN,en;q=0.8,en-US;q=0.5,en;q=0.3','X-Youtube-Client-Name: 3');
$ch = curl_init('https://www.youtube.com/youtubei/v1/player?key=AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w');
curl_setopt($ch, CURLOPT_HTTPHEADER, $heder);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, false);
$json = json_decode(curl_exec($ch), true);
curl_close($ch);
echo '<pre>'.print_r($json, true).'</pre>';
TopGamerPro16 commented 1 year ago

Don't really have any useful insight, but yeah... YouTube does that. even from latest versions (2.20230607 on WEB), it only lasts for a good 5 seconds If not less.