Google Drive raw data?

parzivail picture parzivail · Jul 19, 2014 · Viewed 13k times · Source

Is there any URL google has that contains the raw data for the file? using https://drive.google.com/file/d/FILE_ID just takes you to a 'share' section of the file... say I have a .js file on GDrive. If you go to their share link, they have a share page. Is there any link to get the raw javascript from the file, as to use in a <script src="google_link_or_whatever">?

Answer

a paid nerd picture a paid nerd · Jun 1, 2020

First, go to the sharing settings for your document and choose "Anyone with a link." It will generate a link in the format https://drive.google.com/file/d/XXX/view?usp=sharing.

Now you can use the following URL format: https://drive.google.com/uc?id=XXX

Note that I'm seeing an HTTP redirect when I do this, so use curl -L on the command line or otherwise make sure that your HTTP client follows redirect.