yutipy 2.2.1__py3-none-any.whl → 2.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of yutipy might be problematic. Click here for more details.
- yutipy/kkbox.py +14 -0
- yutipy/logger.py +7 -4
- yutipy/spotify.py +14 -0
- {yutipy-2.2.1.dist-info → yutipy-2.2.3.dist-info}/METADATA +1 -1
- {yutipy-2.2.1.dist-info → yutipy-2.2.3.dist-info}/RECORD +9 -9
- {yutipy-2.2.1.dist-info → yutipy-2.2.3.dist-info}/WHEEL +1 -1
- {yutipy-2.2.1.dist-info → yutipy-2.2.3.dist-info}/entry_points.txt +0 -0
- {yutipy-2.2.1.dist-info → yutipy-2.2.3.dist-info}/licenses/LICENSE +0 -0
- {yutipy-2.2.1.dist-info → yutipy-2.2.3.dist-info}/top_level.txt +0 -0
yutipy/kkbox.py
CHANGED
|
@@ -91,6 +91,13 @@ class KKBox:
|
|
|
91
91
|
self.__access_token = token_info.get("access_token")
|
|
92
92
|
self.__token_expires_in = token_info.get("expires_in")
|
|
93
93
|
self.__token_requested_at = token_info.get("requested_at")
|
|
94
|
+
|
|
95
|
+
try:
|
|
96
|
+
self.save_access_token(token_info)
|
|
97
|
+
except NotImplementedError:
|
|
98
|
+
logger.warning(
|
|
99
|
+
"`save_access_token` is not implemented, falling back to in-memory storage. Access token will not be saved."
|
|
100
|
+
)
|
|
94
101
|
else:
|
|
95
102
|
logger.warning(
|
|
96
103
|
"`defer_load` is set to `True`. Make sure to call `load_token_after_init()`."
|
|
@@ -135,6 +142,13 @@ class KKBox:
|
|
|
135
142
|
self.__token_expires_in = token_info.get("expires_in")
|
|
136
143
|
self.__token_requested_at = token_info.get("requested_at")
|
|
137
144
|
|
|
145
|
+
try:
|
|
146
|
+
self.save_access_token(token_info)
|
|
147
|
+
except NotImplementedError:
|
|
148
|
+
logger.warning(
|
|
149
|
+
"`save_access_token` is not implemented, falling back to in-memory storage. Access token will not be saved."
|
|
150
|
+
)
|
|
151
|
+
|
|
138
152
|
def __authorization_header(self) -> dict:
|
|
139
153
|
"""
|
|
140
154
|
Generates the authorization header for Spotify API requests.
|
yutipy/logger.py
CHANGED
|
@@ -2,7 +2,7 @@ import logging
|
|
|
2
2
|
|
|
3
3
|
# Create a logger for the library
|
|
4
4
|
logger = logging.getLogger("yutipy")
|
|
5
|
-
logger.setLevel(logging.
|
|
5
|
+
logger.setLevel(logging.NOTSET)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def enable_logging(level=logging.INFO, handler=None):
|
|
@@ -27,13 +27,16 @@ def enable_logging(level=logging.INFO, handler=None):
|
|
|
27
27
|
console_handler.setFormatter(formatter)
|
|
28
28
|
handler = console_handler
|
|
29
29
|
|
|
30
|
-
# Add the handler if not already added
|
|
31
|
-
if
|
|
30
|
+
# Add the handler if it is not already added
|
|
31
|
+
if handler not in logger.handlers:
|
|
32
32
|
logger.addHandler(handler)
|
|
33
33
|
|
|
34
|
+
# Disable propagation to avoid duplicate logs
|
|
35
|
+
logger.propagate = False
|
|
36
|
+
|
|
34
37
|
|
|
35
38
|
def disable_logging():
|
|
36
39
|
"""Disable logging for the library."""
|
|
37
|
-
logger.setLevel(logging.
|
|
40
|
+
logger.setLevel(logging.NOTSET)
|
|
38
41
|
for handler in logger.handlers[:]: # Remove all handlers
|
|
39
42
|
logger.removeHandler(handler)
|
yutipy/spotify.py
CHANGED
|
@@ -100,6 +100,13 @@ class Spotify:
|
|
|
100
100
|
self.__access_token = token_info.get("access_token")
|
|
101
101
|
self.__token_expires_in = token_info.get("expires_in")
|
|
102
102
|
self.__token_requested_at = token_info.get("requested_at")
|
|
103
|
+
|
|
104
|
+
try:
|
|
105
|
+
self.save_access_token(token_info)
|
|
106
|
+
except NotImplementedError:
|
|
107
|
+
logger.warning(
|
|
108
|
+
"`save_access_token` is not implemented, falling back to in-memory storage. Access token will not be saved."
|
|
109
|
+
)
|
|
103
110
|
else:
|
|
104
111
|
logger.warning(
|
|
105
112
|
"`defer_load` is set to `True`. Make sure to call `load_token_after_init()`."
|
|
@@ -144,6 +151,13 @@ class Spotify:
|
|
|
144
151
|
self.__token_expires_in = token_info.get("expires_in")
|
|
145
152
|
self.__token_requested_at = token_info.get("requested_at")
|
|
146
153
|
|
|
154
|
+
try:
|
|
155
|
+
self.save_access_token(token_info)
|
|
156
|
+
except NotImplementedError:
|
|
157
|
+
logger.warning(
|
|
158
|
+
"`save_access_token` is not implemented, falling back to in-memory storage. Access token will not be saved."
|
|
159
|
+
)
|
|
160
|
+
|
|
147
161
|
def __authorization_header(self) -> dict:
|
|
148
162
|
"""
|
|
149
163
|
Generates the authorization header for Spotify API requests.
|
|
@@ -2,21 +2,21 @@ yutipy/__init__.py,sha256=Zrw3cr_6khXp1IgQdZxGcUM9A64GYgPs-6rlqSukW5Q,294
|
|
|
2
2
|
yutipy/deezer.py,sha256=PTTTfeORh1HZ_ta7_Uu4YARouSknUnAxO9AQJPFm4v0,11402
|
|
3
3
|
yutipy/exceptions.py,sha256=oMuhNfDJ2AFsM_fJn6sayxMqIJRY_ihHRmL0U2IK6qQ,1501
|
|
4
4
|
yutipy/itunes.py,sha256=fV7KLsXWvfM_97KwVwn_KfnWM7j0cVGE7RytvnDGlZM,7929
|
|
5
|
-
yutipy/kkbox.py,sha256=
|
|
5
|
+
yutipy/kkbox.py,sha256=7kgq0ZliiA16CeJa49faSUS8_SdqQPp6M-cKdnMFlaM,19447
|
|
6
6
|
yutipy/lastfm.py,sha256=0adVGigS8Kqnu52k-ry5eqHR6koktgKBhCNI1riUMfk,4302
|
|
7
|
-
yutipy/logger.py,sha256=
|
|
7
|
+
yutipy/logger.py,sha256=4jXB-Qt2r75kpuAdxSGIwGrcpUyugxs9ROmBru9NtTw,1314
|
|
8
8
|
yutipy/models.py,sha256=_92e54uXXCw53oWZiNLBBai6C0InOZMJL7r8GJ5smbM,2215
|
|
9
9
|
yutipy/musicyt.py,sha256=6Vz8bI8hDNFoDKRh6GK90dGMRbn_d5d6eGPsaYogb_Y,9315
|
|
10
|
-
yutipy/spotify.py,sha256=
|
|
10
|
+
yutipy/spotify.py,sha256=pf_vaQXMxExMjIGuId4eTHaSO112hAqf-6YgWLSa5uQ,44108
|
|
11
11
|
yutipy/yutipy_music.py,sha256=cHJ95HxGILweVrnEacj8tTlU0NPxMpuDVMpngdX0mZQ,6558
|
|
12
12
|
yutipy/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
yutipy/cli/config.py,sha256=e5RIq6RxVxxzx30nKVMa06gwyQ258s7U0WA1xvJuR_0,4543
|
|
14
14
|
yutipy/cli/search.py,sha256=8SQw0bjRzRqAg-FuVz9aWjB2KBZqmCf38SyKAQ3rx5E,3025
|
|
15
15
|
yutipy/utils/__init__.py,sha256=AZaqvs6AJwnqwJuodbGnHu702WSUqc8plVC16SppOcU,239
|
|
16
16
|
yutipy/utils/helpers.py,sha256=W3g9iqoSygcFFCKCp2sk0NQrZOEG26wI2XuNi9pgAXE,5207
|
|
17
|
-
yutipy-2.2.
|
|
18
|
-
yutipy-2.2.
|
|
19
|
-
yutipy-2.2.
|
|
20
|
-
yutipy-2.2.
|
|
21
|
-
yutipy-2.2.
|
|
22
|
-
yutipy-2.2.
|
|
17
|
+
yutipy-2.2.3.dist-info/licenses/LICENSE,sha256=_89JsS2QnBG8tAb5-VWbJDj_uJ002zPJAYBJJdh3DPY,1071
|
|
18
|
+
yutipy-2.2.3.dist-info/METADATA,sha256=GU0nDx1yzsjArFuBvjNw9LdFVmktbOFyFCjUFMklD-o,6522
|
|
19
|
+
yutipy-2.2.3.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
20
|
+
yutipy-2.2.3.dist-info/entry_points.txt,sha256=BrgmanaPjQqKQ3Ip76JLcsPgGANtrBSURf5CNIxl1HA,106
|
|
21
|
+
yutipy-2.2.3.dist-info/top_level.txt,sha256=t2A5V2_mUcfnHkbCy6tAQlb3909jDYU5GQgXtA4756I,7
|
|
22
|
+
yutipy-2.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|