summaryrefslogtreecommitdiffstats
path: root/gallery_dl/option.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/option.py')
-rw-r--r--gallery_dl/option.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/gallery_dl/option.py b/gallery_dl/option.py
index b38ad74..a3f78e5 100644
--- a/gallery_dl/option.py
+++ b/gallery_dl/option.py
@@ -461,6 +461,17 @@ def build_parser():
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,
help="Disable HTTPS certificate validation",
@@ -792,4 +803,10 @@ def build_parser():
"&& convert * ../doc.pdf\""),
)
+ try:
+ # restore normal behavior when adding '-4' or '-6' as arguments
+ parser._has_negative_number_optionals.clear()
+ except Exception:
+ pass
+
return parser