google drive hosting changes in URL

I found the right thread at google.com to answer this. Here it is: https://productforums.google.com/forum/#!category-topic/drive/mTyJXruRhBg In short, the redirect and prefix is here to stay. It’s for some security thing. All files within the same googledrive folder will be prefixed with the same guid-looking string. That is, provided we use this googledrive url form: googledrive.com/host/{folderID}/FriendlyFilename. Then, … Read more

Using the google drive API to download a spreadsheet in csv format

Update: I have posted another answer that works with the Spreadsheets v4 API. Old Answer: The answer from Alain is correct, but you also need to set the gid=parameter to specify which worksheet to export. For example, if your ‘application/pdf’ export link is like this: docs.google.com/feeds/download/spreadsheets/Export?key=<FILE_ID>&exportFormat=pdf You can just change it to this to download … Read more

Get shared link through Google Drive API

You can use the alternateLink property in the File resource to get a link that can be shared for opening the file in the relevant Google editor or viewer: https://developers.google.com/drive/v2/reference/files Update [With API V3](https://developers.google.com/drive/api/v3/reference/files it is suggested to use the webViewLink property.

Colaboratory: Can I access to my Google drive folder and file?

Here’s an example of using a FUSE Drive interface to access your Drive files like local files: https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q In short: # Load the Drive helper and mount from google.colab import drive drive.mount(‘/content/drive’) After executing the code above, your Drive files will be present in /content/drive/My Drive. I’m guessing you also found the bundled example I/O … Read more

Google Drive API v3 Migration

First, read the official docs: v2 to v3 reference | Drive API v3 versus v2 | Migrate to v3 Download Download has changed. The field downloadUrl does not exist anymore. Now, it can be achieved with this: service.files().get(fileId).executeMediaAndDownloadTo(outputStream); I tried the new field webContentLink but it returns HTML content, instead of the file’s content. In … Read more