diff options
author | Christoph Heinrich <christoph.heinrich@student.tugraz.at> | 2023-10-24 01:13:28 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-30 16:46:17 +0000 |
commit | 612faed85654d1a20e6959ca9e0ce2fc34d38790 (patch) | |
tree | d49edfe88d9f30bb7f5bb3d10238f08a96d3dd81 /player/lua/ytdl_hook.lua | |
parent | 21609953cc9ec839222dfa1568575ce21d99b76a (diff) | |
download | mpv-612faed85654d1a20e6959ca9e0ce2fc34d38790.tar.bz2 mpv-612faed85654d1a20e6959ca9e0ce2fc34d38790.tar.xz |
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.
Diffstat (limited to 'player/lua/ytdl_hook.lua')
-rw-r--r-- | player/lua/ytdl_hook.lua | 3 |
1 files changed, 2 insertions, 1 deletions
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") |