yutipy 2.2.5__tar.gz → 2.2.7__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.

Files changed (63) hide show
  1. {yutipy-2.2.5 → yutipy-2.2.7}/PKG-INFO +4 -4
  2. {yutipy-2.2.5 → yutipy-2.2.7}/docs/api_reference.rst +0 -6
  3. {yutipy-2.2.5 → yutipy-2.2.7}/tests/test_kkbox.py +2 -2
  4. {yutipy-2.2.5 → yutipy-2.2.7}/tests/test_lastfm.py +2 -1
  5. {yutipy-2.2.5 → yutipy-2.2.7}/tests/test_spotify.py +14 -22
  6. yutipy-2.2.7/yutipy/base_clients.py +582 -0
  7. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/deezer.py +7 -21
  8. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/itunes.py +10 -20
  9. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/kkbox.py +22 -222
  10. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/lastfm.py +6 -4
  11. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/musicyt.py +3 -5
  12. yutipy-2.2.7/yutipy/spotify.py +646 -0
  13. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy.egg-info/PKG-INFO +4 -4
  14. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy.egg-info/SOURCES.txt +1 -0
  15. yutipy-2.2.5/yutipy/spotify.py +0 -1236
  16. {yutipy-2.2.5 → yutipy-2.2.7}/.gitattributes +0 -0
  17. {yutipy-2.2.5 → yutipy-2.2.7}/.github/FUNDING.yml +0 -0
  18. {yutipy-2.2.5 → yutipy-2.2.7}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  19. {yutipy-2.2.5 → yutipy-2.2.7}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  20. {yutipy-2.2.5 → yutipy-2.2.7}/.github/dependabot.yml +0 -0
  21. {yutipy-2.2.5 → yutipy-2.2.7}/.github/workflows/pytest-unit-testing.yml +0 -0
  22. {yutipy-2.2.5 → yutipy-2.2.7}/.github/workflows/release.yml +0 -0
  23. {yutipy-2.2.5 → yutipy-2.2.7}/.gitignore +0 -0
  24. {yutipy-2.2.5 → yutipy-2.2.7}/.readthedocs.yaml +0 -0
  25. {yutipy-2.2.5 → yutipy-2.2.7}/LICENSE +0 -0
  26. {yutipy-2.2.5 → yutipy-2.2.7}/MANIFEST.in +0 -0
  27. {yutipy-2.2.5 → yutipy-2.2.7}/README.md +3 -3
  28. {yutipy-2.2.5 → yutipy-2.2.7}/docs/Makefile +0 -0
  29. {yutipy-2.2.5 → yutipy-2.2.7}/docs/_static/yutipy_header.png +0 -0
  30. {yutipy-2.2.5 → yutipy-2.2.7}/docs/_static/yutipy_logo.png +0 -0
  31. {yutipy-2.2.5 → yutipy-2.2.7}/docs/available_platforms.rst +0 -0
  32. {yutipy-2.2.5 → yutipy-2.2.7}/docs/cli.rst +0 -0
  33. {yutipy-2.2.5 → yutipy-2.2.7}/docs/conf.py +0 -0
  34. {yutipy-2.2.5 → yutipy-2.2.7}/docs/faq.rst +0 -0
  35. {yutipy-2.2.5 → yutipy-2.2.7}/docs/index.rst +0 -0
  36. {yutipy-2.2.5 → yutipy-2.2.7}/docs/installation.rst +0 -0
  37. {yutipy-2.2.5 → yutipy-2.2.7}/docs/make.bat +0 -0
  38. {yutipy-2.2.5 → yutipy-2.2.7}/docs/requirements.txt +0 -0
  39. {yutipy-2.2.5 → yutipy-2.2.7}/docs/usage_examples.rst +0 -0
  40. {yutipy-2.2.5 → yutipy-2.2.7}/pyproject.toml +0 -0
  41. {yutipy-2.2.5 → yutipy-2.2.7}/requirements-dev.txt +0 -0
  42. {yutipy-2.2.5 → yutipy-2.2.7}/requirements.txt +0 -0
  43. {yutipy-2.2.5 → yutipy-2.2.7}/setup.cfg +0 -0
  44. {yutipy-2.2.5 → yutipy-2.2.7}/tests/__init__.py +0 -0
  45. {yutipy-2.2.5 → yutipy-2.2.7}/tests/test_deezer.py +0 -0
  46. {yutipy-2.2.5 → yutipy-2.2.7}/tests/test_itunes.py +0 -0
  47. {yutipy-2.2.5 → yutipy-2.2.7}/tests/test_models.py +0 -0
  48. {yutipy-2.2.5 → yutipy-2.2.7}/tests/test_musicyt.py +0 -0
  49. {yutipy-2.2.5 → yutipy-2.2.7}/tests/test_utils.py +0 -0
  50. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/__init__.py +0 -0
  51. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/cli/__init__.py +0 -0
  52. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/cli/config.py +0 -0
  53. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/cli/search.py +0 -0
  54. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/exceptions.py +0 -0
  55. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/logger.py +0 -0
  56. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/models.py +0 -0
  57. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/utils/__init__.py +0 -0
  58. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/utils/helpers.py +0 -0
  59. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy/yutipy_music.py +0 -0
  60. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy.egg-info/dependency_links.txt +0 -0
  61. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy.egg-info/entry_points.txt +0 -0
  62. {yutipy-2.2.5 → yutipy-2.2.7}/yutipy.egg-info/requires.txt +0 -0
  63. {yutipy-2.2.5 → yutipy-2.2.7}/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.5
