export_media() exported content is limited to 10MB
Builtin method has a limit of 10Mb: https://googleapis.github.io/google-api-python-client/docs/dyn/drive_v3.files.html#export_media
You can request exportLinks field in the Files: list:
curl \
'https://www.googleapis.com/drive/v3/files/[FILE_ID]?fields=exportLinks' \
--header 'Authorization: Bearer [ACCESS_TOKEN]' \
--header 'Accept: application/json'
That will return something like this (these are links I got for a Google Slides presentation):
{
"exportLinks": {
"application/vnd.oasis.opendocument.presentation": "https://docs.google.com/feeds/download/presentations/Export?id=[FILE_ID]&exportFormat=odp",
"application/pdf": "https://docs.google.com/feeds/download/presentations/Export?id=[FILE_ID]&exportFormat=pdf",
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "https://docs.google.com/feeds/download/presentations/Export?id=[FILE_ID]&exportFormat=pptx",
"text/plain": "https://docs.google.com/feeds/download/presentations/Export?id=[FILE_ID]&exportFormat=txt"
}
}
And those urls don't have such a hard size limit.
It'll be more convenient to use export_media method without this limit.
Maybe it is not an issue, but future request. Maybe there is a way to get the content from the exportLink api using the library instead of using export_media method?
Can I work on this?
My mission plan ... should you choose to accept ... could involve:
- Add a boolean flag/parameter to the
exportandexport_mediafunction that enables the use ofexportLinkattribute offilesto download the required docs, which of course bypasses the whole 10 Mb limit eish. - A new separate function, could be called anything, eg.
media_download, that does the same as 1 above, except this time, we don't corruptexportorexport_mediathat directly mirrors google's API, keeping things clean.
Or does this project have a thing against adding functions that are not officially supported??