mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 16:42:57 +01:00
Option to dump intermediate pages
This commit is contained in:
parent
927c8c4924
commit
855703e55e
@ -134,6 +134,14 @@ def _download_webpage(self, url_or_request, video_id, note=None, errnote=None):
|
|||||||
else:
|
else:
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
webpage_bytes = urlh.read()
|
webpage_bytes = urlh.read()
|
||||||
|
if self._downloader.params.get('dump_intermediate_pages', False):
|
||||||
|
try:
|
||||||
|
url = url_or_request.get_full_url()
|
||||||
|
except AttributeError:
|
||||||
|
url = url_or_request
|
||||||
|
self._downloader.to_screen(u'Dumping request to ' + url)
|
||||||
|
dump = base64.b64encode(webpage_bytes).decode('ascii')
|
||||||
|
self._downloader.to_screen(dump)
|
||||||
return webpage_bytes.decode(encoding, 'replace')
|
return webpage_bytes.decode(encoding, 'replace')
|
||||||
|
|
||||||
|
|
||||||
|
@ -224,6 +224,9 @@ def _find_term_columns():
|
|||||||
help='display progress in console titlebar', default=False)
|
help='display progress in console titlebar', default=False)
|
||||||
verbosity.add_option('-v', '--verbose',
|
verbosity.add_option('-v', '--verbose',
|
||||||
action='store_true', dest='verbose', help='print various debugging information', default=False)
|
action='store_true', dest='verbose', help='print various debugging information', default=False)
|
||||||
|
verbosity.add_option('--dump-intermediate-pages',
|
||||||
|
action='store_true', dest='dump_intermediate_pages', default=False,
|
||||||
|
help='print downloaded pages to debug problems(very verbose)')
|
||||||
|
|
||||||
filesystem.add_option('-t', '--title',
|
filesystem.add_option('-t', '--title',
|
||||||
action='store_true', dest='usetitle', help='use title in file name', default=False)
|
action='store_true', dest='usetitle', help='use title in file name', default=False)
|
||||||
@ -485,6 +488,7 @@ def _real_main():
|
|||||||
'max_downloads': opts.max_downloads,
|
'max_downloads': opts.max_downloads,
|
||||||
'prefer_free_formats': opts.prefer_free_formats,
|
'prefer_free_formats': opts.prefer_free_formats,
|
||||||
'verbose': opts.verbose,
|
'verbose': opts.verbose,
|
||||||
|
'dump_intermediate_pages': opts.dump_intermediate_pages,
|
||||||
'test': opts.test,
|
'test': opts.test,
|
||||||
'keepvideo': opts.keepvideo,
|
'keepvideo': opts.keepvideo,
|
||||||
'min_filesize': opts.min_filesize,
|
'min_filesize': opts.min_filesize,
|
||||||
|
Loading…
Reference in New Issue
Block a user