aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-02-19 06:24:38 +0700
committerSergey M․ <dstftw@gmail.com>2017-02-19 06:25:59 +0700
commitc58b7ffef43f60fa6a183c849cfdca42e36eae0c (patch)
treefe212f879ba96e27c2d43a440fadba215cf175e8
parentf1a78ee4ef3bfd8e7ff06a3014d96c3cf11b4d9f (diff)
[tv4] Bypass geo restriction and improve detection
-rw-r--r--youtube_dl/extractor/tv4.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/youtube_dl/extractor/tv4.py b/youtube_dl/extractor/tv4.py
index 7918e3d86..7aeb2c620 100644
--- a/youtube_dl/extractor/tv4.py
+++ b/youtube_dl/extractor/tv4.py
@@ -24,6 +24,7 @@ class TV4IE(InfoExtractor):
sport/|
)
)(?P<id>[0-9]+)'''
+ _GEO_COUNTRIES = ['SE']
_TESTS = [
{
'url': 'http://www.tv4.se/kalla-fakta/klipp/kalla-fakta-5-english-subtitles-2491650',
@@ -71,10 +72,6 @@ class TV4IE(InfoExtractor):
'http://www.tv4play.se/player/assets/%s.json' % video_id,
video_id, 'Downloading video info JSON')
- # If is_geo_restricted is true, it doesn't necessarily mean we can't download it
- if info.get('is_geo_restricted'):
- self.report_warning('This content might not be available in your country due to licensing restrictions.')
-
title = info['title']
subtitles = {}
@@ -113,6 +110,10 @@ class TV4IE(InfoExtractor):
'url': manifest_url,
'ext': 'vtt',
}]})
+
+ if not formats and info.get('is_geo_restricted'):
+ self.raise_geo_restricted(countries=self._GEO_COUNTRIES)
+
self._sort_formats(formats)
return {