From 7002a316fd29c68e05fe28dbf359f5612351ba69 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 12 Sep 2019 13:06:10 -0400 Subject: [PATCH] Filter movies from recommended videos --- src/invidious/videos.cr | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 3cda835b..40bcc513 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -935,6 +935,9 @@ def extract_recommended(recommended_videos) recommended_video = HTTP::Params.new recommended_video["id"] = video_renderer["videoId"].as_s recommended_video["title"] = video_renderer["title"]["simpleText"].as_s + + next if !video_renderer["shortBylineText"]? + recommended_video["author"] = video_renderer["shortBylineText"]["runs"].as_a[0]["text"].as_s recommended_video["ucid"] = video_renderer["shortBylineText"]["runs"].as_a[0]["navigationEndpoint"]["browseEndpoint"]["browseId"].as_s recommended_video["author_thumbnail"] = video_renderer["channelThumbnail"]["thumbnails"][0]["url"].as_s