获取公共Google Docs fi的下载链接

2024-04-29 10:02:24 发布

您现在位置:Python中文网/ 问答频道 /正文

阅读Google Docs API我发现:

Downloading

Files cannot be downloaded in a format other than the one in which they were originally uploaded. The download URL for files looks something like this:

https://doc-04-20-docs.googleusercontent.com/docs/secure/m7an0emtau/WJm12345/YzI2Y2ExYWVm?h=16655626&e=download&gd=true

假设一个公共的Google文档文件URL,比如说

https://docs.google.com/open?id=0B1-vl-dPgKm_NTNhZjZkMWMtZjQxOS00MGE1LTg2MjItNGVjYzdmZjYxNmQ5

如何将其转换为下载链接?


Tags: inhttpscomapiformaturldocsdownload
2条回答

嗨,夜猫子,试试这个:

https://docs.google.com/uc?export=download&id=DOCIDGOESHERE

我只尝试过一个pdf文件,它工作得很好,所以也许玩一下会有帮助。。。。

一切顺利

戴夫

对于已发布的文档,dkcwd建议的方法不起作用。

我在this page中找到了以下方法。给定发布文档URL,例如

https://docs.google.com/document/pub?id=[ID]

下载链接是

https://docs.google.com/document/export?format=[FORMAT]&id=[ID]

其中[FORMAT]可以有以下值之一:pdf、doc、docx、oo、rtf、txt。

相关问题 更多 >