get_history: raise exception if watch history is disabled

This commit is contained in:
sigma67 2021-12-20 10:56:50 +01:00
commit 3043116d69
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0

View file

@ -199,7 +199,10 @@ class LibraryMixin:
results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST)
songs = []
for content in results:
data = content['musicShelfRenderer']['contents']
data = nav(content, MUSIC_SHELF + ['contents'], True)
if not data:
error = nav(content, ['musicNotifierShelfRenderer'] + TITLE, True)
raise Exception(error)
menu_entries = [[-1] + MENU_SERVICE + FEEDBACK_TOKEN]
songlist = parse_playlist_items(data, menu_entries)
for song in songlist: