mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-04 08:39:49 +01:00
if case for sectionListRenderer
This commit is contained in:
parent
0c64a86ebe
commit
246955b68a
@ -435,20 +435,22 @@ private module Extractors
|
|||||||
raw_items = [] of JSON::Any
|
raw_items = [] of JSON::Any
|
||||||
content = extract_selected_tab(target["tabs"])["content"]
|
content = extract_selected_tab(target["tabs"])["content"]
|
||||||
|
|
||||||
content["sectionListRenderer"]["contents"].as_a.each do |renderer_container|
|
if section_list_contents = content.dig?("sectionListRenderer", "contents")
|
||||||
renderer_container_contents = renderer_container["itemSectionRenderer"]["contents"][0]
|
section_list_contents.as_a.each do |renderer_container|
|
||||||
|
renderer_container_contents = renderer_container["itemSectionRenderer"]["contents"][0]
|
||||||
|
|
||||||
# Category extraction
|
# Category extraction
|
||||||
if items_container = renderer_container_contents["shelfRenderer"]?
|
if items_container = renderer_container_contents["shelfRenderer"]?
|
||||||
raw_items << renderer_container_contents
|
raw_items << renderer_container_contents
|
||||||
next
|
next
|
||||||
elsif items_container = renderer_container_contents["gridRenderer"]?
|
elsif items_container = renderer_container_contents["gridRenderer"]?
|
||||||
else
|
else
|
||||||
items_container = renderer_container_contents
|
items_container = renderer_container_contents
|
||||||
end
|
end
|
||||||
|
|
||||||
items_container["items"]?.try &.as_a.each do |item|
|
items_container["items"]?.try &.as_a.each do |item|
|
||||||
raw_items << item
|
raw_items << item
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user