We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c86fc1c commit 565d7fdCopy full SHA for 565d7fd
ytmusic_deleter/auth.py
@@ -4,6 +4,7 @@
4
5
import ytmusicapi
6
from ytmusicapi import YTMusic
7
+from ytmusicapi.exceptions import YTMusicUserError
8
9
from . import common as const
10
@@ -23,7 +24,7 @@ def ensure_auth(credential_dir, oauth) -> YTMusic:
23
24
logging.info(f"Attempting authentication with: {auth_file_path}")
25
yt_auth = YTMusic(auth_file_path)
26
logging.info(f'Authenticated with: {auth_file_path}"')
- except JSONDecodeError:
27
+ except (JSONDecodeError, YTMusicUserError, FileNotFoundError):
28
logging.info(f"Creating file: {auth_file_name}")
29
if oauth:
30
ytmusicapi.setup_oauth(filepath=auth_file_path, open_browser=True)
0 commit comments