yutipy 2.3.1__py3-none-any.whl → 2.3.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/utils/helpers.py +10 -9
- {yutipy-2.3.1.dist-info → yutipy-2.3.2.dist-info}/METADATA +1 -1
- {yutipy-2.3.1.dist-info → yutipy-2.3.2.dist-info}/RECORD +7 -7
- {yutipy-2.3.1.dist-info → yutipy-2.3.2.dist-info}/WHEEL +0 -0
- {yutipy-2.3.1.dist-info → yutipy-2.3.2.dist-info}/entry_points.txt +0 -0
- {yutipy-2.3.1.dist-info → yutipy-2.3.2.dist-info}/licenses/LICENSE +0 -0
- {yutipy-2.3.1.dist-info → yutipy-2.3.2.dist-info}/top_level.txt +0 -0
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.
|
|
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
|
-
|
|
186
|
+
pattern = re.escape(custom_separator)
|
|
187
187
|
else:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
for sep in separators:
|
|
191
|
-
artists = artists.replace(sep, ",")
|
|
188
|
+
pattern = r"\s*(?:ft\.?|feat\.?|with|and|[;/&])\s*"
|
|
192
189
|
|
|
193
|
-
return [
|
|
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:
|
|
@@ -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
|
|
19
|
-
yutipy-2.3.
|
|
20
|
-
yutipy-2.3.
|
|
21
|
-
yutipy-2.3.
|
|
22
|
-
yutipy-2.3.
|
|
23
|
-
yutipy-2.3.
|
|
24
|
-
yutipy-2.3.
|
|
18
|
+
yutipy/utils/helpers.py,sha256=SIVJHAE_p_8S-VTr-ftLIcIcdL81T9n7_Da0oDqF0D4,7413
|
|
19
|
+
yutipy-2.3.2.dist-info/licenses/LICENSE,sha256=_89JsS2QnBG8tAb5-VWbJDj_uJ002zPJAYBJJdh3DPY,1071
|
|
20
|
+
yutipy-2.3.2.dist-info/METADATA,sha256=qIgzE3l0YZFa3RkJE7jEQgUs9GOEVQVdrQdbwJWk9OU,6577
|
|
21
|
+
yutipy-2.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
yutipy-2.3.2.dist-info/entry_points.txt,sha256=BrgmanaPjQqKQ3Ip76JLcsPgGANtrBSURf5CNIxl1HA,106
|
|
23
|
+
yutipy-2.3.2.dist-info/top_level.txt,sha256=t2A5V2_mUcfnHkbCy6tAQlb3909jDYU5GQgXtA4756I,7
|
|
24
|
+
yutipy-2.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|