if case for sectionListRenderer

This commit is contained in:
Emilien Devos 2022-08-06 18:41:59 +02:00
parent 0c64a86ebe
commit 246955b68a

View File

@ -435,7 +435,8 @@ private module Extractors
raw_items = [] of JSON::Any
content = extract_selected_tab(target["tabs"])["content"]
content["sectionListRenderer"]["contents"].as_a.each do |renderer_container|
if section_list_contents = content.dig?("sectionListRenderer", "contents")
section_list_contents.as_a.each do |renderer_container|
renderer_container_contents = renderer_container["itemSectionRenderer"]["contents"][0]
# Category extraction
@ -451,6 +452,7 @@ private module Extractors
raw_items << item
end
end
end
return raw_items
end