yutipy 2.2.6__tar.gz → 2.2.8__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-2.2.6 → yutipy-2.2.8}/PKG-INFO +4 -4
- {yutipy-2.2.6 → yutipy-2.2.8}/tests/test_kkbox.py +2 -2
- {yutipy-2.2.6 → yutipy-2.2.8}/tests/test_lastfm.py +1 -1
- {yutipy-2.2.6 → yutipy-2.2.8}/tests/test_spotify.py +14 -22
- yutipy-2.2.8/yutipy/base_clients.py +582 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/deezer.py +7 -21
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/itunes.py +10 -20
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/kkbox.py +22 -222
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/lastfm.py +1 -1
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/musicyt.py +3 -5
- yutipy-2.2.8/yutipy/spotify.py +646 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy.egg-info/PKG-INFO +4 -4
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy.egg-info/SOURCES.txt +1 -0
- yutipy-2.2.6/yutipy/spotify.py +0 -1236
- {yutipy-2.2.6 → yutipy-2.2.8}/.gitattributes +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/.github/FUNDING.yml +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/.github/dependabot.yml +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/.github/workflows/pytest-unit-testing.yml +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/.github/workflows/release.yml +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/.gitignore +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/.readthedocs.yaml +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/LICENSE +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/MANIFEST.in +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/README.md +3 -3
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/Makefile +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/_static/yutipy_header.png +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/_static/yutipy_logo.png +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/api_reference.rst +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/available_platforms.rst +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/cli.rst +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/conf.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/faq.rst +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/index.rst +3 -3
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/installation.rst +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/make.bat +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/requirements.txt +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/docs/usage_examples.rst +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/pyproject.toml +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/requirements-dev.txt +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/requirements.txt +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/setup.cfg +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/tests/__init__.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/tests/test_deezer.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/tests/test_itunes.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/tests/test_models.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/tests/test_musicyt.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/tests/test_utils.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/__init__.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/cli/__init__.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/cli/config.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/cli/search.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/exceptions.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/logger.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/models.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/utils/__init__.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/utils/helpers.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy/yutipy_music.py +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy.egg-info/dependency_links.txt +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy.egg-info/entry_points.txt +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy.egg-info/requires.txt +0 -0
- {yutipy-2.2.6 → yutipy-2.2.8}/yutipy.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: yutipy
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.8
|
|
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>
|
|
@@ -42,12 +42,12 @@ Dynamic: license-file
|
|
|
42
42
|
<a href="https://github.com/CheapNightbot/yutipy/actions/workflows/tests.yml">
|
|
43
43
|
<img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/cheapnightbot/yutipy/pytest-unit-testing.yml?style=for-the-badge&label=Pytest">
|
|
44
44
|
</a>
|
|
45
|
-
<a href="https://pypi.org/project/yutipy/">
|
|
46
|
-
<img src="https://img.shields.io/pypi/v/yutipy?style=for-the-badge" alt="PyPI" />
|
|
47
|
-
</a>
|
|
48
45
|
<a href="https://yutipy.readthedocs.io/en/latest/">
|
|
49
46
|
<img src="https://img.shields.io/readthedocs/yutipy?style=for-the-badge" alt="Documentation Status" />
|
|
50
47
|
</a>
|
|
48
|
+
<a href="https://pypi.org/project/yutipy/">
|
|
49
|
+
<img src="https://img.shields.io/pypi/v/yutipy?style=for-the-badge" alt="PyPI" />
|
|
50
|
+
</a>
|
|
51
51
|
<a href="https://github.com/CheapNightbot/yutipy/blob/master/LICENSE">
|
|
52
52
|
<img src="https://img.shields.io/github/license/CheapNightbot/yutipy?style=for-the-badge" alt="License" />
|
|
53
53
|
</a>
|
|
@@ -20,7 +20,7 @@ def kkbox():
|
|
|
20
20
|
client_id="test_client_id", client_secret="test_client_secret", defer_load=True
|
|
21
21
|
)
|
|
22
22
|
|
|
23
|
-
kkbox_instance.
|
|
23
|
+
kkbox_instance._get_access_token = mock_get_access_token
|
|
24
24
|
kkbox_instance.load_token_after_init()
|
|
25
25
|
return kkbox_instance
|
|
26
26
|
|
|
@@ -62,7 +62,7 @@ def mock_response(kkbox, monkeypatch):
|
|
|
62
62
|
def mock_get(*args, **kwargs):
|
|
63
63
|
return MockResponse()
|
|
64
64
|
|
|
65
|
-
monkeypatch.setattr(kkbox.
|
|
65
|
+
monkeypatch.setattr(kkbox._session, "get", mock_get)
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
def test_search(kkbox, mock_response):
|
|
@@ -15,10 +15,12 @@ def spotify():
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
spotify_instance = Spotify(
|
|
18
|
-
client_id="test_client_id",
|
|
18
|
+
client_id="test_client_id",
|
|
19
|
+
client_secret="test_client_secret",
|
|
20
|
+
defer_load=True
|
|
19
21
|
)
|
|
20
22
|
|
|
21
|
-
spotify_instance.
|
|
23
|
+
spotify_instance._get_access_token = mock_get_access_token
|
|
22
24
|
spotify_instance.load_token_after_init()
|
|
23
25
|
return spotify_instance
|
|
24
26
|
|
|
@@ -38,9 +40,11 @@ def spotify_auth():
|
|
|
38
40
|
client_secret="test_client_secret",
|
|
39
41
|
redirect_uri="http://localhost/callback",
|
|
40
42
|
scopes=["user-read-email", "user-read-private"],
|
|
43
|
+
defer_load=True
|
|
41
44
|
)
|
|
42
45
|
|
|
43
|
-
spotify_instance.
|
|
46
|
+
spotify_instance._get_access_token = mock_get_access_token
|
|
47
|
+
spotify_instance.load_token_after_init()
|
|
44
48
|
return spotify_instance
|
|
45
49
|
|
|
46
50
|
|
|
@@ -111,7 +115,7 @@ def mock_response(spotify, monkeypatch):
|
|
|
111
115
|
def mock_get(*args, **kwargs):
|
|
112
116
|
return MockResponse()
|
|
113
117
|
|
|
114
|
-
monkeypatch.setattr(spotify.
|
|
118
|
+
monkeypatch.setattr(spotify._session, "get", mock_get)
|
|
115
119
|
|
|
116
120
|
|
|
117
121
|
def test_search(spotify, mock_response):
|
|
@@ -168,16 +172,13 @@ def test_get_authorization_url(spotify_auth):
|
|
|
168
172
|
|
|
169
173
|
def test_callback_handler(spotify_auth, monkeypatch):
|
|
170
174
|
spotify_auth.callback_handler("test_code", "test_state", "test_state")
|
|
171
|
-
assert spotify_auth.
|
|
172
|
-
assert spotify_auth.
|
|
173
|
-
assert spotify_auth.
|
|
174
|
-
assert spotify_auth.
|
|
175
|
+
assert spotify_auth._access_token == "test_access_token"
|
|
176
|
+
assert spotify_auth._refresh_token == "test_refresh_token"
|
|
177
|
+
assert spotify_auth._token_expires_in == 3600
|
|
178
|
+
assert spotify_auth._token_requested_at == 1234567890
|
|
175
179
|
|
|
176
180
|
|
|
177
181
|
def test_get_currently_playing(spotify_auth, monkeypatch):
|
|
178
|
-
def mock_authorization_header():
|
|
179
|
-
return {"Authorization": "Bearer test_token"}
|
|
180
|
-
|
|
181
182
|
def mock_get(*args, **kwargs):
|
|
182
183
|
class MockResponse(BaseResponse):
|
|
183
184
|
@staticmethod
|
|
@@ -214,10 +215,7 @@ def test_get_currently_playing(spotify_auth, monkeypatch):
|
|
|
214
215
|
|
|
215
216
|
return MockResponse()
|
|
216
217
|
|
|
217
|
-
monkeypatch.setattr(
|
|
218
|
-
spotify_auth, "_SpotifyAuth__authorization_header", mock_authorization_header
|
|
219
|
-
)
|
|
220
|
-
monkeypatch.setattr(spotify_auth._SpotifyAuth__session, "get", mock_get)
|
|
218
|
+
monkeypatch.setattr(spotify_auth._session, "get", mock_get)
|
|
221
219
|
|
|
222
220
|
currently_playing = spotify_auth.get_currently_playing()
|
|
223
221
|
assert currently_playing is not None
|
|
@@ -228,9 +226,6 @@ def test_get_currently_playing(spotify_auth, monkeypatch):
|
|
|
228
226
|
|
|
229
227
|
|
|
230
228
|
def test_get_user_profile(spotify_auth, monkeypatch):
|
|
231
|
-
def mock_authorization_header():
|
|
232
|
-
return {"Authorization": "Bearer test_token"}
|
|
233
|
-
|
|
234
229
|
def mock_get(*args, **kwargs):
|
|
235
230
|
class MockResponse(BaseResponse):
|
|
236
231
|
@staticmethod
|
|
@@ -248,10 +243,7 @@ def test_get_user_profile(spotify_auth, monkeypatch):
|
|
|
248
243
|
|
|
249
244
|
return MockResponse()
|
|
250
245
|
|
|
251
|
-
monkeypatch.setattr(
|
|
252
|
-
spotify_auth, "_SpotifyAuth__authorization_header", mock_authorization_header
|
|
253
|
-
)
|
|
254
|
-
monkeypatch.setattr(spotify_auth._SpotifyAuth__session, "get", mock_get)
|
|
246
|
+
monkeypatch.setattr(spotify_auth._session, "get", mock_get)
|
|
255
247
|
|
|
256
248
|
user_profile = spotify_auth.get_user_profile()
|
|
257
249
|
assert user_profile is not None
|