You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何下载Google Slides特定修订版本?导出链接指向最新版问题

如何下载Google Slides的特定修订版本?

我通过以下Python代码获取目标演示文稿的所有修订版本:

creds = ServiceAccountCredentials.from_json_keyfile_name(credentials_path)
drive_service = build("drive", "v2", credentials=creds)
revs = drive_service.revisions().list(fileId=presentation_id).execute()
revs_items = revs.get('items')

变量revs_items包含所有修订版本的完整字段,其中exportLinks提供了多种格式的导出链接,但所有链接实际指向的都是文件的最新版本——尽管链接中已带有对应修订版本的ID参数。

以下是修订版本的字典结构示例:

{
    'etag': '"HYVl_XolCtT8iAhJReRS6HnNpU4"',
    'exportLinks': {
        'application/pdf': 'my_link&revision=2682&exportFormat=pdf',
        'application/vnd.oasis.opendocument.presentation': 'my_link&revision=2682&exportFormat=odp',
        'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'my_link&revision=2682&exportFormat=pptx',
        'text/plain': 'my_link&revision=2682&exportFormat=txt'
    },
    'id': '2682',
    'kind': 'drive#revision',
    'lastModifyingUser': {'displayName': '', 'isAuthenticatedUser': False, 'kind': 'drive#user'},
    'lastModifyingUserName': '',
    'mimeType': 'application/vnd.google-apps.presentation',
    'modifiedDate': '2021-10-29T09:02:29.011Z',
    'published': False,
    'selfLink': 'https://www.googleapis.com/drive/v2/files/my_link/revisions/2682'
}

{
    'etag': '"tYdKGWZBKi1nzFMg_Rc_y4DMuEE"',
    'exportLinks': {
        'application/pdf': 'https://docs.google.com/feeds/download/presentations/Export?id=my_link&revision=2688&exportFormat=pdf',
        'application/vnd.oasis.opendocument.presentation': 'https://docs.google.com/feeds/download/presentations/Export?id=my_link&revision=2688&exportFormat=odp',
        'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'https://docs.google.com/feeds/download/presentations/Export?id=my_link&revision=2688&exportFormat=pptx',
        'text/plain': 'https://docs.google.com/feeds/download/presentations/Export?id=my_link&revision=2688&exportFormat=txt'
    },
    'id': '2688',
    'kind': 'drive#revision',
    'lastModifyingUser': '',
    'lastModifyingUserName': '',
    'mimeType': 'application/vnd.google-apps.presentation',
    'modifiedDate': '2024-01-17T16:43:40.518Z',
    'published': False,
    'selfLink': 'https://www.googleapis.com/drive/v2/files/my_link/revisions/2688'
}

请问是否有方法可以下载文件的特定修订版本?还是Google已经禁止了该操作?


内容的提问来源于stack exchange,提问作者Sad El

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 06:03:24