Direct link to Google Drive

Are there any direct links for Google drive files, so I can download them from their links? Even temporary links would be enough.

As I understand it, webContentLink can only be used by browsers, downloadUrl can be used for small text files and shoud can be used with something like XMLHttpRequest or something else.

+6
source share
2 answers

webContentLink and downloadUrl are the two main links that you can use to download the disk file.

  • downloadUrl requires authorization using OAuth 2.0 (add the access token to the URL using downloadUrl + "&access_token=" + access_token or using the authorization HTTP header). It can be used to download any files. Not sure what made you believe this for only small text files. Not this. downloadUrl is a temporary URL valid for about 24 hours.
  • webContentLink requires a user to be signed in to a Google account. It mainly uses cookie authorization, so we usually say that it is used in the browser. However, there is another interesting example of using this link: if your file is publicly available, this link does not require any authorization, while downloadUrl still you need to use the OAuth 2.0 access token. webContentLink never expires.
+5
source

https://drive.google.com/uc?export=download&id=FILE_ID replace FILE_ID with the file identifier.

if you don’t know if there is a file identifier then check this article Article LINK

-1
source

Source: https://habr.com/ru/post/943434/


All Articles