使用python api客户端我可以使用export
或export_media
导出google文档,使用get_media
导出非google doc资料。
保存在用户帐户中的地图无法移植。 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_media
和export
不同意这个对象是什么。
我建议export
应与mimeType='application/vnd.google-earth.kmz'
答案 0 :(得分:2)
您可以使用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我的地图确实支持导出到KMZ / KML,我认为理想情况下Google Drive API也是如此。您可以在issue tracker上提交功能请求。