yutipy 2.3.1__py3-none-any.whl → 2.3.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/utils/helpers.py CHANGED
@@ -1,3 +1,5 @@
1
+ import re
2
+
1
3
  import pykakasi
2
4
  import requests
3
5
  from rapidfuzz import fuzz
@@ -174,23 +176,22 @@ def separate_artists(artists: str, custom_separator: str = None) -> list[str]:
174
176
  Separate artist names of a song or album into a list.
175
177
 
176
178
  Args:
177
- artists (str): Artists string (e.g., artistA & artistB, artistA ft. artistB).
179
+ artists (str): Artists string (e.g., artistA & artistB, artistA ft. ArtistB).
178
180
  custom_separator (str, optional): A specific separator to use. Defaults to None.
179
181
 
180
182
  Returns:
181
183
  list[str]: List of individual artists.
182
184
  """
183
- default_separators = [";", "/", "ft.", "ft", "feat", "feat.", "with", "&", "and"]
184
-
185
185
  if custom_separator:
186
- separators = [custom_separator]
186
+ pattern = re.escape(custom_separator)
187
187
  else:
188
- separators = default_separators
189
-
190
- for sep in separators:
191
- artists = artists.replace(sep, ",")
188
+ pattern = r"\s(?:ft\.?|feat\.?|with|and|[;/&])\s"
192
189
 
193
- return [artist.strip() for artist in artists.split(",") if artist.strip()]
190
+ return [
191
+ artist.strip()
192
+ for artist in re.split(pattern, artists, flags=re.IGNORECASE)
193
+ if artist.strip()
194
+ ]
194
195
 
195
196
 
196
197
  def is_valid_string(string: str) -> bool:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yutipy
3
- Version: 2.3.1
3
+ Version: 2.3.3
4
4
  Summary: A simple Python package to interact with various music platforms APIs.
5
5
  Author: Cheap Nightbot
6
6
  Author-email: Cheap Nightbot <hi@cheapnightbot.slmail.me>
@@ -15,10 +15,10 @@ yutipy/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  yutipy/cli/config.py,sha256=e5RIq6RxVxxzx30nKVMa06gwyQ258s7U0WA1xvJuR_0,4543
16
16
  yutipy/cli/search.py,sha256=8SQw0bjRzRqAg-FuVz9aWjB2KBZqmCf38SyKAQ3rx5E,3025
17
17
  yutipy/utils/__init__.py,sha256=AZaqvs6AJwnqwJuodbGnHu702WSUqc8plVC16SppOcU,239
18
- yutipy/utils/helpers.py,sha256=-iH0bx_sxW3Y3jjl6eTbY6QOBoG5t4obRcp7GGyw3ro,7476
19
- yutipy-2.3.1.dist-info/licenses/LICENSE,sha256=_89JsS2QnBG8tAb5-VWbJDj_uJ002zPJAYBJJdh3DPY,1071
20
- yutipy-2.3.1.dist-info/METADATA,sha256=qFEWzEP9BwX147dwfm0X2xlXXD4EblNxuqhSeRZgC2U,6577
21
- yutipy-2.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- yutipy-2.3.1.dist-info/entry_points.txt,sha256=BrgmanaPjQqKQ3Ip76JLcsPgGANtrBSURf5CNIxl1HA,106
23
- yutipy-2.3.1.dist-info/top_level.txt,sha256=t2A5V2_mUcfnHkbCy6tAQlb3909jDYU5GQgXtA4756I,7
24
- yutipy-2.3.1.dist-info/RECORD,,
18
+ yutipy/utils/helpers.py,sha256=_WF-6ltruY4i56xVAgcdeyIFToImjXRX9HL_TUFh6-Y,7411
19
+ yutipy-2.3.3.dist-info/licenses/LICENSE,sha256=_89JsS2QnBG8tAb5-VWbJDj_uJ002zPJAYBJJdh3DPY,1071
20
+ yutipy-2.3.3.dist-info/METADATA,sha256=HEuoaRMM4-qQJOU8ezC40pQtIZvYlr0kBO5b5envxik,6577
21
+ yutipy-2.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ yutipy-2.3.3.dist-info/entry_points.txt,sha256=BrgmanaPjQqKQ3Ip76JLcsPgGANtrBSURf5CNIxl1HA,106
23
+ yutipy-2.3.3.dist-info/top_level.txt,sha256=t2A5V2_mUcfnHkbCy6tAQlb3909jDYU5GQgXtA4756I,7
24
+ yutipy-2.3.3.dist-info/RECORD,,
File without changes