From 3bced4e12b6ecf26e0b3dfdb72aec8cf89197803 Mon Sep 17 00:00:00 2001 From: RadoslavL Date: Tue, 14 Nov 2023 09:51:12 +0200 Subject: [PATCH] Fixed another issue --- src/invidious/videos/parser.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index f29c81e3..83c97602 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -36,7 +36,7 @@ def parse_related_video(related : JSON::Any, published : String? = nil) : Hash(S LOGGER.trace("parse_related_video: Found \"watchNextEndScreenRenderer\" container") - publishedText = related["publishedTimeText"]["simpleText"].to_s + publishedText = related["publishedTimeText"]? # TODO: when refactoring video types, make a struct for related videos # or reuse an existing type, if that fits. @@ -50,7 +50,7 @@ def parse_related_video(related : JSON::Any, published : String? = nil) : Hash(S "short_view_count" => JSON::Any.new(short_view_count || "0"), "author_verified" => JSON::Any.new(author_verified), "published" => JSON::Any.new(published || ""), - "publishedText" => JSON::Any.new(publishedText || ""), + "publishedText" => JSON::Any.new(publishedText["simpleText"]?.to_s || ""), } end