PyDrive2 icon indicating copy to clipboard operation
PyDrive2 copied to clipboard

Add the endpoint export

Open edd34 opened this issue 2 years ago • 1 comments

The endpoint GET https://www.googleapis.com/drive/v2/files/:fileId/export seems to be missing

https://developers.google.com/drive/api/v2/reference/files/export

It's a feature that allow you to download a HTML with CSS inlined version of a doc.

edd34 avatar Jul 04 '22 13:07 edd34

I have found a solution here :

from pydrive2.drive import GoogleDriveFile
GoogleDriveFile myfile = GoogleDriveFile() # here an instance of GoogleDriveFile
myfile.metadata.get("exportLinks").get("text/html").text

This code snippet, gives you link of a html/css page you can download as a text file.

edd34 avatar Jul 19 '22 13:07 edd34