aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-02-04 21:06:07 +0700
committerSergey M <dstftw@gmail.com>2017-02-19 05:10:08 +0800
commit0016b84e16965a07c52946c4672363153e8b18a2 (patch)
tree8879bee8b1c97b7db653d6f44e9e4f3be3d4f7a7 /youtube_dl/extractor
parent18a0defab063523cd76a30be2dd5a80e9f9172d6 (diff)
Add faked X-Forwarded-For to formats' HTTP headers
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 96815099d..c1f7f28a0 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -384,7 +384,10 @@ class InfoExtractor(object):
for _ in range(2):
try:
self.initialize()
- return self._real_extract(url)
+ ie_result = self._real_extract(url)
+ if self._x_forwarded_for_ip:
+ ie_result['__x_forwarded_for_ip'] = self._x_forwarded_for_ip
+ return ie_result
except GeoRestrictedError as e:
if (not self._downloader.params.get('bypass_geo_restriction_as_country', None) and
self._BYPASS_GEO and