fix(extractors): skip lockupViewModel items missing collectionThumbnailViewModel

YouTube changed the thumbnail structure for some collection/playlist items.
Use dig? and return nil to skip unparseable items instead of crashing.
This commit is contained in:
Richard Lora 2026-05-24 01:03:32 +00:00
parent 5ad8fcfc4d
commit 2782facc94

View File

@ -650,11 +650,13 @@ private module Parsers
private def parse_internal(item_contents, author_fallback)
playlist_id = item_contents["contentId"].as_s
thumbnail_view_model = item_contents.dig(
thumbnail_view_model = item_contents.dig?(
"contentImage", "collectionThumbnailViewModel",
"primaryThumbnail", "thumbnailViewModel"
)
return nil if thumbnail_view_model.nil?
thumbnail = thumbnail_view_model.dig("image", "sources", 0, "url").as_s
# This complicated sequences tries to extract the following data structure: