Check for secrets file

This commit is contained in:
Maks Snegov 2024-02-02 21:12:40 -08:00
parent 0e9ba7048d
commit 739338e2d8

View File

@ -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
) )