diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-04-11 18:31:35 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-04-11 18:31:35 +0200 |
commit | 855703e55e46f3e070d9837a2eda1e6eb8a27301 (patch) | |
tree | fd718c35953b659c9d485b046991f96196ed362e /youtube_dl/InfoExtractors.py | |
parent | 927c8c49246bb7ae98596b3cf518425d46f39100 (diff) | |
download | youtube-dl-855703e55e46f3e070d9837a2eda1e6eb8a27301.tar.xz |
Option to dump intermediate pages
Diffstat (limited to 'youtube_dl/InfoExtractors.py')
-rwxr-xr-x | youtube_dl/InfoExtractors.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index c1c206a8a..94e4451ed 100755 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -134,6 +134,14 @@ class InfoExtractor(object): else: encoding = 'utf-8' 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') |