0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-30 03:33:02 +00:00

[extractor/common] --write-pages: Correct file name if video_id is None

This commit is contained in:
Philipp Hagemeister 2014-05-15 12:39:33 +02:00
parent ec8deefc27
commit 5afa7f8bee

View file

@ -242,7 +242,7 @@ def _download_webpage_handle(self, url_or_request, video_id, note=None, errnote=
url = url_or_request.get_full_url() url = url_or_request.get_full_url()
except AttributeError: except AttributeError:
url = url_or_request url = url_or_request
basen = video_id + '_' + url basen = '%s_%s' % (video_id, url)
if len(basen) > 240: if len(basen) > 240:
h = u'___' + hashlib.md5(basen.encode('utf-8')).hexdigest() h = u'___' + hashlib.md5(basen.encode('utf-8')).hexdigest()
basen = basen[:240 - len(h)] + h basen = basen[:240 - len(h)] + h