Skip to content

Commit

Permalink
add '--print-traffic'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jul 5, 2024
1 parent b376fa8 commit b3aded1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gallery_dl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions gallery_dl/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b3aded1

Please sign in to comment.