1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-25 17:27:36 +00:00

YoutubeDL: Use its urlopen method for downloading the thumbnail.

This commit is contained in:
Jaime Marquínez Ferrándiz 2014-03-07 16:43:34 +01:00
parent 22ff5d2105
commit e9c092f125

View file

@ -918,7 +918,7 @@ class YoutubeDL(object):
self.to_screen('[%s] %s: Downloading thumbnail ...' % self.to_screen('[%s] %s: Downloading thumbnail ...' %
(info_dict['extractor'], info_dict['id'])) (info_dict['extractor'], info_dict['id']))
try: try:
uf = compat_urllib_request.urlopen(info_dict['thumbnail']) uf = self.urlopen(info_dict['thumbnail'])
with open(thumb_filename, 'wb') as thumbf: with open(thumb_filename, 'wb') as thumbf:
shutil.copyfileobj(uf, thumbf) shutil.copyfileobj(uf, thumbf)
self.to_screen('[%s] %s: Writing thumbnail to: %s' % self.to_screen('[%s] %s: Writing thumbnail to: %s' %