]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/rts.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
15 class RTSIE(InfoExtractor
):
17 _VALID_URL
= r
'^https?://(?:www\.)?rts\.ch/archives/tv/[^/]+/(?P<id>[0-9]+)-.*?\.html'
20 'url': 'http://www.rts.ch/archives/tv/divers/3449373-les-enfants-terribles.html',
21 'md5': '753b877968ad8afaeddccc374d4256a5',
26 'title': 'Les Enfants Terribles',
27 'description': 'France Pommier et sa soeur Luce Feral, les deux filles de ce groupe de 5.',
29 'upload_date': '19680921',
30 'timestamp': -40280400,
34 def _real_extract(self
, url
):
35 m
= re
.match(self
._VALID
_URL
, url
)
36 video_id
= m
.group('id')
38 all_info
= self
._download
_json
(
39 'http://www.rts.ch/a/%s.html?f=json/article' % video_id
, video_id
)
40 info
= all_info
['video']['JSONinfo']
42 upload_timestamp
= parse_iso8601(info
.get('broadcast_date'))
43 duration
= parse_duration(info
.get('duration'))
44 thumbnail
= unescapeHTML(info
.get('preview_image_url'))
48 'tbr': int_or_none(self
._search
_regex
(
49 r
'-([0-9]+)k\.', furl
, 'bitrate', default
=None)),
50 } for fid
, furl
in info
['streams'].items()]
51 self
._sort
_formats
(formats
)
56 'title': info
['title'],
57 'description': info
.get('intro'),
59 'uploader': info
.get('programName'),
60 'timestamp': upload_timestamp
,