]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/echomsk.py
3 from .common
import InfoExtractor
6 class EchoMskIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?:www\.)?echo\.msk\.ru/sounds/(?P<id>\d+)'
9 'url': 'http://www.echo.msk.ru/sounds/1464134.html',
10 'md5': '2e44b3b78daff5b458e4dbc37f191f7c',
14 'title': 'Особое мнение - 29 декабря 2014, 19:08',
18 def _real_extract(self
, url
):
19 video_id
= self
._match
_id
(url
)
21 webpage
= self
._download
_webpage
(url
, video_id
)
23 audio_url
= self
._search
_regex
(
24 r
'<a rel="mp3" href="([^"]+)">', webpage
, 'audio URL')
26 title
= self
._html
_search
_regex
(
27 r
'<a href="/programs/[^"]+" target="_blank">([^<]+)</a>',
30 air_date
= self
._html
_search
_regex
(
31 r
'(?s)<div class="date">(.+?)</div>',
32 webpage
, 'date', fatal
=False, default
=None)
35 air_date
= re
.sub(r
'(\s)\1+', r
'\1', air_date
)
37 title
= '%s - %s' % (title
, air_date
)