[options] Add -4 and -6 options
authorPhilipp Hagemeister <phihag@phihag.de>
Sat, 10 Jan 2015 19:02:02 +0000 (20:02 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Sat, 10 Jan 2015 19:02:02 +0000 (20:02 +0100)
Fixes #520, fixes #3626.

youtube_dl/options.py

index 31351d43dfc23ff72cb340efc964616b68a3b1a6..e25466c39ccaff692668ab04f7e6509351225037 100644 (file)
@@ -179,6 +179,16 @@ def parseOpts(overrideArguments=None):
         metavar='IP', dest='source_address', default=None,
         help='Client-side IP address to bind to (experimental)',
     )
+    network.add_option(
+        '-4', '--force-ipv4',
+        action='store_const', const='0.0.0.0', dest='source_address',
+        help='Make all connections via IPv4 (experimental)',
+    )
+    network.add_option(
+        '-6', '--force-ipv6',
+        action='store_const', const='::', dest='source_address',
+        help='Make all connections via IPv6 (experimental)',
+    )
 
     selection = optparse.OptionGroup(parser, 'Video Selection')
     selection.add_option(