Skip to content

Commit

Permalink
fix format/lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Dec 17, 2024
1 parent 43dca79 commit 97c04c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def fixture_yt_auth(browser_filepath) -> YTMusic:

@pytest.fixture(name="yt_oauth")
def fixture_yt_oauth(oauth_filepath, config) -> YTMusic:
credentials = OAuthCredentials(client_id=config["auth"]["client_id"], client_secret=config["auth"]["client_secret"])
credentials = OAuthCredentials(
client_id=config["auth"]["client_id"], client_secret=config["auth"]["client_secret"]
)
return YTMusic(oauth_filepath, oauth_credentials=credentials)


Expand Down
4 changes: 2 additions & 2 deletions ytmusicapi/ytmusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(
self.auth_type: AuthType = AuthType.UNAUTHORIZED

self._token: Token #: OAuth credential handler
self.oauth_credentials: OAuthCredentials #: Client used for OAuth refreshing
self.oauth_credentials: OAuthCredentials | None #: Client used for OAuth refreshing

self._session: requests.Session #: request session for connection pooling
self.proxies: Optional[dict[str, str]] = proxies #: params for session modification
Expand Down Expand Up @@ -132,7 +132,7 @@ def __init__(
else:
self._input_dict = CaseInsensitiveDict(self.auth)

if OAuthToken.is_oauth(self._input_dict):
if self.oauth_credentials is not None and OAuthToken.is_oauth(self._input_dict):
self._token = RefreshingToken(
credentials=self.oauth_credentials, _local_cache=auth_path, **self._input_dict
)
Expand Down

0 comments on commit 97c04c8

Please sign in to comment.