Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credentials #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
client_id.json
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ optional arguments:

**NOTE** When selecting your application type in Step 4 of "Request an OAuth 2.0 client ID", please select "Other". There's also no need to carry out step 5 in that section.

2. Replace `YOUR_CLIENT_ID` in the client_id.json file with the provided Client ID.
3. Replace `YOUR_CLIENT_SECRET` in the client_id.json file wiht the provided Client Secret.
Example:

2. Replace `YOUR_CLIENT_ID` in the client_id.json file with the provided Client ID in provided template.
3. Replace `YOUR_CLIENT_SECRET` in the client_id.json file wiht the provided Client Secret in provided template.

### Installing dependencies and running the script

Expand All @@ -42,4 +44,4 @@ optional arguments:
5. Run `pipenv shell` to open a shell with all the dependencies available (you'll need to do this every time you want to run the script)
6. Now run the script via `python upload.py` as desired. Use `python upload.py -h` to get help.



File renamed without changes.
4 changes: 2 additions & 2 deletions upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def parse_args(arg_input=None):
parser = argparse.ArgumentParser(description='Upload photos to Google Photos.')
parser.add_argument('--auth ', metavar='auth_file', dest='auth_file',
parser.add_argument('--auth ', metavar='auth_file', dest='auth_file', default='client_id.json',
help='file for reading/storing user authentication tokens')
parser.add_argument('--album', metavar='album_name', dest='album_name',
help='name of photo album to create (if it doesn\'t exist). Any uploaded photos will be added to this album.')
Expand Down Expand Up @@ -75,7 +75,7 @@ def save_cred(cred, auth_file):
}

with open(auth_file, 'w') as f:
print(json.dumps(cred_dict), file=f)
print(json.dumps(cred_dict, indent=4), file=f)

# Generator to loop through all albums

Expand Down