projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[youtube] fix hd720 format position
[youtube-dl]
/
youtube_dl
/
extractor
/
tv4.py
diff --git
a/youtube_dl/extractor/tv4.py
b/youtube_dl/extractor/tv4.py
index 7918e3d86f9f88ff91274a08d8fd4d06885c12b8..cfcce020a62f1cf5728e275a8122d68428865b4b 100644
(file)
--- a/
youtube_dl/extractor/tv4.py
+++ b/
youtube_dl/extractor/tv4.py
@@
-18,12
+18,13
@@
class TV4IE(InfoExtractor):
tv4\.se/(?:[^/]+)/klipp/(?:.*)-|
tv4play\.se/
(?:
tv4\.se/(?:[^/]+)/klipp/(?:.*)-|
tv4play\.se/
(?:
- (?:program|barn)/(?:[^
\?]+)\?video_id=
|
+ (?:program|barn)/(?:[^
/]+/|(?:[^\?]+)\?video_id=)
|
iframe/video/|
film/|
sport/|
)
)(?P<id>[0-9]+)'''
iframe/video/|
film/|
sport/|
)
)(?P<id>[0-9]+)'''
+ _GEO_COUNTRIES = ['SE']
_TESTS = [
{
'url': 'http://www.tv4.se/kalla-fakta/klipp/kalla-fakta-5-english-subtitles-2491650',
_TESTS = [
{
'url': 'http://www.tv4.se/kalla-fakta/klipp/kalla-fakta-5-english-subtitles-2491650',
@@
-62,6
+63,10
@@
class TV4IE(InfoExtractor):
'url': 'http://www.tv4play.se/barn/looney-tunes?video_id=3062412',
'only_matching': True,
},
'url': 'http://www.tv4play.se/barn/looney-tunes?video_id=3062412',
'only_matching': True,
},
+ {
+ 'url': 'http://www.tv4play.se/program/farang/3922081',
+ 'only_matching': True,
+ }
]
def _real_extract(self, url):
]
def _real_extract(self, url):
@@
-71,10
+76,6
@@
class TV4IE(InfoExtractor):
'http://www.tv4play.se/player/assets/%s.json' % video_id,
video_id, 'Downloading video info JSON')
'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 = {}
title = info['title']
subtitles = {}
@@
-113,6
+114,10
@@
class TV4IE(InfoExtractor):
'url': manifest_url,
'ext': 'vtt',
}]})
'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 {
self._sort_formats(formats)
return {