]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/slutload.py
[vimeo:watchlater] Fix extraction (Closes #3886)
[yt-dlp.git] / youtube_dl / extractor / slutload.py
CommitLineData
5301304b
PH
1from __future__ import unicode_literals
2
1476b497 3import re
4
5from .common import InfoExtractor
1476b497 6
5301304b 7
1476b497 8class SlutloadIE(InfoExtractor):
5301304b 9 _VALID_URL = r'^https?://(?:\w+\.)?slutload\.com/video/[^/]+/(?P<id>[^/]+)/?$'
1476b497 10 _TEST = {
5301304b
PH
11 'url': 'http://www.slutload.com/video/virginie-baisee-en-cam/TD73btpBqSxc/',
12 'md5': '0cf531ae8006b530bd9df947a6a0df77',
13 'info_dict': {
14 'id': 'TD73btpBqSxc',
15 'ext': 'mp4',
16 "title": "virginie baisee en cam",
17 "age_limit": 18,
18 'thumbnail': 're:https?://.*?\.jpg'
1476b497 19 }
20 }
21
22 def _real_extract(self, url):
23 mobj = re.match(self._VALID_URL, url)
5301304b 24 video_id = mobj.group('id')
1476b497 25
1476b497 26 webpage = self._download_webpage(url, video_id)
27
1476b497 28 video_title = self._html_search_regex(r'<h1><strong>([^<]+)</strong>',
9e1a5b84 29 webpage, 'title').strip()
5301304b
PH
30
31 video_url = self._html_search_regex(
32 r'(?s)<div id="vidPlayer"\s+data-url="([^"]+)"',
33 webpage, 'video URL')
34 thumbnail = self._html_search_regex(
35 r'(?s)<div id="vidPlayer"\s+.*?previewer-file="([^"]+)"',
36 webpage, 'thumbnail', fatal=False)
37
38 return {
39 'id': video_id,
40 'url': video_url,
41 'title': video_title,
42 'thumbnail': thumbnail,
43 'age_limit': 18
44 }