I am trying to recover the URLS streaming from google drive with cookies DRIVE_STREAM (videoplayback ...). I can not use the download links as streaming links because my videos are in .MKV and and she will not have any sound

I have already been able to recover the streaming links (videoplayback) and cookie thanks to this method https://drive.google.com/get_video_info?docid=GOOGLE_DRIVE_ID the streamings links sound in the source code and cookies in the header

That's the code i have write :


$file = 'https://drive.google.com/get_video_info?docid=1UVUPS8JzMOqYi9jCoUhXFYnB2MEqyOs2';

$curl = curl_init($file);

curl_setopt_array($curl , [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER => true,
    CURLOPT_FRESH_CONNECT => true,
    CURLOPT_SSL_VERIFYPEER => true,

]);

// HERE WE GOT THE COOKIES
$data = curl_exec($curl);
preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $data, $result);
$cookies = $result[1][0];
$cookies = str_replace('DRIVE_STREAM=' , '' , $cookies);

// HERE WE GOT THE STREAMING URLS
$data = urldecode(urldecode($data));
$data = explode('|' , $data);
$data =  $data[4];
$urls = explode('&url=' , $data);

curl_close($curl);
////////////////

var_dump($urls);
var_dump($cookies);

The problem is that the streamings links do not contain the cookie DRIVE_STREAM and do not work so someone would have an idea? I heard about something with IPV4 but I am not well understood

Basically, I managed to recover cookies and streaming links separately but not together.

0 Answers