commit ae90c64885295e40e72ec6cf94ca35562eb65a1c Author: neingeist Date: Wed Jul 11 12:43:29 2018 +0200 initial commit diff --git a/drive-download.py b/drive-download.py new file mode 100644 index 0000000..42abded --- /dev/null +++ b/drive-download.py @@ -0,0 +1,21 @@ +FOLDER = '1J_Yw3ENBfDOEjiPV2LpYIa86aAPnaVx3' + +import os +from pydrive.auth import GoogleAuth +from pydrive.drive import GoogleDrive + +gauth = GoogleAuth() +gauth.CommandLineAuth() + +drive = GoogleDrive(gauth) + +file_list = drive.ListFile({'q': "'{}' in parents and trashed=false".format(FOLDER)}).GetList() +for file1 in file_list: + if file1['mimeType'] == 'application/vnd.google-apps.folder': + continue + local_filename = file1['title'] + print(local_filename) + if not os.path.exists(local_filename): + file1.GetContentFile(local_filename) + else: + raise "{} exists".format(local_filename) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ddcd7fa --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pydrive