1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-26 02:14:32 +01:00

[seznamzpravy] Fix extractor

Is SeznamZpravyIE needed anymore?
This commit is contained in:
Radek Hušek 2019-04-22 13:28:11 +02:00
parent 3fd86cfe13
commit 1ba97e9aaa

View File

@ -153,6 +153,11 @@ class SeznamZpravyArticleIE(InfoExtractor):
'playlist_count': 1,
}]
def _extract_urls(self, webpage):
return [mobj.group('url') for mobj in re.finditer(
r'<video\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//.*video.*)\1',
webpage)]
def _real_extract(self, url):
article_id = self._match_id(url)
@ -164,6 +169,19 @@ class SeznamZpravyArticleIE(InfoExtractor):
description = info.get('description') or self._og_search_description(webpage)
return self.playlist_result([
self.url_result(entry_url, ie=SeznamZpravyIE.ie_key())
for entry_url in SeznamZpravyIE._extract_urls(webpage)],
{
'formats': [
{
'protocol': 'm3u8',
'ext': 'mp4',
'url': "%shlsp2,h264_aac_%ip_ts,4,VOD" % (entry_url, quality),
'height': quality,
'width': 16 * quality // 9
}
for quality in [360, 480, 720, 1080]
],
'id': "%s-%i" % (article_id, i),
'title': title
}
for i, entry_url in enumerate(self._extract_urls(webpage))],
article_id, title, description)