gpt4 book ai didi

python - Google Drive api - 不支持 map 导出(python)

转载 作者:行者123 更新时间:2023-12-01 03:48:42 35 4
gpt4 key购买 nike

使用 python api 客户端,我可以使用 export 导出谷歌文档或export_media和非 Google 文档 Material get_media .

用户帐户中保存的 map 无法导出。 export返回错误

HttpError: <HttpError 403 ... returned "Export only supports Google Docs.">

我承认使用get_media没有任何意义。但鉴于上述错误,我无论如何都会尝试。它返回:

HttpError: <HttpError 403 ... returned "Only files with binary content can be downloaded. Use Export with Google Docs files.">

看来get_mediaexport不同意这个对象是什么。

我建议export应该与 mimeType='application/vnd.google-earth.kmz' 一起使用

最佳答案

您可以使用 Drive.About.get 确定每种 Google MIME 类型可用的导出格式:

GET https://www.googleapis.com/drive/v3/about?fields=exportFormats&key={YOUR_API_KEY}

{
"exportFormats": {
"application/vnd.google-apps.form": [
"application/zip"
],
"application/vnd.google-apps.document": [
"application/rtf",
"application/vnd.oasis.opendocument.text",
"text/html",
"application/pdf",
"application/zip",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"text/plain"
],
"application/vnd.google-apps.drawing": [
"image/svg+xml",
"image/png",
"application/pdf",
"image/jpeg"
],
"application/vnd.google-apps.spreadsheet": [
"text/csv",
"application/x-vnd.oasis.opendocument.spreadsheet",
"application/zip",
"application/pdf",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
"application/vnd.google-apps.script": [
"application/vnd.google-apps.script+json"
],
"application/vnd.google-apps.presentation": [
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"application/pdf",
"text/plain"
]
}
}

如您所见,目前没有为 application/vnd.google-apps.map 定义导出格式。鉴于 Google 我的 map 确实支持导出到 KMZ/KML,我认为理想情况下 Google Drive API 也可以。您可以在 issue tracker 上提交功能请求.

关于python - Google Drive api - 不支持 map 导出(python),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38537063/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com