diff --git a/docs/options.md b/docs/options.md index ffbe1d1f..2116da63 100644 --- a/docs/options.md +++ b/docs/options.md @@ -71,6 +71,8 @@ --http-timeout SECONDS Timeout for HTTP connections (default: 30.0) --proxy URL Use the specified proxy --source-address IP Client-side IP address to bind to + -4, --force-ipv4 Make all connections via IPv4 + -6, --force-ipv6 Make all connections via IPv6 --no-check-certificate Disable HTTPS certificate validation ## Downloader Options: diff --git a/gallery_dl/option.py b/gallery_dl/option.py index b38ad743..1d94aab9 100644 --- a/gallery_dl/option.py +++ b/gallery_dl/option.py @@ -460,6 +460,17 @@ def build_parser(): dest="source-address", metavar="IP", action=ConfigAction, help="Client-side IP address to bind to", ) + networking.add_argument( + "-4", "--force-ipv4", + dest="source-address", nargs=0, action=ConfigConstAction, + const="0.0.0.0", + help="Make all connections via IPv4", + ) + networking.add_argument( + "-6", "--force-ipv6", + dest="source-address", nargs=0, action=ConfigConstAction, const="::", + help="Make all connections via IPv6", + ) networking.add_argument( "--no-check-certificate", dest="verify", nargs=0, action=ConfigConstAction, const=False,