Fix expired token refresh error

- Now removes both non-encrypted and encrypted token files only if they exist.
Addresses #1040
This commit is contained in:
ThioJoe
2023-12-23 22:32:05 -05:00
parent ee86c5918e
commit 43ad684a87

View File

@@ -116,7 +116,10 @@ def first_authentication():
except Exception as e:
if "invalid_grant" in str(e):
print(f"{F.YELLOW}[!] Invalid token{S.R} - Requires Re-Authentication")
os.remove(TOKEN_FILE_NAME)
if os.path.exists(TOKEN_FILE_NAME):
os.remove(TOKEN_FILE_NAME)
if os.path.exists(TOKEN_ENCRYPTED_NAME):
os.remove(TOKEN_ENCRYPTED_NAME)
YOUTUBE = get_authenticated_service()
else:
print('\n')