googlearchive/PyDrive

How do I get the ID of a specifically named folder?

Opened this issue · 0 comments

Ok so when the specific folder is not created I can create it, but If it exists I need the ID of the folder to work with it.
This is my code so far:

f = drive.ListFile({"q": "mimeType='application/vnd.google-apps.folder' and trashed=false"}).GetList()
    AllFolders = []
    for folder in f:
        AllFolders.append(folder['title'])

    

    if "Pythontesting1" not in AllFolders:
            folder_metadata = {'title' : 'Pythontesting1', 'mimeType' : 'application/vnd.google-apps.folder'}
            folder = drive.CreateFile(folder_metadata)
            folder.Upload()
    else:
        #What do I put here?