summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadoslavL <rlelchev@abv.bg>2023-11-14 09:51:12 +0200
committerRadoslavL <rlelchev@abv.bg>2023-11-14 09:51:12 +0200
commit3bced4e12b6ecf26e0b3dfdb72aec8cf89197803 (patch)
treea5e5a034d16ad4872457a4eacd9cca3d916220df
parent0d22af65649a0798531251949ff21954c0780643 (diff)
downloadinvidious-3bced4e12b6ecf26e0b3dfdb72aec8cf89197803.tar.gz
invidious-3bced4e12b6ecf26e0b3dfdb72aec8cf89197803.tar.bz2
invidious-3bced4e12b6ecf26e0b3dfdb72aec8cf89197803.zip
Fixed another issue
-rw-r--r--src/invidious/videos/parser.cr4
1 files 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