]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/eroprofile.py
316033cf18b42cefead780ceca15b361ebbddac7
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
)
75 'This video requires login. Please specify a username and password and try again.', expected
=True)
77 video_id
= self
._search
_regex
(
78 [r
"glbUpdViews\s*\('\d*','(\d+)'", r
'p/report/video/(\d+)'],
79 webpage
, 'video id', default
=None)
81 video_url
= unescapeHTML(self
._search
_regex
(
82 r
'<source src="([^"]+)', webpage
, 'video url'))
83 title
= self
._html
_search
_regex
(
84 r
'Title:</th><td>([^<]+)</td>', webpage
, 'title')
85 thumbnail
= self
._search
_regex
(
86 r
'onclick="showVideoPlayer\(\)"><img src="([^"]+)',
87 webpage
, 'thumbnail', fatal
=False)
91 'display_id': display_id
,
94 'thumbnail': thumbnail
,