このpython関数を使用して、Googleドライブのドキュメントを(ドライブアプリで)ダウンロードしようとしています。その部分に毎回ジャンプし# The file doesn't have any content stored on Drive
ます。
def download_file(service, drive_file):
"""Download a file's content.
Args:
service: Drive API service instance.
drive_file: Drive File instance.
Returns:
File's content if successful, None otherwise.
"""
download_url = drive_file.get('downloadUrl')
if download_url:
resp, content = service._http.request(download_url)
if resp.status == 200:
print 'Status: %s' % resp
return content
else:
print 'An error occurred: %s' % resp
return None
else:
# The file doesn't have any content stored on Drive.
return None
ただし、GDrive ドキュメントの HTML コンテンツを取得することはありません。私の MIME 設定 (HTML MIME タイプ) に問題がありますか、それとも別の API 関数を使用する必要がありますか?