summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/UnibytesCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/UnibytesCom.py')
-rw-r--r--module/plugins/hoster/UnibytesCom.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py
index abad66579..8c39cce82 100644
--- a/module/plugins/hoster/UnibytesCom.py
+++ b/module/plugins/hoster/UnibytesCom.py
@@ -2,6 +2,8 @@
import re
+from urlparse import urljoin
+
from pycurl import FOLLOWLOCATION
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
@@ -10,30 +12,31 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UnibytesCom(SimpleHoster):
__name__ = "UnibytesCom"
__type__ = "hoster"
- __version__ = "0.1"
+ __version__ = "0.11"
- __pattern__ = r'http://(?:www\.)?unibytes\.com/[\w .-]{11}B'
+ __pattern__ = r'https?://(?:www\.)?unibytes\.com/[\w .-]{11}B'
__description__ = """UniBytes.com hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
- FILE_INFO_PATTERN = r'<span[^>]*?id="fileName"[^>]*>(?P<N>[^>]+)</span>\s*\((?P<S>\d.*?)\)'
+ HOSTER_DOMAIN = "unibytes.com"
+
+ INFO_PATTERN = r'<span[^>]*?id="fileName"[^>]*>(?P<N>[^>]+)</span>\s*\((?P<S>\d.*?)\)'
- HOSTER_NAME = "unibytes.com"
WAIT_PATTERN = r'Wait for <span id="slowRest">(\d+)</span> sec'
LINK_PATTERN = r'<a href="([^"]+)">Download</a>'
def handleFree(self):
- domain = "http://www." + self.HOSTER_NAME
+ 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):
self.logDebug(action, post_data)
- self.html = self.load(domain + action, post=post_data)
+ self.html = self.load(urljoin(domain, action), post=post_data)
m = re.search(r'location:\s*(\S+)', self.req.http.header, re.I)
if m:
@@ -60,7 +63,7 @@ class UnibytesCom(SimpleHoster):
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(domain + '/captcha.jpg')
+ post_data['captcha'] = self.decryptCaptcha(urljoin(domain, "/captcha.jpg"))
else:
self.fail(_("No valid captcha code entered"))