diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2021-11-28 23:44:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-28 23:44:37 +0100 |
| commit | 4436359d0783ca8444467603a820c02372be7e9f (patch) | |
| tree | 76983deecbe2bb40a460aadeba3a91b9164ba737 /src | |
| parent | 91f83952223a6a3b25268955b3fca6c6cf562fac (diff) | |
| download | invidious-4436359d0783ca8444467603a820c02372be7e9f.tar.gz invidious-4436359d0783ca8444467603a820c02372be7e9f.tar.bz2 invidious-4436359d0783ca8444467603a820c02372be7e9f.zip | |
Use dig to get category contents
Co-authored-by: Matthew McGarvey <matthewmcgarvey14@gmail.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/videos.cr | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index c9f6626a..db94110b 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -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"]? |
