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 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 not any(isinstance(h, type(handler)) for h in logger.handlers):
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
- logger.error(f"Unexpected response: {response.json()}")
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()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yutipy
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: A simple package for retrieving music information from various music platforms APIs.
5
5
  Author: Cheap Nightbot
6
6
  Author-email: Cheap Nightbot <hi@cheapnightbot.slmail.me>
@@ -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=cHCjpDslVsBOnp7jluqrOOi4ekDIggPhbSfqHeIfT-U,1263
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=wTW4Lne7tS3PSD54LQnfVAvKwcykxBiCMdeZqYpEAFI,43148
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.0.dist-info/licenses/LICENSE,sha256=_89JsS2QnBG8tAb5-VWbJDj_uJ002zPJAYBJJdh3DPY,1071
18
- yutipy-2.2.0.dist-info/METADATA,sha256=2LjyRb8YTtYacV7pa2PjH6LGr_5V4CLIMU7pZRVdlYU,6522
19
- yutipy-2.2.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
20
- yutipy-2.2.0.dist-info/entry_points.txt,sha256=BrgmanaPjQqKQ3Ip76JLcsPgGANtrBSURf5CNIxl1HA,106
21
- yutipy-2.2.0.dist-info/top_level.txt,sha256=t2A5V2_mUcfnHkbCy6tAQlb3909jDYU5GQgXtA4756I,7
22
- yutipy-2.2.0.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5