summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@protonmail.com>2019-09-12 13:06:10 -0400
committerOmar Roth <omarroth@protonmail.com>2019-09-12 13:06:10 -0400
commit7002a316fd29c68e05fe28dbf359f5612351ba69 (patch)
treece0940fd7d39da06ffc8b764926c977f32b13853 /src
parent1f37faad42edb7fd73f3c850f47c4135c7ad9d71 (diff)
downloadinvidious-7002a316fd29c68e05fe28dbf359f5612351ba69.tar.gz
invidious-7002a316fd29c68e05fe28dbf359f5612351ba69.tar.bz2
invidious-7002a316fd29c68e05fe28dbf359f5612351ba69.zip
Filter movies from recommended videos
Diffstat (limited to 'src')
-rw-r--r--src/invidious/videos.cr3
1 files changed, 3 insertions, 0 deletions
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