]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/rtvnh.py
4896d09d666e687010ae3cb6ebe0e2bfaec537d6
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..utils
import ExtractorError
8 class RTVNHIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?rtvnh\.nl/video/(?P<id>[0-9]+)'
11 'url': 'http://www.rtvnh.nl/video/131946',
12 'md5': '6e1d0ab079e2a00b6161442d3ceacfc1',
16 'title': 'Grote zoektocht in zee bij Zandvoort naar vermiste vrouw',
17 'thumbnail': 're:^https?:.*\.jpg$'
21 def _real_extract(self
, url
):
22 video_id
= self
._match
_id
(url
)
24 meta
= self
._parse
_json
(self
._download
_webpage
(
25 'http://www.rtvnh.nl/video/json?m=' + video_id
, video_id
), video_id
)
27 status
= meta
.get('status')
30 '%s returned error code %d' % (self
.IE_NAME
, status
), expected
=True)
32 formats
= self
._extract
_smil
_formats
(
33 'http://www.rtvnh.nl/video/smil?m=' + video_id
, video_id
, fatal
=False)
35 for item
in meta
['source']['fb']:
36 if item
.get('type') == 'hls':
37 formats
.extend(self
._extract
_m
3u8_formats
(
38 item
['file'], video_id
, ext
='mp4', entry_protocol
='m3u8_native'))
39 elif item
.get('type') == '':
40 formats
.append({'url': item
['file']})
41 self
._sort
_formats
(formats
)
45 'title': meta
['title'].strip(),
46 'thumbnail': meta
.get('image'),