diff options
| author | Omar Roth <omarroth@protonmail.com> | 2020-06-16 17:51:49 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2020-06-16 17:51:49 -0500 |
| commit | 38c7dda00ffcc9818f48122a7c64aec93099e0a1 (patch) | |
| tree | 377bb96707a19b5cae5ae5cee7b5e9c780575a1c | |
| parent | 056e7432bd976f375b3f79254f8fafbe21748706 (diff) | |
| download | invidious-38c7dda00ffcc9818f48122a7c64aec93099e0a1.tar.gz invidious-38c7dda00ffcc9818f48122a7c64aec93099e0a1.tar.bz2 invidious-38c7dda00ffcc9818f48122a7c64aec93099e0a1.zip | |
Fix genreUrl
| -rw-r--r-- | src/invidious/videos.cr | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index f2638f14..277c81f4 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"]? |
