1 from .common
import InfoExtractor
10 class YouJizzIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:\w+\.)?youjizz\.com/videos/(?:[^/#?]*-(?P<id>\d+)\.html|embed/(?P<embed_id>\d+))'
13 'url': 'http://www.youjizz.com/videos/zeichentrick-1-2189178.html',
14 'md5': 'b1e1dfaa8bb9537d8b84eeda9cf4acf4',
18 'title': 'Zeichentrick 1',
23 'url': 'http://www.youjizz.com/videos/-2189178.html',
24 'only_matching': True,
26 'url': 'https://www.youjizz.com/videos/embed/31991001',
27 'only_matching': True,
30 def _real_extract(self
, url
):
31 mobj
= self
._match
_valid
_url
(url
)
32 video_id
= mobj
.group('id') or mobj
.group('embed_id')
34 webpage
= self
._download
_webpage
(url
, video_id
)
36 title
= self
._html
_extract
_title
(webpage
)
40 encodings
= self
._parse
_json
(
42 r
'[Ee]ncodings\s*=\s*(\[.+?\]);\n', webpage
, 'encodings',
44 video_id
, fatal
=False)
45 for encoding
in encodings
:
46 if not isinstance(encoding
, dict):
48 format_url
= url_or_none(encoding
.get('filename'))
51 if determine_ext(format_url
) == 'm3u8':
52 formats
.extend(self
._extract
_m
3u8_formats
(
53 format_url
, video_id
, 'mp4', entry_protocol
='m3u8_native',
54 m3u8_id
='hls', fatal
=False))
56 format_id
= encoding
.get('name') or encoding
.get('quality')
57 height
= int_or_none(self
._search
_regex
(
58 r
'^(\d+)[pP]', format_id
, 'height', default
=None))
61 'format_id': format_id
,
70 # YouJizz's HTML5 player has invalid HTML
71 webpage
= webpage
.replace('"controls', '" controls')
72 info_dict
= self
._parse
_html
5_media
_entries
(
73 url
, webpage
, video_id
)[0]
75 duration
= parse_duration(self
._search
_regex
(
76 r
'<strong>Runtime:</strong>([^<]+)', webpage
, 'duration',
78 uploader
= self
._search
_regex
(
79 r
'<strong>Uploaded By:.*?<a[^>]*>([^<]+)', webpage
, 'uploader',
85 'age_limit': self
._rta
_search
(webpage
),