From 612faed85654d1a20e6959ca9e0ce2fc34d38790 Mon Sep 17 00:00:00 2001 From: Christoph Heinrich Date: Tue, 24 Oct 2023 01:13:28 +0200 Subject: [PATCH] ytdl_hook: reverse thumbnail order ytdl lists thumbnails in ascending order according to height/preference. all_formats=yes adds formats from best to worst, so the same should also be done for thumbnails. --- player/lua/ytdl_hook.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index dd90fc24e4..33a17b0ed1 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -761,7 +761,8 @@ local function add_single_video(json) local thumb_height = -1 local thumb_preference = nil - for _, thumb_info in ipairs(json.thumbnails) do + for i = #json.thumbnails, 1, -1 do + local thumb_info = json.thumbnails[i] if not (thumb_info.url == nil) then if (o.thumbnails == 'all') then msg.verbose("adding thumbnail")