pydrive

pydrive: why has this vertification error suddenly appeared?

你说的曾经没有我的故事 提交于 2021-01-28 11:40:47
问题 I have a python script that downloads files from Google Drive using pydrive. This is the relevent bit of code: def get_drive_object(): gauth = GoogleAuth() gauth.LoadCredentialsFile("mycreds.txt") if gauth.credentials is None: # Authenticate if they're not there gauth.LocalWebserverAuth() elif gauth.access_token_expired: # Refresh them if expired gauth.Refresh() else: # Initialize the saved creds gauth.Authorize() # Save the current credentials to a file gauth.SaveCredentialsFile("mycreds.txt

How to find the sub folder id in google drive using pydrive in python

自古美人都是妖i 提交于 2020-08-11 01:10:12
问题 The directory stricture on google drive is as follows: Inside mydrive/BTP/BTP-4 I need to get the folder ID for BTP-4 so that I can transfer a specific file from the folder. How do I do it?? fileList = GoogleDrive(self.driveConn).ListFile({'q': "'root' in parents and trashed=false"}).GetList() for file in fileList: if (file['title'] == "BTP-4"): fileID = file['id'] print(remoteFile, fileID) return fileID 回答1: Will be able to give path like /MyDrive/BTP/BTP-4 and filename as "test.csv" and