]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/slutload.py
Fix "invalid escape sequences" error on Python 3.6
[yt-dlp.git] / youtube_dl / extractor / slutload.py
CommitLineData
5301304b
PH
1from __future__ import unicode_literals
2
1476b497 3from .common import InfoExtractor
1476b497 4
5301304b 5
1476b497 6class SlutloadIE(InfoExtractor):
5301304b 7 _VALID_URL = r'^https?://(?:\w+\.)?slutload\.com/video/[^/]+/(?P<id>[^/]+)/?$'
1476b497 8 _TEST = {
5301304b 9 'url': 'http://www.slutload.com/video/virginie-baisee-en-cam/TD73btpBqSxc/',
2b51dac1 10 'md5': '868309628ba00fd488cf516a113fd717',
5301304b
PH
11 'info_dict': {
12 'id': 'TD73btpBqSxc',
13 'ext': 'mp4',
611c1dd9
S
14 'title': 'virginie baisee en cam',
15 'age_limit': 18,
ec85ded8 16 'thumbnail': r're:https?://.*?\.jpg'
1476b497 17 }
18 }
19
20 def _real_extract(self, url):
2b51dac1 21 video_id = self._match_id(url)
1476b497 22 webpage = self._download_webpage(url, video_id)
23
1476b497 24 video_title = self._html_search_regex(r'<h1><strong>([^<]+)</strong>',
9e1a5b84 25 webpage, 'title').strip()
5301304b
PH
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 }