yutipy 1.5.0__tar.gz → 1.5.1__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.
Potentially problematic release.
This version of yutipy might be problematic. Click here for more details.
- {yutipy-1.5.0 → yutipy-1.5.1}/PKG-INFO +1 -1
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/__init__.py +0 -2
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/deezer.py +2 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/exceptions.py +28 -14
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/itunes.py +2 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/kkbox.py +2 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/musicyt.py +6 -4
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/spotify.py +3 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/yutipy_music.py +2 -2
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy.egg-info/PKG-INFO +1 -1
- {yutipy-1.5.0 → yutipy-1.5.1}/.gitattributes +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/.github/FUNDING.yml +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/.github/workflows/pytest-unit-testing.yml +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/.github/workflows/release.yml +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/.gitignore +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/.readthedocs.yaml +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/LICENSE +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/MANIFEST.in +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/README.md +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/Makefile +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/_static/yutipy_header.png +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/_static/yutipy_logo.png +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/api_reference.rst +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/available_platforms.rst +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/cli.rst +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/conf.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/faq.rst +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/index.rst +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/installation.rst +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/make.bat +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/requirements.txt +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/docs/usage_examples.rst +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/pyproject.toml +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/requirements-dev.txt +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/requirements.txt +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/setup.cfg +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/tests/__init__.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/tests/test_deezer.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/tests/test_itunes.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/tests/test_kkbox.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/tests/test_models.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/tests/test_musicyt.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/tests/test_spotify.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/tests/test_utils.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/tests/test_yutipy_music.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/cli/__init__.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/cli/config.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/cli/search.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/logging.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/models.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/utils/__init__.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/utils/helpers.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy/utils/logger.py +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy.egg-info/SOURCES.txt +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy.egg-info/dependency_links.txt +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy.egg-info/entry_points.txt +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy.egg-info/requires.txt +0 -0
- {yutipy-1.5.0 → yutipy-1.5.1}/yutipy.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,6 @@ from .kkbox import KKBox
|
|
|
4
4
|
from .musicyt import MusicYT
|
|
5
5
|
from .spotify import Spotify
|
|
6
6
|
from .yutipy_music import YutipyMusic
|
|
7
|
-
from . import exceptions
|
|
8
7
|
|
|
9
8
|
__all__ = [
|
|
10
9
|
"Deezer",
|
|
@@ -13,5 +12,4 @@ __all__ = [
|
|
|
13
12
|
"MusicYT",
|
|
14
13
|
"Spotify",
|
|
15
14
|
"YutipyMusic",
|
|
16
|
-
"exceptions"
|
|
17
15
|
]
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
""
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
__all__ = [
|
|
2
|
+
"AuthenticationException",
|
|
3
|
+
"InvalidResponseException",
|
|
4
|
+
"InvalidValueException",
|
|
5
|
+
"NetworkException",
|
|
6
|
+
"YutipyException",
|
|
7
|
+
]
|
|
5
8
|
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
# Base Exception
|
|
11
|
+
class YutipyException(Exception):
|
|
12
|
+
"""Base class for exceptions in the Yutipy package."""
|
|
9
13
|
|
|
10
14
|
pass
|
|
11
15
|
|
|
12
16
|
|
|
17
|
+
# Service Exceptions
|
|
13
18
|
class DeezerException(YutipyException):
|
|
14
19
|
"""Exception raised for errors related to the Deezer API."""
|
|
15
20
|
|
|
@@ -22,8 +27,8 @@ class ItunesException(YutipyException):
|
|
|
22
27
|
pass
|
|
23
28
|
|
|
24
29
|
|
|
25
|
-
class
|
|
26
|
-
"""Exception raised for
|
|
30
|
+
class KKBoxException(YutipyException):
|
|
31
|
+
"""Exception raised for erros related to the KKBOX Open API."""
|
|
27
32
|
|
|
28
33
|
pass
|
|
29
34
|
|
|
@@ -34,14 +39,15 @@ class MusicYTException(YutipyException):
|
|
|
34
39
|
pass
|
|
35
40
|
|
|
36
41
|
|
|
37
|
-
class
|
|
38
|
-
"""Exception raised for
|
|
42
|
+
class SpotifyException(YutipyException):
|
|
43
|
+
"""Exception raised for errors related to the Spotify API."""
|
|
39
44
|
|
|
40
45
|
pass
|
|
41
46
|
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
# Generic Exceptions
|
|
49
|
+
class AuthenticationException(YutipyException):
|
|
50
|
+
"""Exception raised for authentication errors."""
|
|
45
51
|
|
|
46
52
|
pass
|
|
47
53
|
|
|
@@ -52,5 +58,13 @@ class InvalidResponseException(YutipyException):
|
|
|
52
58
|
pass
|
|
53
59
|
|
|
54
60
|
|
|
55
|
-
class
|
|
56
|
-
"""Exception raised for
|
|
61
|
+
class InvalidValueException(YutipyException):
|
|
62
|
+
"""Exception raised for invalid values."""
|
|
63
|
+
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class NetworkException(YutipyException):
|
|
68
|
+
"""Exception raised for network-related errors."""
|
|
69
|
+
|
|
70
|
+
pass
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
__all__ = ["MusicYT", "MusicYTException"]
|
|
2
|
+
|
|
2
3
|
from pprint import pprint
|
|
3
4
|
from typing import Optional
|
|
4
5
|
|
|
@@ -8,7 +9,7 @@ from ytmusicapi import YTMusic, exceptions
|
|
|
8
9
|
from yutipy.exceptions import (
|
|
9
10
|
InvalidResponseException,
|
|
10
11
|
InvalidValueException,
|
|
11
|
-
|
|
12
|
+
MusicYTException,
|
|
12
13
|
)
|
|
13
14
|
from yutipy.models import MusicInfo
|
|
14
15
|
from yutipy.utils.helpers import are_strings_similar, is_valid_string
|
|
@@ -86,8 +87,8 @@ class MusicYT:
|
|
|
86
87
|
try:
|
|
87
88
|
results = self.ytmusic.search(query=query, limit=limit)
|
|
88
89
|
except exceptions.YTMusicServerError as e:
|
|
89
|
-
logger.error(f"
|
|
90
|
-
raise
|
|
90
|
+
logger.error(f"Something went wrong while searching YTMusic: {e}")
|
|
91
|
+
raise MusicYTException(f"Something went wrong while searching YTMusic: {e}")
|
|
91
92
|
|
|
92
93
|
for result in results:
|
|
93
94
|
if self._is_relevant_result(artist, song, result):
|
|
@@ -294,6 +295,7 @@ class MusicYT:
|
|
|
294
295
|
|
|
295
296
|
if __name__ == "__main__":
|
|
296
297
|
import logging
|
|
298
|
+
|
|
297
299
|
from yutipy.utils.logger import enable_logging
|
|
298
300
|
|
|
299
301
|
enable_logging(level=logging.DEBUG)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
__all__ = ["Spotify", "SpotifyException"]
|
|
2
|
+
|
|
1
3
|
import base64
|
|
2
4
|
import os
|
|
3
5
|
import time
|
|
@@ -490,6 +492,7 @@ class Spotify:
|
|
|
490
492
|
|
|
491
493
|
if __name__ == "__main__":
|
|
492
494
|
import logging
|
|
495
|
+
|
|
493
496
|
from yutipy.utils.logger import enable_logging
|
|
494
497
|
|
|
495
498
|
enable_logging(level=logging.DEBUG)
|
|
@@ -33,7 +33,7 @@ class YutipyMusic:
|
|
|
33
33
|
|
|
34
34
|
try:
|
|
35
35
|
self.services["kkbox"] = KKBox()
|
|
36
|
-
except (KKBoxException
|
|
36
|
+
except (KKBoxException) as e:
|
|
37
37
|
logger.warning(
|
|
38
38
|
f"{self.__class__.__name__}: Skipping KKBox due to KKBoxException: {e}"
|
|
39
39
|
)
|
|
@@ -43,7 +43,7 @@ class YutipyMusic:
|
|
|
43
43
|
|
|
44
44
|
try:
|
|
45
45
|
self.services["spotify"] = Spotify()
|
|
46
|
-
except (SpotifyException
|
|
46
|
+
except (SpotifyException) as e:
|
|
47
47
|
logger.warning(
|
|
48
48
|
f"{self.__class__.__name__}: Skipping Spotify due to SpotifyException: {e}"
|
|
49
49
|
)
|
|
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
|