summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/UnibytesCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-09 00:35:51 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-09 00:35:51 +0100
commitfd105f8e51768ec1943cda2375bdfdbe5b0a3951 (patch)
treeccbdbe3cd23c606e8102f11ae4e0722f7e7a3227 /module/plugins/hoster/UnibytesCom.py
parent"New Year" Update: hook plugins (diff)
downloadpyload-fd105f8e51768ec1943cda2375bdfdbe5b0a3951.tar.xz
"New Year" Update: hoster plugins
Diffstat (limited to 'module/plugins/hoster/UnibytesCom.py')
-rw-r--r--module/plugins/hoster/UnibytesCom.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py
index 8c39cce82..cd4e506c4 100644
--- a/module/plugins/hoster/UnibytesCom.py
+++ b/module/plugins/hoster/UnibytesCom.py
@@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UnibytesCom(SimpleHoster):
__name__ = "UnibytesCom"
__type__ = "hoster"
- __version__ = "0.11"
+ __version__ = "0.12"
__pattern__ = r'https?://(?:www\.)?unibytes\.com/[\w .-]{11}B'
@@ -26,12 +26,13 @@ class UnibytesCom(SimpleHoster):
INFO_PATTERN = r'<span[^>]*?id="fileName"[^>]*>(?P<N>[^>]+)</span>\s*\((?P<S>\d.*?)\)'
WAIT_PATTERN = r'Wait for <span id="slowRest">(\d+)</span> sec'
- LINK_PATTERN = r'<a href="([^"]+)">Download</a>'
+ LINK_FREE_PATTERN = r'<a href="([^"]+)">Download</a>'
- def handleFree(self):
- domain = "http://www.%s/" % self.HOSTER_DOMAIN
+ def handleFree(self, pyfile):
+ domain = "http://www.%s/" % self.HOSTER_DOMAIN
action, post_data = self.parseHtmlForm('id="startForm"')
+
self.req.http.c.setopt(FOLLOWLOCATION, 0)
for _i in xrange(8):
@@ -48,7 +49,7 @@ class UnibytesCom(SimpleHoster):
self.retry()
if post_data['step'] == 'last':
- m = re.search(self.LINK_PATTERN, self.html)
+ m = re.search(self.LINK_FREE_PATTERN, self.html)
if m:
url = m.group(1)
self.correctCaptcha()
@@ -62,12 +63,15 @@ class UnibytesCom(SimpleHoster):
if last_step == 'timer':
m = re.search(self.WAIT_PATTERN, self.html)
self.wait(int(m.group(1)) if m else 60, False)
+
elif last_step in ("captcha", "last"):
post_data['captcha'] = self.decryptCaptcha(urljoin(domain, "/captcha.jpg"))
+
else:
self.fail(_("No valid captcha code entered"))
self.req.http.c.setopt(FOLLOWLOCATION, 1)
+
self.download(url)