yutipy 2.3.4__tar.gz → 2.3.5__tar.gz
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.
- {yutipy-2.3.4 → yutipy-2.3.5}/PKG-INFO +1 -1
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/utils/helpers.py +3 -3
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/yutipy_music.py +28 -13
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy.egg-info/PKG-INFO +1 -1
- {yutipy-2.3.4 → yutipy-2.3.5}/.gitattributes +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/.github/FUNDING.yml +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/.github/dependabot.yml +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/.github/workflows/pytest-unit-testing.yml +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/.github/workflows/release.yml +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/.gitignore +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/.readthedocs.yaml +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/LICENSE +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/MANIFEST.in +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/README.md +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/Makefile +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/_static/yutipy_header.png +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/_static/yutipy_logo.png +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/api_reference.rst +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/available_platforms.rst +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/cli.rst +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/conf.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/faq.rst +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/index.rst +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/installation.rst +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/make.bat +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/requirements.txt +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/docs/usage_examples.rst +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/pyproject.toml +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/requirements-dev.txt +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/requirements.txt +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/setup.cfg +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/tests/__init__.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/tests/test_deezer.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/tests/test_itunes.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/tests/test_kkbox.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/tests/test_lastfm.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/tests/test_lrclib.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/tests/test_models.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/tests/test_musicyt.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/tests/test_spotify.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/tests/test_utils.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/__init__.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/base_clients.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/cli/__init__.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/cli/config.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/cli/search.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/deezer.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/exceptions.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/itunes.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/kkbox.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/lastfm.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/logger.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/lrclib.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/models.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/musicyt.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/spotify.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy/utils/__init__.py +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy.egg-info/SOURCES.txt +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy.egg-info/dependency_links.txt +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy.egg-info/entry_points.txt +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy.egg-info/requires.txt +0 -0
- {yutipy-2.3.4 → yutipy-2.3.5}/yutipy.egg-info/top_level.txt +0 -0
|
@@ -10,9 +10,9 @@ kakasi = pykakasi.kakasi()
|
|
|
10
10
|
TRANSLATION_CACHE = {}
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
def similarity(str1: str, str2: str, threshold: int =
|
|
13
|
+
def similarity(str1: str, str2: str, threshold: int = 100):
|
|
14
14
|
similarity_score = fuzz.WRatio(str1, str2, processor=default_process)
|
|
15
|
-
return similarity_score
|
|
15
|
+
return similarity_score >= threshold
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
def translate_text(
|
|
@@ -66,7 +66,7 @@ def translate_text(
|
|
|
66
66
|
def are_strings_similar(
|
|
67
67
|
str1: str,
|
|
68
68
|
str2: str,
|
|
69
|
-
threshold: int =
|
|
69
|
+
threshold: int = 90,
|
|
70
70
|
use_translation: bool = True,
|
|
71
71
|
translation_session: requests.Session = None,
|
|
72
72
|
) -> bool:
|
|
@@ -25,8 +25,8 @@ class YutipyMusic:
|
|
|
25
25
|
|
|
26
26
|
def __init__(
|
|
27
27
|
self,
|
|
28
|
-
custom_kkbox_class=
|
|
29
|
-
custom_spotify_class=
|
|
28
|
+
custom_kkbox_class=None,
|
|
29
|
+
custom_spotify_class=None,
|
|
30
30
|
) -> None:
|
|
31
31
|
"""
|
|
32
32
|
Parameters
|
|
@@ -48,8 +48,10 @@ class YutipyMusic:
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
try:
|
|
51
|
-
self.services["kkbox"] =
|
|
52
|
-
defer_load=True, fetch_lyrics=False
|
|
51
|
+
self.services["kkbox"] = (
|
|
52
|
+
custom_kkbox_class(defer_load=True, fetch_lyrics=False)
|
|
53
|
+
if custom_kkbox_class
|
|
54
|
+
else KKBox(fetch_lyrics=False)
|
|
53
55
|
)
|
|
54
56
|
except KKBoxException as e:
|
|
55
57
|
logger.warning(
|
|
@@ -60,8 +62,10 @@ class YutipyMusic:
|
|
|
60
62
|
self.album_art_priority.insert(idx, "kkbox")
|
|
61
63
|
|
|
62
64
|
try:
|
|
63
|
-
self.services["spotify"] =
|
|
64
|
-
defer_load=True, fetch_lyrics=False
|
|
65
|
+
self.services["spotify"] = (
|
|
66
|
+
custom_spotify_class(defer_load=True, fetch_lyrics=False)
|
|
67
|
+
if custom_spotify_class
|
|
68
|
+
else Spotify(fetch_lyrics=False)
|
|
65
69
|
)
|
|
66
70
|
except SpotifyException as e:
|
|
67
71
|
logger.warning(
|
|
@@ -179,12 +183,23 @@ class YutipyMusic:
|
|
|
179
183
|
"upc",
|
|
180
184
|
]
|
|
181
185
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
# Always overwrite with Spotify, else Deezer, else KKBox
|
|
187
|
+
highest_priority = None
|
|
188
|
+
for candidate in ["spotify", "deezer", "kkbox"]:
|
|
189
|
+
if candidate in self.services:
|
|
190
|
+
highest_priority = candidate
|
|
191
|
+
break
|
|
192
|
+
|
|
193
|
+
if service_name == highest_priority:
|
|
194
|
+
for attr in attributes:
|
|
187
195
|
setattr(self.music_info, attr, getattr(result, attr))
|
|
196
|
+
else:
|
|
197
|
+
for attr in attributes:
|
|
198
|
+
if getattr(result, attr) and (
|
|
199
|
+
not getattr(self.music_info, attr)
|
|
200
|
+
or (attr in ["genre", "album_type"] and service_name == "itunes")
|
|
201
|
+
):
|
|
202
|
+
setattr(self.music_info, attr, getattr(result, attr))
|
|
188
203
|
|
|
189
204
|
if result.album_art:
|
|
190
205
|
current_priority = self.album_art_priority.index(service_name)
|
|
@@ -193,7 +208,7 @@ class YutipyMusic:
|
|
|
193
208
|
if self.music_info.album_art_source
|
|
194
209
|
else len(self.album_art_priority)
|
|
195
210
|
)
|
|
196
|
-
if current_priority < existing_priority:
|
|
211
|
+
if current_priority < existing_priority or service_name == highest_priority:
|
|
197
212
|
self.music_info.album_art = result.album_art
|
|
198
213
|
self.music_info.album_art_source = service_name
|
|
199
214
|
|
|
@@ -213,7 +228,7 @@ if __name__ == "__main__":
|
|
|
213
228
|
|
|
214
229
|
from yutipy.logger import enable_logging
|
|
215
230
|
|
|
216
|
-
enable_logging(level=logging.
|
|
231
|
+
enable_logging(level=logging.INFO)
|
|
217
232
|
yutipy_music = YutipyMusic()
|
|
218
233
|
|
|
219
234
|
artist_name = input("Artist Name: ")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|