1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from ..compat
import compat_urllib_parse_urlencode
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': r
're:https?://.*\.jpg',
28 'skip': 'Video not found',
30 'url': 'http://www.eroprofile.com/m/videos/view/Try-It-On-Pee_cut_2-wmv-4shared-com-file-sharing-download-movie-file',
31 'md5': '1baa9602ede46ce904c431f5418d8916',
35 'title': 'Try It On Pee_cut_2.wmv - 4shared.com - file sharing - download movie file',
36 'thumbnail': r
're:https?://.*\.jpg',
39 'skip': 'Requires login',
43 (username
, password
) = self
._get
_login
_info
()
47 query
= compat_urllib_parse_urlencode({
50 'url': 'http://www.eroprofile.com/',
52 login_url
= self
._LOGIN
_URL
+ query
53 login_page
= self
._download
_webpage
(login_url
, None, False)
55 m
= re
.search(r
'Your username or password was incorrect\.', login_page
)
58 'Wrong username and/or password.', expected
=True)
61 redirect_url
= self
._search
_regex
(
62 r
'<script[^>]+?src="([^"]+)"', login_page
, 'login redirect url')
63 self
._download
_webpage
(redirect_url
, None, False)
65 def _real_initialize(self
):
68 def _real_extract(self
, url
):
69 display_id
= self
._match
_id
(url
)
71 webpage
= self
._download
_webpage
(url
, display_id
)
73 m
= re
.search(r
'You must be logged in to view this video\.', webpage
)
75 self
.raise_login_required('This video requires login')
77 video_id
= self
._search
_regex
(
78 [r
"glbUpdViews\s*\('\d*','(\d+)'", r
'p/report/video/(\d+)'],
79 webpage
, 'video id', default
=None)
81 title
= self
._html
_search
_regex
(
82 (r
'Title:</th><td>([^<]+)</td>', r
'<h1[^>]*>(.+?)</h1>'),
85 info
= self
._parse
_html
5_media
_entries
(url
, webpage
, video_id
)[0]
87 return merge_dicts(info
, {
89 'display_id': display_id
,