summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/EgoFilesCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-10 03:02:26 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-10 03:02:26 +0200
commit04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 (patch)
tree703010e32f62bf869551ce0d323dacf62bc448ff /module/plugins/hoster/EgoFilesCom.py
parent[SimpleCrypter] Support parseError (diff)
downloadpyload-04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8.tar.xz
Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics
Diffstat (limited to 'module/plugins/hoster/EgoFilesCom.py')
-rw-r--r--module/plugins/hoster/EgoFilesCom.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py
index 000a89901..2a7c3c508 100644
--- a/module/plugins/hoster/EgoFilesCom.py
+++ b/module/plugins/hoster/EgoFilesCom.py
@@ -35,8 +35,9 @@ class EgoFilesCom(SimpleHoster):
FILE_INFO_PATTERN = r'<div class="down-file">\s+(?P<N>[^\t]+)\s+<div class="file-properties">\s+(File size|Rozmiar): (?P<S>[\w.]+) (?P<U>\w+) \|'
OFFLINE_PATTERN = r'(File size|Rozmiar): 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'
+ LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>'
+ RECAPTCHA_KEY = "6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX"
+
def setup(self):
# Set English language
@@ -58,14 +59,14 @@ class EgoFilesCom(SimpleHoster):
waittime = int(m['m']) * 60 + int(m['s'])
self.wait(waittime, True)
- downloadURL = ''
+ downloadURL = r''
recaptcha = ReCaptcha(self)
for _ in xrange(5):
challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
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(self.DIRECT_LINK_PATTERN, self.html)
+ m = re.search(self.LINK_PATTERN, self.html)
if not m:
self.logInfo('Wrong captcha')
self.invalidCaptcha()