3 from .common
import InfoExtractor
12 class MedialaanIE(InfoExtractor
):
16 (?:embed\.)?mychannels.video/embed/|
17 embed\.mychannels\.video/(?:s(?:dk|cript)/)?production/|
35 )/video/(?:[^/]+/)*[^/?&#]+~p
40 'url': 'https://www.bndestem.nl/video/de-terugkeer-van-ally-de-aap-en-wie-vertrekt-er-nog-bij-nac~p193993',
44 'title': 'De terugkeer van Ally de Aap en wie vertrekt er nog bij NAC?',
45 'timestamp': 1611663540,
46 'upload_date': '20210126',
50 'skip_download': True,
53 'url': 'https://www.gelderlander.nl/video/kanalen/degelderlander~c320/series/snel-nieuws~s984/noodbevel-in-doetinchem-politie-stuurt-mensen-centrum-uit~p194093',
54 'only_matching': True,
56 'url': 'https://embed.mychannels.video/sdk/production/193993?options=TFTFF_default',
57 'only_matching': True,
59 'url': 'https://embed.mychannels.video/script/production/193993',
60 'only_matching': True,
62 'url': 'https://embed.mychannels.video/production/193993',
63 'only_matching': True,
65 'url': 'https://mychannels.video/embed/193993',
66 'only_matching': True,
68 'url': 'https://embed.mychannels.video/embed/193993',
69 'only_matching': True,
73 def _extract_embed_urls(cls
, url
, webpage
):
75 for element
in re
.findall(r
'(<div[^>]+data-mychannels-type="video"[^>]*>)', webpage
):
76 mychannels_id
= extract_attributes(element
).get('data-mychannels-id')
78 entries
.append('https://mychannels.video/embed/' + mychannels_id
)
81 def _real_extract(self
, url
):
82 production_id
= self
._match
_id
(url
)
83 production
= self
._download
_json
(
84 'https://embed.mychannels.video/sdk/production/' + production_id
,
85 production_id
, query
={'options': 'UUUU_default'})['productions'][0]
86 title
= production
['title']
89 for source
in (production
.get('sources') or []):
90 src
= source
.get('src')
93 ext
= mimetype2ext(source
.get('type'))
95 formats
.extend(self
._extract
_m
3u8_formats
(
96 src
, production_id
, 'mp4', 'm3u8_native',
97 m3u8_id
='hls', fatal
=False))
108 'thumbnail': production
.get('posterUrl'),
109 'timestamp': parse_iso8601(production
.get('publicationDate'), ' '),
110 'duration': int_or_none(production
.get('duration')) or None,