Skip to content

Links only work for 20 seconds #7

@AlexTeplov45

Description

@AlexTeplov45

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>';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions