This commit is contained in:
sigma67 2024-08-24 17:59:39 +02:00 • committed by sigma67
commit ac7cd6be68

View file

@ -121,8 +121,11 @@ def get_library_contents(response, renderer):
""" """
section = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST, True) section = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST, True)
contents = None contents = None
if section is None: # empty library if section is None: # empty library or uploads
contents = nav(response, SINGLE_COLUMN + TAB_2_CONTENT + SECTION_LIST_ITEM + renderer, True) # covers the case of non-premium subscribers - no downloads tab
num_tabs = len(nav(response, [*SINGLE_COLUMN, "tabs"]))
LIBRARY_TAB = TAB_1_CONTENT if num_tabs < 3 else TAB_2_CONTENT
contents = nav(response, SINGLE_COLUMN + LIBRARY_TAB + SECTION_LIST_ITEM + renderer, True)
else: else:
results = find_object_by_key(section, "itemSectionRenderer") results = find_object_by_key(section, "itemSectionRenderer")
if results is None: if results is None: