]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/twentyfourvideo.py
baeb85d4730a2198bf07f51490984b1e346f6c59
1 from .common
import InfoExtractor
10 class TwentyFourVideoIE(InfoExtractor
):
15 (?:(?:www|porno?)\.)?24video\.
16 (?:net|me|xxx|sexy?|tube|adult|site|vip)
19 video/(?:(?:view|xml)/)?|
20 player/new24_play\.swf\?id=
26 'url': 'http://www.24video.net/video/view/1044982',
27 'md5': 'e09fc0901d9eaeedac872f154931deeb',
31 'title': 'Эротика каменного века',
32 'description': 'Как смотрели порно в каменном веке.',
33 'thumbnail': r
're:^https?://.*\.jpg$',
34 'uploader': 'SUPERTELO',
36 'timestamp': 1275937857,
37 'upload_date': '20100607',
43 'url': 'http://www.24video.net/player/new24_play.swf?id=1044982',
44 'only_matching': True,
46 'url': 'http://www.24video.me/video/view/1044982',
47 'only_matching': True,
49 'url': 'http://www.24video.tube/video/view/2363750',
50 'only_matching': True,
52 'url': 'https://www.24video.site/video/view/2640421',
53 'only_matching': True,
55 'url': 'https://porno.24video.net/video/2640421-vsya-takaya-gibkaya-i-v-masle',
56 'only_matching': True,
58 'url': 'https://www.24video.vip/video/view/1044982',
59 'only_matching': True,
61 'url': 'https://porn.24video.net/video/2640421-vsya-takay',
62 'only_matching': True,
65 def _real_extract(self
, url
):
66 mobj
= self
._match
_valid
_url
(url
)
67 video_id
= mobj
.group('id')
68 host
= mobj
.group('host')
70 webpage
= self
._download
_webpage
(
71 'http://%s/video/view/%s' % (host
, video_id
), video_id
)
73 title
= self
._og
_search
_title
(webpage
)
74 description
= self
._html
_search
_regex
(
75 r
'<(p|span)[^>]+itemprop="description"[^>]*>(?P<description>[^<]+)</\1>',
76 webpage
, 'description', fatal
=False, group
='description')
77 thumbnail
= self
._og
_search
_thumbnail
(webpage
)
78 duration
= int_or_none(self
._og
_search
_property
(
79 'duration', webpage
, 'duration', fatal
=False))
80 timestamp
= parse_iso8601(self
._search
_regex
(
81 r
'<time[^>]+\bdatetime="([^"]+)"[^>]+itemprop="uploadDate"',
82 webpage
, 'upload date', fatal
=False))
84 uploader
= self
._html
_search
_regex
(
85 r
'class="video-uploaded"[^>]*>\s*<a href="/jsecUser/movies/[^"]+"[^>]*>([^<]+)</a>',
86 webpage
, 'uploader', fatal
=False)
88 view_count
= int_or_none(self
._html
_search
_regex
(
89 r
'<span class="video-views">(\d+) просмотр',
90 webpage
, 'view count', fatal
=False))
91 comment_count
= int_or_none(self
._html
_search
_regex
(
92 r
'<a[^>]+href="#tab-comments"[^>]*>(\d+) комментари',
93 webpage
, 'comment count', default
=None))
97 r
'http://%s/video/xml/%s?mode=init' % (host
, video_id
),
98 video_id
, 'Downloading init XML')
100 video_xml
= self
._download
_xml
(
101 'http://%s/video/xml/%s?mode=play' % (host
, video_id
),
102 video_id
, 'Downloading video XML')
104 video
= xpath_element(video_xml
, './/video', 'video', fatal
=True)
107 'url': xpath_attr(video
, '', 'url', 'video URL', fatal
=True),
110 like_count
= int_or_none(video
.get('ratingPlus'))
111 dislike_count
= int_or_none(video
.get('ratingMinus'))
112 age_limit
= 18 if video
.get('adult') == 'true' else 0
117 'description': description
,
118 'thumbnail': thumbnail
,
119 'uploader': uploader
,
120 'duration': duration
,
121 'timestamp': timestamp
,
122 'view_count': view_count
,
123 'comment_count': comment_count
,
124 'like_count': like_count
,
125 'dislike_count': dislike_count
,
126 'age_limit': age_limit
,