diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index ce3d169030..692d828da9 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -1,4 +1,5 @@ import base64 +import hashlib import json import os import re @@ -234,6 +235,9 @@ def _download_webpage_handle(self, url_or_request, video_id, note=None, errnote= url = url_or_request.get_full_url() except AttributeError: url = url_or_request + if len(url) > 200: + h = hashlib.md5(url).hexdigest() + url = url[:200 - len(h)] + h raw_filename = ('%s_%s.dump' % (video_id, url)) filename = sanitize_filename(raw_filename, restricted=True) self.to_screen(u'Saving request to ' + filename)