]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/mychannels.py
1 from .common
import InfoExtractor
4 class MyChannelsIE(InfoExtractor
):
5 _VALID_URL
= r
'https?://(?:www\.)?mychannels\.com/.*(?P<id_type>video|production)_id=(?P<id>[0-9]+)'
7 'url': 'https://mychannels.com/missholland/miss-holland?production_id=3416',
8 'md5': 'b8993daad4262dd68d89d651c0c52c45',
12 'title': 'Miss Holland joins VOTE LEAVE',
13 'description': 'Miss Holland | #13 Not a potato',
14 'uploader': 'Miss Holland',
18 def _real_extract(self
, url
):
19 id_type
, url_id
= self
._match
_valid
_url
(url
).groups()
20 webpage
= self
._download
_webpage
(url
, url_id
)
21 video_data
= self
._html
_search
_regex
(r
'<div([^>]+data-%s-id="%s"[^>]+)>' % (id_type
, url_id
), webpage
, 'video data')
23 def extract_data_val(attr
, fatal
=False):
24 return self
._html
_search
_regex
(r
'data-%s\s*=\s*"([^"]+)"' % attr
, video_data
, attr
, fatal
=fatal
)
25 minoto_id
= extract_data_val('minoto-id') or self
._search
_regex
(r
'/id/([a-zA-Z0-9]+)', extract_data_val('video-src', True), 'minoto id')
28 '_type': 'url_transparent',
29 'url': 'minoto:%s' % minoto_id
,
31 'title': extract_data_val('title', True),
32 'description': extract_data_val('description'),
33 'thumbnail': extract_data_val('image'),
34 'uploader': extract_data_val('channel'),