How to get MP4 link from Google Drive? [updated]

Updated 4th time, this time no issues, on 15th May.

Many websites started offering paid subscriptions to play Google Drive content with VideoJS or JWPlayer. They never share their secrets, nor their code, and are very expensive compared to what they offer.

I am sharing with the world today the best way to get MP4 links from Google Drive for free! Note that this method will not break and it will work for many years to come.

To use this method, you will need a Scaleway VC1S server, which has unlimited bandwidth and effective throughtput of 100Mbps (total bandwidth divided by 2).

Buy the server, or two, or 10, and set them up identically. Run apt install apache2 php7.0 libapache2-mod-php7.0 curl php-curl youtube-dl.

Important: For new version of the script, you will also need youtube-dl!

Download my code from here and extract it to the webroot of the server (usually /var/www/html).

Allow writes to the directory by running chmod -R 0777 /var/www and that's it!

This is the streaming code that you put on the server that streams video.

Open http://[SERVER-IP]/ and you will get a link for each quality that Drive offers. Please note: This link changes every 3 hours, so use AJAX to fetch the sources.

To use a different drive link (other than my Minions trailer), set the parameter ?url=, like this:


This won't show your server's IP anywhere so it's pretty safe alternative. You don't need to pay, thought I would appreciate PayPal donations to: milankragujevic [at] gmail [dot] com.

That's all.