pydrive

Python: download files from google drive using url

萝らか妹 提交于 2019-11-27 11:42:43
I am trying to download files from google drive and all I have is the drive's url. I have read about google api that talks about some drive_service and MedioIO, which also requires some credentials( mainly json file/oauth). But I am unable to get any idea about how its working. Also, tried urllib2 urlretrieve, but my case is to get files from drive. Tried 'wget' too but no use. Tried pydrive library. It has good upload functions to drive but no download options. Any help will be appreciated. Thanks. turdus-merula If by "drive's url" you mean the shareable link of a file on Google Drive, then

Automating pydrive verification process

别说谁变了你拦得住时间么 提交于 2019-11-26 17:15:00
I am trying to automate the GoogleAuth process when using the pydrive library ( https://pypi.python.org/pypi/PyDrive ). I've set up the pydrive and the google API such that my secret_client.json works but it requires web authentication for gdrive access every time i run my script: from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gauth = GoogleAuth() gauth.LocalWebserverAuth() drive = GoogleDrive(gauth) textfile = drive.CreateFile() textfile.SetContentFile('eng.txt') textfile.Upload() print textfile drive.CreateFile({'id':textfile['id']}).GetContentFile('eng-dl.txt')