]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/eroprofile.py
[ssa] Add extractor (Closes #5169)
[yt-dlp.git] / youtube_dl / extractor / eroprofile.py
CommitLineData
461b00f3 1from __future__ import unicode_literals
2
461b00f3 3from .common import InfoExtractor
4
f9b9e886 5
461b00f3 6class EroProfileIE(InfoExtractor):
f9b9e886 7 _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
461b00f3 8 _TEST = {
9 'url': 'http://www.eroprofile.com/m/videos/view/sexy-babe-softcore',
10 'md5': 'c26f351332edf23e1ea28ce9ec9de32f',
11 'info_dict': {
12 'id': '3733775',
f9b9e886 13 'display_id': 'sexy-babe-softcore',
461b00f3 14 'ext': 'm4v',
f9b9e886 15 'title': 'sexy babe softcore',
461b00f3 16 'thumbnail': 're:https?://.*\.jpg',
17 'age_limit': 18,
18 }
19 }
20
21 def _real_extract(self, url):
f9b9e886 22 display_id = self._match_id(url)
461b00f3 23
f9b9e886 24 webpage = self._download_webpage(url, display_id)
461b00f3 25
f9b9e886
S
26 video_id = self._search_regex(
27 [r"glbUpdViews\s*\('\d*','(\d+)'", r'p/report/video/(\d+)'],
28 webpage, 'video id', default=None)
461b00f3 29
f9b9e886
S
30 video_url = self._search_regex(
31 r'<source src="([^"]+)', webpage, 'video url')
461b00f3 32 title = self._html_search_regex(
f9b9e886
S
33 r'Title:</th><td>([^<]+)</td>', webpage, 'title')
34 thumbnail = self._search_regex(
35 r'onclick="showVideoPlayer\(\)"><img src="([^"]+)',
36 webpage, 'thumbnail', fatal=False)
461b00f3 37
38 return {
39 'id': video_id,
f9b9e886 40 'display_id': display_id,
461b00f3 41 'url': video_url,
42 'title': title,
461b00f3 43 'thumbnail': thumbnail,
461b00f3 44 'age_limit': 18,
45 }