aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/options.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-02-04 18:49:58 +0700
committerSergey M <dstftw@gmail.com>2017-02-19 05:10:08 +0800
commit773f291dcbce486fefe24e1abd29735d374d0a9e (patch)
tree0485bd4536891278d6928c66dc59cfda21664ee1 /youtube_dl/options.py
parentbf5b9d859a1f2a68fda0dc57eb839448c7571dfa (diff)
downloadyoutube-dl-773f291dcbce486fefe24e1abd29735d374d0a9e.tar.xz
Add experimental geo restriction bypass mechanism
Based on faking X-Forwarded-For HTTP header
Diffstat (limited to 'youtube_dl/options.py')
-rw-r--r--youtube_dl/options.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/youtube_dl/options.py b/youtube_dl/options.py
index deff54324..2e194f6dc 100644
--- a/youtube_dl/options.py
+++ b/youtube_dl/options.py
@@ -549,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(