]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/malltv.py
e13c2e11a5baf301d32a34d8343776ab249ea821
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
7 from ..utils
import merge_dicts
10 class MallTVIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?mall\.tv/(?:[^/]+/)*(?P<id>[^/?#&]+)'
13 'url': 'https://www.mall.tv/18-miliard-pro-neziskovky-opravdu-jsou-sportovci-nebo-clovek-v-tisni-pijavice',
14 'md5': '1c4a37f080e1f3023103a7b43458e518',
17 'display_id': '18-miliard-pro-neziskovky-opravdu-jsou-sportovci-nebo-clovek-v-tisni-pijavice',
19 'title': '18 miliard pro neziskovky. Opravdu jsou sportovci nebo Člověk v tísni pijavice?',
20 'description': 'md5:25fc0ec42a72ba602b602c683fa29deb',
22 'timestamp': 1538870400,
23 'upload_date': '20181007',
27 'url': 'https://www.mall.tv/kdo-to-plati/18-miliard-pro-neziskovky-opravdu-jsou-sportovci-nebo-clovek-v-tisni-pijavice',
28 'only_matching': True,
31 def _real_extract(self
, url
):
32 display_id
= self
._match
_id
(url
)
34 webpage
= self
._download
_webpage
(
35 url
, display_id
, headers
=self
.geo_verification_headers())
37 SOURCE_RE
= r
'(<source[^>]+\bsrc=(?:(["\'])(?
:(?
!\
2).)+|
[^\s
]+)/(?P
<id>[\da
-z
]+)/index
)\b'
38 video_id = self._search_regex(
39 SOURCE_RE, webpage, 'video
id', group='id')
41 media = self._parse_html5_media_entries(
42 url, re.sub(SOURCE_RE, r'\
1.m3u8
', webpage), video_id,
43 m3u8_id='hls
', m3u8_entry_protocol='m3u8_native
')[0]
45 info = self._search_json_ld(webpage, video_id, default={})
47 return merge_dicts(media, info, {
49 'display_id
': display_id,
50 'title
': self._og_search_title(webpage, default=None) or display_id,
51 'description
': self._og_search_description(webpage, default=None),
52 'thumbnail
': self._og_search_thumbnail(webpage, default=None),