aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/postprocessor/embedthumbnail.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-05-29 01:39:07 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-05-29 02:31:14 +0530
commit337e0c62f894722e9c268b14d02a85b84c96024d (patch)
tree6a46a51907f04d56658595dee93160efa2b10d17 /yt_dlp/postprocessor/embedthumbnail.py
parent885cc0b75c3ef3ef46fa476746bd34381fd9446d (diff)
downloadhypervideo-pre-337e0c62f894722e9c268b14d02a85b84c96024d.tar.lz
hypervideo-pre-337e0c62f894722e9c268b14d02a85b84c96024d.tar.xz
hypervideo-pre-337e0c62f894722e9c268b14d02a85b84c96024d.zip
[embedthumbnail] Correctly escape filename
Closes #352 The approach in [1] is faulty as can be seen in the test cases 1. https://github.com/ytdl-org/youtube-dl/commit/bff857a8af696e701482208617bf0b7564951326
Diffstat (limited to 'yt_dlp/postprocessor/embedthumbnail.py')
-rw-r--r--yt_dlp/postprocessor/embedthumbnail.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/yt_dlp/postprocessor/embedthumbnail.py b/yt_dlp/postprocessor/embedthumbnail.py
index f3eb7d96d..278a45eb6 100644
--- a/yt_dlp/postprocessor/embedthumbnail.py
+++ b/yt_dlp/postprocessor/embedthumbnail.py
@@ -70,7 +70,7 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
self.to_screen('There aren\'t any thumbnails to embed')
return [], info
- idx = next((-(i+1) for i, t in enumerate(info['thumbnails'][::-1]) if t.get('filepath')), None)
+ idx = next((-i for i, t in enumerate(info['thumbnails'][::-1], 1) if t.get('filepath')), None)
if idx is None:
self.to_screen('There are no thumbnails on disk')
return [], info