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