Check for secrets file
This commit is contained in:
parent
0e9ba7048d
commit
739338e2d8
3
main.py
3
main.py
@ -40,6 +40,9 @@ def get_yt_creds():
|
|||||||
if creds and creds.expired and creds.refresh_token:
|
if creds and creds.expired and creds.refresh_token:
|
||||||
creds.refresh(Request())
|
creds.refresh(Request())
|
||||||
else:
|
else:
|
||||||
|
if not os.path.exists(client_secrets_file):
|
||||||
|
print(f'Client secrets file {client_secrets_file} not found')
|
||||||
|
sys.exit(1)
|
||||||
flow = InstalledAppFlow.from_client_secrets_file(
|
flow = InstalledAppFlow.from_client_secrets_file(
|
||||||
client_secrets_file, scopes
|
client_secrets_file, scopes
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user