]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/sexu.py
1 from .common
import InfoExtractor
4 class SexuIE(InfoExtractor
):
5 _VALID_URL
= r
'https?://(?:www\.)?sexu\.com/(?P<id>\d+)'
7 'url': 'http://sexu.com/961791/',
8 'md5': 'ff615aca9691053c94f8f10d96cd7884',
12 'title': 'md5:4d05a19a5fc049a63dbbaf05fb71d91b',
13 'description': 'md5:2b75327061310a3afb3fbd7d09e2e403',
14 'categories': list, # NSFW
15 'thumbnail': r
're:https?://.*\.jpg$',
20 def _real_extract(self
, url
):
21 video_id
= self
._match
_id
(url
)
22 webpage
= self
._download
_webpage
(url
, video_id
)
24 jwvideo
= self
._parse
_json
(
25 self
._search
_regex
(r
'\.setup\(\s*({.+?})\s*\);', webpage
, 'jwvideo'),
28 sources
= jwvideo
['sources']
31 'url': source
['file'].replace('\\', ''),
32 'format_id': source
.get('label'),
33 'height': int(self
._search
_regex
(
34 r
'^(\d+)[pP]', source
.get('label', ''), 'height',
36 } for source
in sources
if source
.get('file')]
37 self
._sort
_formats
(formats
)
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
,