Skip to content

Commit

Permalink
[iprima] Improve geo restriction detection and disable geo bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Feb 20, 2017
1 parent 82f6621 commit da42ff0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion youtube_dl/extractor/iprima.py
Expand Up @@ -13,6 +13,7 @@

class IPrimaIE(InfoExtractor):
_VALID_URL = r'https?://play\.iprima\.cz/(?:.+/)?(?P<id>[^?#]+)'
_GEO_BYPASS = False

_TESTS = [{
'url': 'http://play.iprima.cz/gondici-s-r-o-33',
Expand All @@ -28,6 +29,10 @@ class IPrimaIE(InfoExtractor):
}, {
'url': 'http://play.iprima.cz/particka/particka-92',
'only_matching': True,
}, {
# geo restricted
'url': 'http://play.iprima.cz/closer-nove-pripady/closer-nove-pripady-iv-1',
'only_matching': True,
}]

def _real_extract(self, url):
Expand Down Expand Up @@ -83,7 +88,7 @@ def extract_formats(format_url, format_key=None, lang=None):
extract_formats(src)

if not formats and '>GEO_IP_NOT_ALLOWED<' in playerpage:
self.raise_geo_restricted()
self.raise_geo_restricted(countries=['CZ'])

self._sort_formats(formats)

Expand Down

0 comments on commit da42ff0

Please sign in to comment.