about summary refs log tree commit diff
path: root/youtube_dl/extractor/tvplay.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-05-02 07:18:01 +0700
committerSergey M․ <dstftw@gmail.com>2018-05-02 07:20:59 +0700
commit5f95927a62a533b9e616abb5f1481cedeaa16a4a (patch)
tree13e1cbddf07dd4259211ede5df0d2705604ca5b1 /youtube_dl/extractor/tvplay.py
parenta93ce61bd5cbe7779e4eff0f8ab74a8a02211285 (diff)
downloadyoutube-dl-5f95927a62a533b9e616abb5f1481cedeaa16a4a.tar.gz
youtube-dl-5f95927a62a533b9e616abb5f1481cedeaa16a4a.tar.xz
youtube-dl-5f95927a62a533b9e616abb5f1481cedeaa16a4a.zip
Improve geo bypass mechanism
* Introduce geo bypass context
* Add ability to bypass based on IP blocks in CIDR notation
* Introduce --geo-bypass-ip-block
Diffstat (limited to 'youtube_dl/extractor/tvplay.py')
-rw-r--r--youtube_dl/extractor/tvplay.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/tvplay.py b/youtube_dl/extractor/tvplay.py
index 84597b55e..e09b5f804 100644
--- a/youtube_dl/extractor/tvplay.py
+++ b/youtube_dl/extractor/tvplay.py
@@ -227,14 +227,16 @@ class TVPlayIE(InfoExtractor):
 
     def _real_extract(self, url):
         url, smuggled_data = unsmuggle_url(url, {})
-        self._initialize_geo_bypass(smuggled_data.get('geo_countries'))
+        self._initialize_geo_bypass({
+            'countries': smuggled_data.get('geo_countries'),
+        })
 
         video_id = self._match_id(url)
         geo_country = self._search_regex(
             r'https?://[^/]+\.([a-z]{2})', url,
             'geo country', default=None)
         if geo_country:
-            self._initialize_geo_bypass([geo_country.upper()])
+            self._initialize_geo_bypass({'countries': [geo_country.upper()]})
         video = self._download_json(
             'http://playapi.mtgx.tv/v3/videos/%s' % video_id, video_id, 'Downloading video JSON')