1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-27 13:06:49 +01:00

[extractor/common] Use final URL when dumping request (closes #14769)

This commit is contained in:
Sergey M․ 2017-11-18 19:02:56 +07:00
parent 38db52adf3
commit f610dbb05f
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -592,19 +592,11 @@ class InfoExtractor(object):
if not encoding: if not encoding:
encoding = self._guess_encoding_from_content(content_type, webpage_bytes) encoding = self._guess_encoding_from_content(content_type, webpage_bytes)
if self._downloader.params.get('dump_intermediate_pages', False): if self._downloader.params.get('dump_intermediate_pages', False):
try: self.to_screen('Dumping request to ' + urlh.geturl())
url = url_or_request.get_full_url()
except AttributeError:
url = url_or_request
self.to_screen('Dumping request to ' + url)
dump = base64.b64encode(webpage_bytes).decode('ascii') dump = base64.b64encode(webpage_bytes).decode('ascii')
self._downloader.to_screen(dump) self._downloader.to_screen(dump)
if self._downloader.params.get('write_pages', False): if self._downloader.params.get('write_pages', False):
try: basen = '%s_%s' % (video_id, urlh.geturl())
url = url_or_request.get_full_url()
except AttributeError:
url = url_or_request
basen = '%s_%s' % (video_id, url)
if len(basen) > 240: if len(basen) > 240:
h = '___' + hashlib.md5(basen.encode('utf-8')).hexdigest() h = '___' + hashlib.md5(basen.encode('utf-8')).hexdigest()
basen = basen[:240 - len(h)] + h basen = basen[:240 - len(h)] + h