File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ Note: You can limit maximum concurrent downloads by changing the value of MAX_CO
7979- Visit the [ Google Cloud Console] ( https://console.developers.google.com/apis/credentials )
8080- Go to the OAuth Consent tab, fill it, and save.
8181- Go to the Credentials tab and click Create Credentials -> OAuth Client ID
82- - Choose Other and Create.
82+ - Choose ` Desktop App ` as Application type and Create.
8383- Use the download button to download your credentials.
8484- Move that file to the root of mirror-bot, and rename it to credentials.json
8585- Visit [ Google API page] ( https://console.developers.google.com/apis/library )
Original file line number Diff line number Diff line change 99if os .path .exists (__G_DRIVE_TOKEN_FILE ):
1010 with open (__G_DRIVE_TOKEN_FILE , 'rb' ) as f :
1111 credentials = pickle .load (f )
12- if credentials is None or not credentials .valid :
13- if credentials and credentials .expired and credentials .refresh_token :
14- credentials .refresh (Request ())
12+ if (
13+ (credentials is None or not credentials .valid )
14+ and credentials
15+ and credentials .expired
16+ and credentials .refresh_token
17+ ):
18+ credentials .refresh (Request ())
1519else :
1620 flow = InstalledAppFlow .from_client_secrets_file (
1721 'credentials.json' , __OAUTH_SCOPE )
18- credentials = flow .run_console (port = 0 )
22+ credentials = flow .run_local_server (port = 0 )
1923
2024# Save the credentials for the next run
2125with open (__G_DRIVE_TOKEN_FILE , 'wb' ) as token :
22- pickle .dump (credentials , token )
26+ pickle .dump (credentials , token )
You can’t perform that action at this time.
0 commit comments