3
+ Version: 2.2.7
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>
@@ -132,12 +132,6 @@ Generic Exceptions
132
132
  :noindex:
133
133
  :exclude-members: add_note, args, with_traceback
134
134
 
135
- .. autoclass:: yutipy.exceptions.NetworkException
136
- :members:
137
- :inherited-members:
138
- :noindex:
139
- :exclude-members: add_note, args, with_traceback
140
-
141
135
  Service Exceptions
142
136
  ------------------
143
137
 
@@ -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._KKBox__get_access_token = mock_get_access_token
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._KKBox__session, "get", mock_get)
65
+ monkeypatch.setattr(kkbox._session, "get", mock_get)
66
66
 
67
67
 
68
68
  def test_search(kkbox, mock_response):
@@ -34,6 +34,7 @@ class MockResponseActivity(BaseResponse):
34
34
  "#text": "Test Album",
35
35
  },
36
36
  "name": "Test Track",
37
+ "@attr": {"nowplaying": "true"},
37
38
  "url": "https://www.last.fm/music/test+track",
38
39
  }
39
40
  ]
@@ -88,7 +89,7 @@ def test_get_currently_playing(lastfm, mock_response_activity):
88
89
  assert currently_playing.title == "Test Track"
89
90
  assert currently_playing.album_title == "Test Album"
90
91
  assert "extralarge" in currently_playing.album_art
91
- assert currently_playing.is_playing is False
92
+ assert currently_playing.is_playing is True
92
93
 
93
94
 
94
95
  def test_get_user_profile(lastfm, mock_response_profile):
@@ -15,10 +15,12 @@ def spotify():
15
15
  }
16
16
 
17
17
  spotify_instance = Spotify(
18
- client_id="test_client_id", client_secret="test_client_secret", defer_load=True
18
+ client_id="test_client_id",
19
+ client_secret="test_client_secret",
20
+ defer_load=True
19
21
  )
20
22
 
21
- spotify_instance._Spotify__get_access_token = mock_get_access_token
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._SpotifyAuth__get_access_token = mock_get_access_token
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._Spotify__session, "get", mock_get)
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._SpotifyAuth__access_token == "test_access_token"
172
- assert spotify_auth._SpotifyAuth__refresh_token == "test_refresh_token"
173
- assert spotify_auth._SpotifyAuth__token_expires_in == 3600
174
- assert spotify_auth._SpotifyAuth__token_requested_at == 1234567890
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