diff --git a/gallery_dl/__init__.py b/gallery_dl/__init__.py index ad35745d..b4db17d6 100644 --- a/gallery_dl/__init__.py +++ b/gallery_dl/__init__.py @@ -145,6 +145,10 @@ def main(): log.debug("Configuration Files %s", config._files) + if args.print_traffic: + import requests + requests.packages.urllib3.connection.HTTPConnection.debuglevel = 1 + # extractor modules modules = config.get(("extractor",), "modules") if modules is not None: diff --git a/gallery_dl/option.py b/gallery_dl/option.py index f31d5ac7..caafe880 100644 --- a/gallery_dl/option.py +++ b/gallery_dl/option.py @@ -345,6 +345,11 @@ def build_parser(): help=("Write downloaded intermediary pages to files " "in the current directory to debug problems"), ) + output.add_argument( + "--print-traffic", + dest="print_traffic", action="store_true", + help=("Display sent and read HTTP traffic"), + ) output.add_argument( "--no-colors", dest="colors", action="store_false",