mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-21 13:54:22 -07:00
Improve geo bypass mechanism
* Rename options to preffixly match with --geo-verification-proxy * Introduce _GEO_COUNTRIES for extractors * Implement faking IP right away for sites with known geo restriction
This commit is contained in:
parent
0a840f584c
commit
4248dad92b
13 changed files with 72 additions and 31 deletions
|
@ -13,6 +13,7 @@ from ..utils import (
|
|||
|
||||
|
||||
class SVTBaseIE(InfoExtractor):
|
||||
_GEO_COUNTRIES = ['SE']
|
||||
def _extract_video(self, video_info, video_id):
|
||||
formats = []
|
||||
for vr in video_info['videoReferences']:
|
||||
|
@ -39,7 +40,8 @@ class SVTBaseIE(InfoExtractor):
|
|||
})
|
||||
if not formats and video_info.get('rights', {}).get('geoBlockedSweden'):
|
||||
self.raise_geo_restricted(
|
||||
'This video is only available in Sweden', countries=['SE'])
|
||||
'This video is only available in Sweden',
|
||||
countries=self._GEO_COUNTRIES)
|
||||
self._sort_formats(formats)
|
||||
|
||||
subtitles = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue