mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Use dig to get category contents
Co-authored-by: Matthew McGarvey <matthewmcgarvey14@gmail.com>
This commit is contained in:
parent
91f8395222
commit
4436359d07
1 changed files with 1 additions and 1 deletions
|
@ -954,7 +954,7 @@ def extract_video_info(video_id : String, proxy_region : String? = nil, context_
|
|||
contents = row.dig?("metadataRowRenderer", "contents", 0)
|
||||
|
||||
if title.try &.== "Category"
|
||||
contents = contents.try &.["runs"]?.try &.as_a[0]?
|
||||
contents = contents.try &.dig?("runs", 0)
|
||||
|
||||
params["genre"] = JSON::Any.new(contents.try &.["text"]?.try &.as_s || "")
|
||||
params["genreUcid"] = JSON::Any.new(contents.try &.["navigationEndpoint"]?.try &.["browseEndpoint"]?
|
||||
|
|
Loading…
Reference in a new issue