2018-10-30, 18:04
If you are using the google drive addon to serve files for another addon, you could import the cloud drive common module to your addon and then use a utility class to get the download URL.
addon.xml
and then get the url with something like this
This will generate an url pointing to the download service of the google drive addon which in turn will redirect it to the real download url from google.
addon.xml
xml :
<requires>
<import addon="script.module.clouddrive.common" />
</requires>
and then get the url with something like this
you can send anything in the filename parameter, not necessarily the real file name.python:
from clouddrive.common.service.download import DownloadServiceUtil
...
...
url = DownloadServiceUtil.build_download_url(driveid, item_driveid, item_id, filename,'plugin.googledrive')
This will generate an url pointing to the download service of the google drive addon which in turn will redirect it to the real download url from google.