1 from __future__ import unicode_literals
5 from .common import InfoExtractor
6 from ..compat import compat_urllib_parse
7 from ..utils import ExtractorError
10 class EroProfileIE(InfoExtractor):
11 _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
12 _LOGIN_URL = 'http://www.eroprofile.com/auth/auth.php?'
13 _NETRC_MACHINE = 'eroprofile'
15 'url': 'http://www.eroprofile.com/m/videos/view/sexy-babe-softcore',
16 'md5': 'c26f351332edf23e1ea28ce9ec9de32f',
19 'display_id': 'sexy-babe-softcore',
21 'title': 'sexy babe softcore',
22 'thumbnail': 're:https?://.*\.jpg',
26 'url': 'http://www.eroprofile.com/m/videos/view/Try-It-On-Pee_cut_2-wmv-4shared-com-file-sharing-download-movie-file',
27 'md5': '1baa9602ede46ce904c431f5418d8916',
31 'title': 'Try It On Pee_cut_2.wmv - 4shared.com - file sharing - download movie file',
32 'thumbnail': 're:https?://.*\.jpg',
35 'skip': 'Requires login',
39 (username, password) = self._get_login_info()
43 query = compat_urllib_parse.urlencode({
46 'url': 'http://www.eroprofile.com/',
48 login_url = self._LOGIN_URL + query
49 login_page = self._download_webpage(login_url, None, False)
51 m = re.search(r'Your username or password was incorrect\.', login_page)
54 'Wrong username and/or password.', expected=True)
57 redirect_url = self._search_regex(
58 r'<script[^>]+?src="([^"]+)"', login_page, 'login redirect url')
59 self._download_webpage(redirect_url, None, False)
61 def _real_initialize(self):
64 def _real_extract(self, url):
65 display_id = self._match_id(url)
67 webpage = self._download_webpage(url, display_id)
69 m = re.search(r'You must be logged in to view this video\.', webpage)
72 'This video requires login. Please specify a username and password and try again.', expected=True)
74 video_id = self._search_regex(
75 [r"glbUpdViews\s*\('\d*','(\d+)'", r'p/report/video/(\d+)'],
76 webpage, 'video id', default=None)
78 video_url = self._search_regex(
79 r'<source src="([^"]+)', webpage, 'video url')
80 title = self._html_search_regex(
81 r'Title:</th><td>([^<]+)</td>', webpage, 'title')
82 thumbnail = self._search_regex(
83 r'onclick="showVideoPlayer\(\)"><img src="([^"]+)',
84 webpage, 'thumbnail', fatal=False)
88 'display_id': display_id,
91 'thumbnail': thumbnail,