Add "type" attribute to library channels (#563)
* Add "type" attribute to library channels YTMusic Library Channels list not only channels in the narrow sense but also artists publishing podcasts and episodes (e.g. The Offspring). To distinguish the two types of items, the json code contains a page_type attribute. This PR adds code to read the page_type attribute and, if present, add a "tyoe" item with a value of "channel" or "artist" to the artist dictionary object.
This commit is contained in:
parent
f6932c2bf1
commit
29eaa7a593
1 changed files with 5 additions and 0 deletions
|
|
@ -14,6 +14,11 @@ def parse_artists(results, uploaded=False):
|
|||
artist = {}
|
||||
artist["browseId"] = nav(data, NAVIGATION_BROWSE_ID)
|
||||
artist["artist"] = get_item_text(data, 0)
|
||||
page_type = nav(data, NAVIGATION_BROWSE + PAGE_TYPE, True)
|
||||
if page_type == "MUSIC_PAGE_TYPE_USER_CHANNEL":
|
||||
artist["type"] = "channel"
|
||||
elif page_type == "MUSIC_PAGE_TYPE_ARTIST":
|
||||
artist["type"] = "artist"
|
||||
parse_menu_playlists(data, artist)
|
||||
if uploaded:
|
||||
artist["songs"] = get_item_text(data, 1).split(" ")[0]
|
||||
|
|
|
|||
Loading…
Reference in a new issue