diff options
author | Christopher <4Christopher@gmx.de> | 2013-03-13 16:36:18 +0100 |
---|---|---|
committer | Christopher <4Christopher@gmx.de> | 2013-03-13 16:36:18 +0100 |
commit | c4f66a6bc9222fb0ecbb1ea1fabf98ba90dd6ce8 (patch) | |
tree | 9566b9ed91ab5f564384f912f648d58f83133dda /module/plugins | |
parent | XvidstageCom: Deleted whitespace (diff) | |
parent | EgoFilesCom: premium better handled (diff) | |
download | pyload-c4f66a6bc9222fb0ecbb1ea1fabf98ba90dd6ce8.tar.xz |
Merge branch 'stable' of git://github.com/pyload/pyload into stable
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hoster/EgoFilesCom.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index ad904063c..24e26c7f5 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -13,7 +13,7 @@ class EgoFilesCom(SimpleHoster): __name__ = "EgoFilesCom"
__type__ = "hoster"
__pattern__ = r"https?://(www\.)?egofiles.com/(\w+)"
- __version__ = "0.04"
+ __version__ = "0.07"
__description__ = """Egofiles.com Download Hoster"""
__author_name__ = ("stickell")
__author_mail__ = ("l.stickell@yahoo.it")
@@ -21,6 +21,7 @@ class EgoFilesCom(SimpleHoster): FILE_INFO_PATTERN = r'<div class="down-file">\s+(?P<N>\S+)\s+<div class="file-properties">\s+(File size|Rozmiar): (?P<S>[\w.]+) (?P<U>\w+) \|'
FILE_OFFLINE_PATTERN = r'File size: 0 KB'
WAIT_TIME_PATTERN = r'For next free download you have to wait <strong>((?P<m>\d*)m)? ?((?P<s>\d+)s)?</strong>'
+ DIRECT_LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>'
RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX'
def init(self):
@@ -50,9 +51,9 @@ class EgoFilesCom(SimpleHoster): post_data = {'recaptcha_challenge_field': challenge,
'recaptcha_response_field': response}
self.html = self.load(self.pyfile.url, post=post_data, decode=True)
- m = re.search(r'<a href="(?P<link>[^"]+)">Download ></a>', self.html)
+ m = re.search(self.DIRECT_LINK_PATTERN, self.html)
if not m:
- self.logError('Wrong captcha')
+ self.logInfo('Wrong captcha')
self.invalidCaptcha()
elif hasattr(m, 'group'):
downloadURL = m.group('link')
@@ -67,6 +68,17 @@ class EgoFilesCom(SimpleHoster): self.download(downloadURL)
def handlePremium(self):
- self.download(self.pyfile.url)
+ header = self.load(self.pyfile.url, just_header=True)
+ if header.has_key('location'):
+ self.logDebug('DIRECT LINK from header: ' + header['location'])
+ self.download(header['location'])
+ else:
+ self.html = self.load(self.pyfile.url, decode=True)
+ m = re.search(r'<a href="(?P<link>[^"]+)">Download ></a>', self.html)
+ if not m:
+ self.parseError('Unable to detect direct download url')
+ else:
+ self.logDebug('DIRECT URL from html: ' + m.group('link'))
+ self.download(m.group('link'))
getInfo = create_getInfo(EgoFilesCom)
|