1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-02 09:12:40 +01:00

[drtv] Add geo countries to GeoRestrictedError

This commit is contained in:
Sergey M․ 2017-03-06 03:23:01 +07:00
parent fc11ad3833
commit 96182695e4
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -15,6 +15,8 @@
class DRTVIE(InfoExtractor): class DRTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dr\.dk/(?:tv/se|nyheder|radio/ondemand)/(?:[^/]+/)*(?P<id>[\da-z-]+)(?:[/#?]|$)' _VALID_URL = r'https?://(?:www\.)?dr\.dk/(?:tv/se|nyheder|radio/ondemand)/(?:[^/]+/)*(?P<id>[\da-z-]+)(?:[/#?]|$)'
_GEO_BYPASS = False
_GEO_COUNTRIES = ['DK']
IE_NAME = 'drtv' IE_NAME = 'drtv'
_TESTS = [{ _TESTS = [{
'url': 'https://www.dr.dk/tv/se/boern/ultra/klassen-ultra/klassen-darlig-taber-10', 'url': 'https://www.dr.dk/tv/se/boern/ultra/klassen-ultra/klassen-darlig-taber-10',
@ -137,7 +139,7 @@ def _real_extract(self, url):
if not formats and restricted_to_denmark: if not formats and restricted_to_denmark:
self.raise_geo_restricted( self.raise_geo_restricted(
'Unfortunately, DR is not allowed to show this program outside Denmark.', 'Unfortunately, DR is not allowed to show this program outside Denmark.',
expected=True) countries=self._GEO_COUNTRIES)
self._sort_formats(formats) self._sort_formats(formats)