fix #675
This commit is contained in:
parent
fe95f5974e
commit
db732f29b9
2 changed files with 18 additions and 2 deletions
|
|
@ -110,17 +110,26 @@ class TestBrowsing:
|
|||
assert album["tracks"][0]["isExplicit"]
|
||||
assert all(item["views"] is not None for item in album["tracks"])
|
||||
assert all(item["album"] is not None for item in album["tracks"])
|
||||
assert album["likeStatus"] is not None
|
||||
assert album["audioPlaylistId"] is not None
|
||||
assert album["tracks"][0]["trackNumber"] == 1
|
||||
assert "feedbackTokens" in album["tracks"][0]
|
||||
album = yt.get_album("MPREb_BQZvl3BFGay")
|
||||
assert album["audioPlaylistId"] is not None
|
||||
assert len(album["tracks"]) == 7
|
||||
assert len(album["tracks"][0]["artists"]) == 1
|
||||
album = yt.get_album("MPREb_rqH94Zr3NN0")
|
||||
assert album["likeStatus"] is not None
|
||||
assert album["audioPlaylistId"] is not None
|
||||
assert len(album["tracks"][0]["artists"]) == 2
|
||||
album = yt.get_album("MPREb_TPH4WqN5pUo") # album with tracks completely removed/missing
|
||||
assert album["likeStatus"] is not None
|
||||
assert album["audioPlaylistId"] is not None
|
||||
assert album["tracks"][0]["trackNumber"] == 3
|
||||
assert album["tracks"][13]["trackNumber"] == 18
|
||||
album = yt.get_album("MPREb_YuigcYm2erf") # album with track (#8) disabled/greyed out
|
||||
assert album["likeStatus"] is not None
|
||||
assert album["audioPlaylistId"] is not None
|
||||
assert album["tracks"][7]["trackNumber"] is None
|
||||
|
||||
def test_get_album_errors(self, yt):
|
||||
|
|
|
|||
|
|
@ -63,9 +63,16 @@ def parse_album_header_2024(response):
|
|||
# add to library/uploaded
|
||||
buttons = header["buttons"]
|
||||
album["audioPlaylistId"] = nav(
|
||||
buttons, [1, "musicPlayButtonRenderer", "playNavigationEndpoint", *WATCH_PLAYLIST_ID], True
|
||||
find_object_by_key(buttons, "musicPlayButtonRenderer"),
|
||||
["musicPlayButtonRenderer", "playNavigationEndpoint", *WATCH_PLAYLIST_ID],
|
||||
True,
|
||||
)
|
||||
service = nav(buttons, [0, "toggleButtonRenderer", "defaultServiceEndpoint"], True)
|
||||
service = nav(
|
||||
find_object_by_key(buttons, "toggleButtonRenderer"),
|
||||
["toggleButtonRenderer", "defaultServiceEndpoint"],
|
||||
True,
|
||||
)
|
||||
album["likeStatus"] = "INDIFFERENT"
|
||||
if service:
|
||||
album["likeStatus"] = parse_like_status(service)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue