1 from .common
import InfoExtractor
4 class SexuIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:www\.)?sexu\.com/(?P<id>\d+)'
8 'url': 'http://sexu.com/961791/',
9 'md5': 'ff615aca9691053c94f8f10d96cd7884',
13 'title': 'md5:4d05a19a5fc049a63dbbaf05fb71d91b',
14 'description': 'md5:2b75327061310a3afb3fbd7d09e2e403',
15 'categories': list, # NSFW
16 'thumbnail': r
're:https?://.*\.jpg$',
21 def _real_extract(self
, url
):
22 video_id
= self
._match
_id
(url
)
23 webpage
= self
._download
_webpage
(url
, video_id
)
25 jwvideo
= self
._parse
_json
(
26 self
._search
_regex
(r
'\.setup\(\s*({.+?})\s*\);', webpage
, 'jwvideo'),
29 sources
= jwvideo
['sources']
32 'url': source
['file'].replace('\\', ''),
33 'format_id': source
.get('label'),
34 'height': int(self
._search
_regex
(
35 r
'^(\d+)[pP]', source
.get('label', ''), 'height',
37 } for source
in sources
if source
.get('file')]
39 title
= self
._html
_search
_regex
(
40 r
'<title>([^<]+)\s*-\s*Sexu\.Com</title>', webpage
, 'title')
42 description
= self
._html
_search
_meta
(
43 'description', webpage
, 'description')
45 thumbnail
= jwvideo
.get('image')
47 categories_str
= self
._html
_search
_meta
(
48 'keywords', webpage
, 'categories')
50 None if categories_str
is None
51 else categories_str
.split(','))
56 'description': description
,
57 'thumbnail': thumbnail
,
58 'categories': categories
,