From a9b9c49c55a4a7c97c1d80ebb561ef0d42eeae6c Mon Sep 17 00:00:00 2001 From: RadoslavL Date: Mon, 21 Sep 2026 05:25:12 +0300 Subject: [PATCH] Switching to a safer 'dig?' with an alternative code path in case 'metadataRows' is missing from the input data --- src/invidious/yt_backend/extractors.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/yt_backend/extractors.cr b/src/invidious/yt_backend/extractors.cr index 82c5cce51..bf1dc152c 100644 --- a/src/invidious/yt_backend/extractors.cr +++ b/src/invidious/yt_backend/extractors.cr @@ -662,7 +662,7 @@ private module Parsers metadata = item_contents.dig("metadata", "lockupMetadataViewModel") title = metadata.dig("title", "content").as_s # Contains the views of the video and the published time of the video. - metadata_rows = metadata.dig("metadata", "contentMetadataViewModel", "metadataRows").try &.as_a + metadata_rows = metadata.dig?("metadata", "contentMetadataViewModel", "metadataRows").try &.as_a || Array(JSON::Any).new view_count_text : String? = nil published : Time = Time.local