get_playlist/get_episodes_playlist: fix metadata (#809)
- `get_playlist` (non-audio) returns `author`
- `get_episodes_playlist` parses `description` and no longer returns
`year` as the author name:
```diff
- "description": null,
- "author": {
- "name": "2025",
- "id": null
- },
+ "author": {
+ "name": "Authed User",
+ "id": "..."
+ },
+ "description": "The newest episodes from all your saved podcasts",
+ "year": "2025",
```
- `get_artist_albums` and `get_playlist` (non-audio) no longer return
`"artists": []`
This commit is contained in:
parent
a8e2041de8
commit
e9096bf339
6 changed files with 37 additions and 11 deletions
|
|
@ -56,6 +56,7 @@ class TestBrowsing:
|
|||
def test_get_artist_albums(self, yt):
|
||||
artist = yt.get_artist("UCAeLFBCQS7FvI8PvBrWvSBg")
|
||||
results = yt.get_artist_albums(artist["albums"]["browseId"], artist["albums"]["params"])
|
||||
assert all("artists" not in result for result in results) # artist info is omitted from the results
|
||||
assert len(results) == 100
|
||||
results = yt.get_artist_albums(artist["singles"]["browseId"], artist["singles"]["params"])
|
||||
assert len(results) == 100
|
||||
|
|
|
|||
|
|
@ -80,6 +80,13 @@ class TestPlaylists:
|
|||
assert playlist["trackCount"] is None # playlist has no trackCount
|
||||
assert len(playlist["tracks"]) >= 100
|
||||
|
||||
def test_get_playlist_author(self, yt):
|
||||
playlist = yt.get_playlist("PL9tY0BWXOZFu4vlBOzIOmvT6wjYb2jNiV")
|
||||
assert "artists" not in playlist # shouldn't return the "artists" key from parse_song_runs
|
||||
assert playlist["author"] == {"name": "Vevo", "id": "UC2pmfLm7iq6Ov1UwYrWYkZA"}
|
||||
playlist = yt.get_playlist("RDCLAK5uy_l2pHac-aawJYLcesgTf67gaKU-B9ekk1o")
|
||||
assert playlist["author"] == {"name": "YouTube Music", "id": None}
|
||||
|
||||
@pytest.mark.parametrize("language", SUPPORTED_LANGUAGES)
|
||||
def test_get_playlist_languages(self, language):
|
||||
yt = YTMusic(language=language)
|
||||
|
|
|
|||
|
|
@ -49,3 +49,6 @@ class TestPodcasts:
|
|||
def test_get_episodes_playlist(self, yt_brand):
|
||||
playlist = yt_brand.get_episodes_playlist()
|
||||
assert len(playlist["episodes"]) > 90
|
||||
assert playlist["description"]
|
||||
assert playlist["year"]
|
||||
assert playlist["author"]["id"] and playlist["author"]["name"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue