]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/lrt.py
d72d470aa8dbb532f80f44796354dabd3de92261
2 from __future__
import unicode_literals
7 from .common
import InfoExtractor
16 class LRTIE(InfoExtractor
):
18 _VALID_URL
= r
'https?://(?:www\.)?lrt\.lt/mediateka/irasas/(?P<id>[0-9]+)'
20 'url': 'http://www.lrt.lt/mediateka/irasas/54391/',
24 'title': 'Septynios Kauno dienos',
25 'description': 'md5:24d84534c7dc76581e59f5689462411a',
29 'skip_download': True, # HLS download
34 def _real_extract(self
, url
):
35 video_id
= self
._match
_id
(url
)
36 webpage
= self
._download
_webpage
(url
, video_id
)
38 title
= remove_end(self
._og
_search
_title
(webpage
), ' - LRT')
39 thumbnail
= self
._og
_search
_thumbnail
(webpage
)
40 description
= self
._og
_search
_description
(webpage
)
41 duration
= parse_duration(self
._search
_regex
(
42 r
"'duration':\s*'([^']+)',", webpage
,
43 'duration', fatal
=False, default
=None))
46 for js
in re
.findall(r
'(?s)config:\s*(\{.*?\})', webpage
):
47 data
= json
.loads(js_to_json(js
))
48 if data
['provider'] == 'rtmp':
51 'ext': determine_ext(data
['file']),
52 'url': data
['streamer'],
53 'play_path': 'mp4:%s' % data
['file'],
58 self
._extract
_m
3u8_formats
(data
['file'], video_id
, 'mp4'))
64 'thumbnail': thumbnail
,
65 'description': description
,