[drtv] Add geo countries to GeoRestrictedError
authorSergey M․ <dstftw@gmail.com>
Sun, 5 Mar 2017 20:23:01 +0000 (03:23 +0700)
committerSergey M․ <dstftw@gmail.com>
Sun, 5 Mar 2017 20:23:42 +0000 (03:23 +0700)
youtube_dl/extractor/drtv.py

index b879f2c2b213c53f77a516902bf0b63d95269bf8..e4917014adae2e3fe286acc2a2cb66b6ddc3c735 100644 (file)
@@ -15,6 +15,8 @@ from ..utils import (
 
 class DRTVIE(InfoExtractor):
     _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'
     _TESTS = [{
         'url': 'https://www.dr.dk/tv/se/boern/ultra/klassen-ultra/klassen-darlig-taber-10',
@@ -137,7 +139,7 @@ class DRTVIE(InfoExtractor):
         if not formats and restricted_to_denmark:
             self.raise_geo_restricted(
                 'Unfortunately, DR is not allowed to show this program outside Denmark.',
-                expected=True)
+                countries=self._GEO_COUNTRIES)
 
         self._sort_formats(formats)