]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/slutload.py
debian/control: Remove mplayer2 from recommends. (Closes: #841187)
[youtubedl] / youtube_dl / extractor / slutload.py
1 from __future__ import unicode_literals
2
3 from .common import InfoExtractor
4
5
6 class SlutloadIE(InfoExtractor):
7 _VALID_URL = r'^https?://(?:\w+\.)?slutload\.com/video/[^/]+/(?P<id>[^/]+)/?$'
8 _TEST = {
9 'url': 'http://www.slutload.com/video/virginie-baisee-en-cam/TD73btpBqSxc/',
10 'md5': '868309628ba00fd488cf516a113fd717',
11 'info_dict': {
12 'id': 'TD73btpBqSxc',
13 'ext': 'mp4',
14 'title': 'virginie baisee en cam',
15 'age_limit': 18,
16 'thumbnail': 're:https?://.*?\.jpg'
17 }
18 }
19
20 def _real_extract(self, url):
21 video_id = self._match_id(url)
22 webpage = self._download_webpage(url, video_id)
23
24 video_title = self._html_search_regex(r'<h1><strong>([^<]+)</strong>',
25 webpage, 'title').strip()
26
27 video_url = self._html_search_regex(
28 r'(?s)<div id="vidPlayer"\s+data-url="([^"]+)"',
29 webpage, 'video URL')
30 thumbnail = self._html_search_regex(
31 r'(?s)<div id="vidPlayer"\s+.*?previewer-file="([^"]+)"',
32 webpage, 'thumbnail', fatal=False)
33
34 return {
35 'id': video_id,
36 'url': video_url,
37 'title': video_title,
38 'thumbnail': thumbnail,
39 'age_limit': 18
40 }