From 864f27ef72b084461e327640f80aa45a8f250b0f Mon Sep 17 00:00:00 2001 From: 11tuvork28 Date: Sun, 3 Jul 2022 14:59:33 +0200 Subject: [PATCH] switched to extract_selected_tab for the community tab --- src/invidious/channels/community.cr | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/invidious/channels/community.cr b/src/invidious/channels/community.cr index 4c32ea20..aaed9567 100644 --- a/src/invidious/channels/community.cr +++ b/src/invidious/channels/community.cr @@ -13,13 +13,11 @@ def fetch_channel_community(ucid, continuation, locale, format, thin_mode) if !continuation || continuation.empty? initial_data = extract_initial_data(response.body) - body = initial_data["contents"]?.try &.["twoColumnBrowseResultsRenderer"]["tabs"].as_a.select { |tab| tab["tabRenderer"]?.try &.["selected"]?.try &.as_bool == true }[0]? + body = extract_selected_tab(initial_data["contents"]["twoColumnBrowseResultsRenderer"]["tabs"])["content"]["sectionListRenderer"]["contents"][0]["itemSectionRenderer"] if !body raise InfoException.new("Could not extract community tab.") end - - body = body["tabRenderer"]["content"]["sectionListRenderer"]["contents"][0]["itemSectionRenderer"] else continuation = produce_channel_community_continuation(ucid, continuation)