1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
14 class MedialaanIE(InfoExtractor
):
18 (?:embed\.)?mychannels.video/embed/|
19 embed\.mychannels\.video/(?:s(?:dk|cript)/)?production/|
37 )/video/(?:[^/]+/)*[^/?&#]+~p
42 'url': 'https://www.bndestem.nl/video/de-terugkeer-van-ally-de-aap-en-wie-vertrekt-er-nog-bij-nac~p193993',
46 'title': 'De terugkeer van Ally de Aap en wie vertrekt er nog bij NAC?',
47 'timestamp': 1611663540,
48 'upload_date': '20210126',
52 'skip_download': True,
55 'url': 'https://www.gelderlander.nl/video/kanalen/degelderlander~c320/series/snel-nieuws~s984/noodbevel-in-doetinchem-politie-stuurt-mensen-centrum-uit~p194093',
56 'only_matching': True,
58 'url': 'https://embed.mychannels.video/sdk/production/193993?options=TFTFF_default',
59 'only_matching': True,
61 'url': 'https://embed.mychannels.video/script/production/193993',
62 'only_matching': True,
64 'url': 'https://embed.mychannels.video/production/193993',
65 'only_matching': True,
67 'url': 'https://mychannels.video/embed/193993',
68 'only_matching': True,
70 'url': 'https://embed.mychannels.video/embed/193993',
71 'only_matching': True,
75 def _extract_urls(webpage
):
77 for element
in re
.findall(r
'(<div[^>]+data-mychannels-type="video"[^>]*>)', webpage
):
78 mychannels_id
= extract_attributes(element
).get('data-mychannels-id')
80 entries
.append('https://mychannels.video/embed/' + mychannels_id
)
83 def _real_extract(self
, url
):
84 production_id
= self
._match
_id
(url
)
85 production
= self
._download
_json
(
86 'https://embed.mychannels.video/sdk/production/' + production_id
,
87 production_id
, query
={'options': 'UUUU_default'}
)['productions'][0]
88 title
= production
['title']
91 for source
in (production
.get('sources') or []):
92 src
= source
.get('src')
95 ext
= mimetype2ext(source
.get('type'))
97 formats
.extend(self
._extract
_m
3u8_formats
(
98 src
, production_id
, 'mp4', 'm3u8_native',
99 m3u8_id
='hls', fatal
=False))
105 self
._sort
_formats
(formats
)
111 'thumbnail': production
.get('posterUrl'),
112 'timestamp': parse_iso8601(production
.get('publicationDate'), ' '),
113 'duration': int_or_none(production
.get('duration')) or None,