From 38c7dda00ffcc9818f48122a7c64aec93099e0a1 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Tue, 16 Jun 2020 17:51:49 -0500 Subject: [PATCH] Fix genreUrl --- src/invidious/videos.cr | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index f2638f142..277c81f48 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -721,8 +721,8 @@ struct Video info["genre"]?.try &.as_s || "" end - def genre_url : String - info["genreUcid"]? ? "/channel/#{info["genreUcid"]}" : "" + def genre_url : String? + info["genreUcid"]? ? "/channel/#{info["genreUcid"]}" : nil end def license : String? @@ -861,6 +861,9 @@ def extract_polymer_config(body) .try &.["rows"]? .try &.as_a + params["genre"] = params["microformat"]?.try &.["playerMicroformatRenderer"]?.try &.["category"]? || JSON::Any.new("") + params["genreUrl"] = JSON::Any.new(nil) + metadata.try &.each do |row| title = row["metadataRowRenderer"]?.try &.["title"]?.try &.["simpleText"]?.try &.as_s contents = row["metadataRowRenderer"]?