summaryrefslogtreecommitdiffhomepage
path: root/youtube_dl/YoutubeDL.py
diff options
context:
space:
mode:
authorremitamine <[email protected]>2016-03-10 20:17:35 +0100
committerremitamine <[email protected]>2016-03-13 12:41:15 +0100
commitb7b72db9ad248e16a7e26489fee93e52b70948d7 (patch)
tree4d76f8c36fc742d4578dbfd0ddb77835fb137108 /youtube_dl/YoutubeDL.py
parentf6f6217a98adc07c41f7a45a9068aeaf706ad862 (diff)
downloadyoutube-dl-b7b72db9ad248e16a7e26489fee93e52b70948d7.tar.gz
youtube-dl-b7b72db9ad248e16a7e26489fee93e52b70948d7.zip
[YoutubeDL] check for --list-thumbnails immediately after processing them
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rwxr-xr-xyoutube_dl/YoutubeDL.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index b3391088f..8c651cd52 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -1234,6 +1234,10 @@ class YoutubeDL(object):
if t.get('id') is None:
t['id'] = '%d' % i
+ if self.params.get('list_thumbnails'):
+ self.list_thumbnails(info_dict)
+ return
+
if thumbnails and 'thumbnail' not in info_dict:
info_dict['thumbnail'] = thumbnails[-1]['url']
@@ -1335,9 +1339,6 @@ class YoutubeDL(object):
if self.params.get('listformats'):
self.list_formats(info_dict)
return
- if self.params.get('list_thumbnails'):
- self.list_thumbnails(info_dict)
- return
req_format = self.params.get('format')
if req_format is None:
@@ -1901,13 +1902,8 @@ class YoutubeDL(object):
def list_thumbnails(self, info_dict):
thumbnails = info_dict.get('thumbnails')
if not thumbnails:
- tn_url = info_dict.get('thumbnail')
- if tn_url:
- thumbnails = [{'id': '0', 'url': tn_url}]
- else:
- self.to_screen(
- '[info] No thumbnails present for %s' % info_dict['id'])
- return
+ self.to_screen('[info] No thumbnails present for %s' % info_dict['id'])
+ return
self.to_screen(
'[info] Thumbnails for %s:' % info_dict['id'])