Add experimental geo restriction bypass mechanism
[youtube-dl] / youtube_dl / options.py
index 2fea99ff2b2150b82b46dec39e8405bef3fae56b..2e194f6dc22ac2073fad39782296b65a11e0017f 100644 (file)
@@ -302,8 +302,10 @@ def parseOpts(overrideArguments=None):
             'match if the key is present, '
             '!key to check if the key is not present, '
             'key > NUMBER (like "comment_count > 12", also works with '
-            '>=, <, <=, !=, =) to compare against a number, and '
-            '& to require multiple matches. '
+            '>=, <, <=, !=, =) to compare against a number, '
+            'key = \'LITERAL\' (like "uploader = \'Mike Smith\'", also works with !=) '
+            'to match against a string literal '
+            'and & to require multiple matches. '
             'Values which are not known are excluded unless you '
             'put a question mark (?) after the operator. '
             'For example, to only match videos that have been liked more than '
@@ -547,6 +549,18 @@ def parseOpts(overrideArguments=None):
             'Upper bound of a range for randomized sleep before each download '
             '(maximum possible number of seconds to sleep). Must only be used '
             'along with --min-sleep-interval.'))
+    workarounds.add_option(
+        '--bypass-geo',
+        action='store_true', dest='bypass_geo_restriction', default=True,
+        help='Bypass geographic restriction via faking X-Forwarded-For HTTP header (experimental)')
+    workarounds.add_option(
+        '--no-bypass-geo',
+        action='store_false', dest='bypass_geo_restriction', default=True,
+        help='Do not bypass geographic restriction via faking X-Forwarded-For HTTP header (experimental)')
+    workarounds.add_option(
+        '--bypass-geo-as-country', metavar='CODE',
+        dest='bypass_geo_restriction_as_country', default=None,
+        help='Force bypass geographic restriction with explicitly provided two-letter ISO 3166-2 country code (experimental)')
 
     verbosity = optparse.OptionGroup(parser, 'Verbosity / Simulation Options')
     verbosity.add_option(