prevent KeyError when parsing missing author data (#788)
`get_album` no longer errors on albums with no artist metadata, instead returning `"artist": None` Co-authored-by: sigma67 <sigma67.github@gmail.com>
This commit is contained in:
parent
ccd281ce29
commit
39a480eace
3 changed files with 14 additions and 5 deletions
|
|
@ -135,6 +135,12 @@ class TestBrowsing:
|
|||
with pytest.raises(Exception, match="Invalid album browseId"):
|
||||
yt.get_album("asdf")
|
||||
|
||||
def test_get_album_without_artist(self, yt):
|
||||
album = yt.get_album("MPREb_n1AxZ9F8rF7") # soundtrack album with no artist info
|
||||
assert album["artists"] is None
|
||||
assert album["audioPlaylistId"] is not None
|
||||
assert len(album["tracks"]) == 11
|
||||
|
||||
def test_get_album_other_versions(self, yt):
|
||||
# Eminem - Curtain Call: The Hits (Explicit Variant)
|
||||
album = yt.get_album("MPREb_LQCAymzbaKJ")
|
||||
|
|
|
|||
Loading…
Reference in a new issue