aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-04-11 06:03:02 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-04-11 06:06:13 +0530
commit1988fab7e3153d3614b28cab904edf3899183e06 (patch)
treec927e7cca788d8ede1662d648a7a79c0e68f4509 /yt_dlp
parent9de3ea31269c396dabf5b26f92fa65bc99038ede (diff)
downloadhypervideo-pre-1988fab7e3153d3614b28cab904edf3899183e06.tar.lz
hypervideo-pre-1988fab7e3153d3614b28cab904edf3899183e06.tar.xz
hypervideo-pre-1988fab7e3153d3614b28cab904edf3899183e06.zip
[youtube] Fix thumbnail URL
Closes: https://github.com/yt-dlp/yt-dlp/issues/233 https://github.com/ytdl-org/youtube-dl/issues/28023
Diffstat (limited to 'yt_dlp')
-rw-r--r--yt_dlp/extractor/youtube.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index 1130d10fa..168103377 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -2057,6 +2057,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
thumbnail_url = thumbnail.get('url')
if not thumbnail_url:
continue
+ # Sometimes youtube gives a wrong thumbnail URL. See:
+ # https://github.com/yt-dlp/yt-dlp/issues/233
+ # https://github.com/ytdl-org/youtube-dl/issues/28023
+ if 'maxresdefault' in thumbnail_url:
+ thumbnail_url = thumbnail_url.split('?')[0]
thumbnails.append({
'height': int_or_none(thumbnail.get('height')),
'url': thumbnail_url,