diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-07-12 21:52:59 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-07-12 22:08:49 +0200 |
commit | cbdbb7666540ba07ab7e4a3a7bc34759bf0ca6d9 (patch) | |
tree | 10fbbf7c9f35f2d1975c8b8dc44f3954646bbf17 /youtube_dl/YoutubeDL.py | |
parent | 6543f0dca5e04530450fac5a64efa5d9ee294b1b (diff) |
Use determine_ext when saving the thumbnail
Urls that contain a query produced filenames with wrong extensions
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rw-r--r-- | youtube_dl/YoutubeDL.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index e24706115..cc5f76157 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -530,9 +530,7 @@ class YoutubeDL(object): if self.params.get('writethumbnail', False): if 'thumbnail' in info_dict: - thumb_format = info_dict['thumbnail'].rpartition(u'/')[2].rpartition(u'.')[2] - if not thumb_format: - thumb_format = 'jpg' + thumb_format = determine_ext(info_dict['thumbnail'], u'jpg') thumb_filename = filename.rpartition('.')[0] + u'.' + thumb_format self.to_screen(u'[%s] %s: Downloading thumbnail ...' % (info_dict['extractor'], info_dict['id'])) |