yutipy 2.2.0__py3-none-any.whl → 2.2.2__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/logger.py +5 -2
- yutipy/spotify.py +9 -1
- {yutipy-2.2.0.dist-info → yutipy-2.2.2.dist-info}/METADATA +1 -1
- {yutipy-2.2.0.dist-info → yutipy-2.2.2.dist-info}/RECORD +8 -8
- {yutipy-2.2.0.dist-info → yutipy-2.2.2.dist-info}/WHEEL +1 -1
- {yutipy-2.2.0.dist-info → yutipy-2.2.2.dist-info}/entry_points.txt +0 -0
- {yutipy-2.2.0.dist-info → yutipy-2.2.2.dist-info}/licenses/LICENSE +0 -0
- {yutipy-2.2.0.dist-info → yutipy-2.2.2.dist-info}/top_level.txt +0 -0
yutipy/logger.py
CHANGED
|
@@ -27,10 +27,13 @@ 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."""
|
yutipy/spotify.py
CHANGED
|
@@ -1087,8 +1087,16 @@ class SpotifyAuth:
|
|
|
1087
1087
|
except requests.RequestException as e:
|
|
1088
1088
|
raise NetworkException(f"Network error occurred: {e}")
|
|
1089
1089
|
|
|
1090
|
+
if response.status_code == 204:
|
|
1091
|
+
logger.info("Requested user is currently not listening to any music.")
|
|
1092
|
+
return None
|
|
1090
1093
|
if response.status_code != 200:
|
|
1091
|
-
|
|
1094
|
+
try:
|
|
1095
|
+
logger.error(f"Unexpected response: {response.json()}")
|
|
1096
|
+
except requests.exceptions.JSONDecodeError:
|
|
1097
|
+
logger.error(
|
|
1098
|
+
f"Response Code: {response.status_code}, Reason: {response.reason}"
|
|
1099
|
+
)
|
|
1092
1100
|
return None
|
|
1093
1101
|
|
|
1094
1102
|
response_json = response.json()
|
|
@@ -4,19 +4,19 @@ yutipy/exceptions.py,sha256=oMuhNfDJ2AFsM_fJn6sayxMqIJRY_ihHRmL0U2IK6qQ,1501
|
|
|
4
4
|
yutipy/itunes.py,sha256=fV7KLsXWvfM_97KwVwn_KfnWM7j0cVGE7RytvnDGlZM,7929
|
|
5
5
|
yutipy/kkbox.py,sha256=MuYpR_UTZQxeitn2rc0UUgiMVikIXcVWmns3eSVjd_g,18847
|
|
6
6
|
yutipy/lastfm.py,sha256=0adVGigS8Kqnu52k-ry5eqHR6koktgKBhCNI1riUMfk,4302
|
|
7
|
-
yutipy/logger.py,sha256=
|
|
7
|
+
yutipy/logger.py,sha256=69mUj7XiNbK61vo4k6BDZlwP8RDNTMVxoZsPd9DhQfI,1317
|
|
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=mHa5C6LTzfWOb_6LJhGm_HX7yvWcY0q7acUfU_ofw4A,43508
|
|
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.2.dist-info/licenses/LICENSE,sha256=_89JsS2QnBG8tAb5-VWbJDj_uJ002zPJAYBJJdh3DPY,1071
|
|
18
|
+
yutipy-2.2.2.dist-info/METADATA,sha256=XWSYmaoMjUgwnSdXzRbRM5Awn4IHT5-Gfgecm1lxvDE,6522
|
|
19
|
+
yutipy-2.2.2.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
20
|
+
yutipy-2.2.2.dist-info/entry_points.txt,sha256=BrgmanaPjQqKQ3Ip76JLcsPgGANtrBSURf5CNIxl1HA,106
|
|
21
|
+
yutipy-2.2.2.dist-info/top_level.txt,sha256=t2A5V2_mUcfnHkbCy6tAQlb3909jDYU5GQgXtA4756I,7
|
|
22
|
+
yutipy-2.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|