【发布时间】:2019-10-10 08:09:34
【问题描述】:
是否可以为上传到谷歌驱动器中的私人文件生成可下载链接?
我已尝试使用文件 API 并生成了“webContent Link”,但只有所有者和共享用户才能访问它。
(期待一个可以与任何人共享的公共链接)
def file_info_drive(access_token, file_id):
headers = {'Authorization': 'Bearer ' + access_token, "content-type": "application/json"}
response = requests.get('https://www.googleapis.com/drive/v2/files/{file_id}', headers=headers)
response = response.json()
link = response['webContentLink']
return link
【问题讨论】:
标签: python file google-drive-api drive