1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-07-02 12:02:52 -05:00

Improve geo bypass mechanism

* Introduce geo bypass context
* Add ability to bypass based on IP blocks in CIDR notation
* Introduce --geo-bypass-ip-block
This commit is contained in:
Sergey M․
2018-05-02 07:18:01 +07:00
parent a93ce61bd5
commit 5f95927a62
11 changed files with 113 additions and 28 deletions

View File

@ -277,7 +277,9 @@ class AnvatoIE(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'),
})
mobj = re.match(self._VALID_URL, url)
access_key, video_id = mobj.group('access_key_or_mcp', 'id')