Last active
March 9, 2019 17:42
-
-
Save deeuu/740cab4ac24fc3431d35c8d66c182f0d to your computer and use it in GitHub Desktop.
Revisions
-
deeuu revised this gist
Mar 9, 2019 . 1 changed file with 15 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,22 @@ # see https://github.com/3846masa/upload-gphotos import argparse import os parser = argparse.ArgumentParser() parser.add_argument('--folder', help='Folder of images. Can contain subdirectories') parser.add_argument('--username', help='Your Google Photos username') parser.add_argument('--password', help='Your Google Photos password') parser.add_argument('--ftypes', nargs='+', help='Only upload file of this filetype(s)', default=['jpg', 'png', 'mov'], required=False) args = parser.parse_args() ftypes = tuple([_.upper() for _ in args.ftypes] + args.ftypes) for dirpath, dirs, files in os.walk(os.path.abspath(args.folder)): album_name = os.path.basename(dirpath) if album_name.startswith('.'): continue @@ -15,4 +25,4 @@ for dirpath, dirs, files in os.walk(os.path.abspath(folder)): if len(files): print('Processing ', dirpath) upload-gphotos @(files) @(['--username', args.username, '--password', args.password, '--album', album_name]) -
deeuu revised this gist
Mar 7, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ # see https://github.com/3846masa/upload-gphotos import os fname, folder, email, pwd = $ARGS -
deeuu created this gist
Mar 7, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ import os fname, folder, email, pwd = $ARGS ftypes = ['jpg', 'png', 'mov'] ftypes = tuple([_.upper() for _ in ftypes] + ftypes) for dirpath, dirs, files in os.walk(os.path.abspath(folder)): album_name = os.path.basename(dirpath) if album_name.startswith('.'): continue files = [os.path.join(dirpath, f) for f in files if f.endswith(ftypes)] if len(files): print('Processing ', dirpath) upload-gphotos @(files) @(['--username', email, '--password', pwd, '--album', album_name])