]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/xxxymovies.py
5c8f17eb2fa1c3bb12924ca189699181eb2b598e
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
12 class XXXYMoviesIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?xxxymovies\.com/videos/(?P<id>\d+)/(?P<display_id>[^/]+)'
15 'url': 'http://xxxymovies.com/videos/138669/ecstatic-orgasm-sofcore/',
16 'md5': '810b1bdbbffff89dd13bdb369fe7be4b',
19 'display_id': 'ecstatic-orgasm-sofcore',
21 'title': 'Ecstatic Orgasm Sofcore',
31 def _real_extract(self
, url
):
32 mobj
= re
.match(self
._VALID
_URL
, url
)
33 video_id
= mobj
.group('id')
34 display_id
= mobj
.group('display_id')
36 webpage
= self
._download
_webpage
(url
, display_id
)
38 video_url
= self
._search
_regex
(
39 r
"video_url\s*:\s*'([^']+)'", webpage
, 'video URL')
41 title
= self
._html
_search
_regex
(
42 [r
'<div class="block_header">\s*<h1>([^<]+)</h1>',
43 r
'<title>(.*?)\s*-\s*XXXYMovies\.com</title>'],
46 thumbnail
= self
._search
_regex
(
47 r
"preview_url\s*:\s*'([^']+)'",
48 webpage
, 'thumbnail', fatal
=False)
50 categories
= self
._html
_search
_meta
(
51 'keywords', webpage
, 'categories', default
='').split(',')
53 duration
= parse_duration(self
._search
_regex
(
54 r
'<span>Duration:</span>\s*(\d+:\d+)',
55 webpage
, 'duration', fatal
=False))
57 view_count
= int_or_none(self
._html
_search
_regex
(
58 r
'<div class="video_views">\s*(\d+)',
59 webpage
, 'view count', fatal
=False))
60 like_count
= int_or_none(self
._search
_regex
(
61 r
'>\s*Likes? <b>\((\d+)\)',
62 webpage
, 'like count', fatal
=False))
63 dislike_count
= int_or_none(self
._search
_regex
(
64 r
'>\s*Dislike <b>\((\d+)\)</b>',
65 webpage
, 'dislike count', fatal
=False))
67 age_limit
= self
._rta
_search
(webpage
)
71 'display_id': display_id
,
74 'thumbnail': thumbnail
,
75 'categories': categories
,
77 'view_count': view_count
,
78 'like_count': like_count
,
79 'dislike_count': dislike_count
,
80 'age_limit': age_limit
,