]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/rule34video.py
2 from __future__
import unicode_literals
5 from ..utils
import parse_duration
6 from .common
import InfoExtractor
9 class Rule34VideoIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?rule34video\.com/videos/(?P<id>\d+)'
13 'url': 'https://rule34video.com/videos/3065157/shot-it-mmd-hmv/',
14 'md5': 'ffccac2c23799dabbd192621ae4d04f3',
18 'title': 'Shot It-(mmd hmv)',
19 'thumbnail': 'https://rule34video.com/contents/videos_screenshots/3065000/3065157/preview.jpg',
25 'url': 'https://rule34video.com/videos/3065296/lara-in-trouble-ep-7-wildeerstudio/',
26 'md5': '6bb5169f9f6b38cd70882bf2e64f6b86',
30 'title': 'Lara in Trouble Ep. 7 [WildeerStudio]',
31 'thumbnail': 'https://rule34video.com/contents/videos_screenshots/3065000/3065296/preview.jpg',
38 def _real_extract(self
, url
):
39 video_id
= self
._match
_id
(url
)
40 webpage
= self
._download
_webpage
(url
, video_id
)
44 for mobj
in re
.finditer(r
'<a[^>]+href="(?P<video_url>[^"]+download=true[^"]+)".*>(?P<ext>[^\s]+) (?P<quality>[^<]+)p</a>', webpage
):
45 url
, ext
, quality
= mobj
.groups()
52 title
= self
._html
_extract
_title
(webpage
)
53 thumbnail
= self
._html
_search
_regex
(r
'preview_url:\s+\'([^
\']+)\'', webpage, 'thumbnail
', default=None)
54 duration = self._html_search_regex(r'"icon-clock"></i
>\s
+<span
>((?
:\d
+:?
)+)', webpage, 'duration
', default=None)
56 self._sort_formats(formats)
62 'thumbnail
': thumbnail,
63 'duration
': parse_duration(duration),