Skip to content

Commit

Permalink
[extractor/common] Use final URL when dumping request (closes #14769)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Nov 18, 2017
1 parent 38db52a commit f610dbb
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions youtube_dl/extractor/common.py
Expand Up @@ -592,19 +592,11 @@ def _webpage_read_content(self, urlh, url_or_request, video_id, note=None, errno
if not encoding:
encoding = self._guess_encoding_from_content(content_type, webpage_bytes)
if self._downloader.params.get('dump_intermediate_pages', False):
try:
url = url_or_request.get_full_url()
except AttributeError:
url = url_or_request
self.to_screen('Dumping request to ' + url)
self.to_screen('Dumping request to ' + urlh.geturl())
dump = base64.b64encode(webpage_bytes).decode('ascii')
self._downloader.to_screen(dump)
if self._downloader.params.get('write_pages', False):
try:
url = url_or_request.get_full_url()
except AttributeError:
url = url_or_request
basen = '%s_%s' % (video_id, url)
basen = '%s_%s' % (video_id, urlh.geturl())
if len(basen) > 240:
h = '___' + hashlib.md5(basen.encode('utf-8')).hexdigest()
basen = basen[:240 - len(h)] + h
Expand Down

0 comments on commit f610dbb

Please sign in to comment.