1 from __future__ import unicode_literals
5 from .common import InfoExtractor
6 from ..compat import compat_urllib_parse
13 class EroProfileIE(InfoExtractor):
14 _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
15 _LOGIN_URL = 'http://www.eroprofile.com/auth/auth.php?'
16 _NETRC_MACHINE = 'eroprofile'
18 'url': 'http://www.eroprofile.com/m/videos/view/sexy-babe-softcore',
19 'md5': 'c26f351332edf23e1ea28ce9ec9de32f',
22 'display_id': 'sexy-babe-softcore',
24 'title': 'sexy babe softcore',
25 'thumbnail': 're:https?://.*\.jpg',
29 'url': 'http://www.eroprofile.com/m/videos/view/Try-It-On-Pee_cut_2-wmv-4shared-com-file-sharing-download-movie-file',
30 'md5': '1baa9602ede46ce904c431f5418d8916',
34 'title': 'Try It On Pee_cut_2.wmv - 4shared.com - file sharing - download movie file',
35 'thumbnail': 're:https?://.*\.jpg',
38 'skip': 'Requires login',
42 (username, password) = self._get_login_info()
46 query = compat_urllib_parse.urlencode({
49 'url': 'http://www.eroprofile.com/',
51 login_url = self._LOGIN_URL + query
52 login_page = self._download_webpage(login_url, None, False)
54 m = re.search(r'Your username or password was incorrect\.', login_page)
57 'Wrong username and/or password.', expected=True)
60 redirect_url = self._search_regex(
61 r'<script[^>]+?src="([^"]+)"', login_page, 'login redirect url')
62 self._download_webpage(redirect_url, None, False)
64 def _real_initialize(self):
67 def _real_extract(self, url):
68 display_id = self._match_id(url)
70 webpage = self._download_webpage(url, display_id)
72 m = re.search(r'You must be logged in to view this video\.', webpage)
74 self.raise_login_required('This video requires login')
76 video_id = self._search_regex(
77 [r"glbUpdViews\s*\('\d*','(\d+)'", r'p/report/video/(\d+)'],
78 webpage, 'video id', default=None)
80 video_url = unescapeHTML(self._search_regex(
81 r'<source src="([^"]+)', webpage, 'video url'))
82 title = self._html_search_regex(
83 r'Title:</th><td>([^<]+)</td>', webpage, 'title')
84 thumbnail = self._search_regex(
85 r'onclick="showVideoPlayer\(\)"><img src="([^"]+)',
86 webpage, 'thumbnail', fatal=False)
90 'display_id': display_id,
93 'thumbnail': thumbnail,