Python: download files from google drive using url

前端 未结 9 1331
眼角桃花
眼角桃花 2020-11-27 11:51

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

9条回答
  •  一生所求
    2020-11-27 12:32

    This has also been described above,

       from pydrive.auth import GoogleAuth
       gauth = GoogleAuth()
       gauth.LocalWebserverAuth()
       drive = GoogleDrive(gauth)
    

    This creates its own server too do the dirty work of authenticating

       file_obj = drive.CreateFile({'id': ''})
       file_obj.GetContentFile('Demo.txt') 
    

    This downloads the file

提交回复
热议问题