summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-02 10:50:25 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-02 10:50:25 +0200
commitf5084f9c75e5fe1f86b3fc02408133a48b354863 (patch)
tree77258237a2919cd6423e42e38861456d3b937940 /module/plugins/hoster
parent[Account] Improve parse_traffic method + code cosmetics (diff)
downloadpyload-f5084f9c75e5fe1f86b3fc02408133a48b354863.tar.xz
Fix https://github.com/pyload/pyload/issues/1920
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/DateiTo.py4
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py26
-rw-r--r--module/plugins/hoster/UlozTo.py10
-rw-r--r--module/plugins/hoster/UnibytesCom.py7
-rw-r--r--module/plugins/hoster/Xdcc.py1
5 files changed, 26 insertions, 22 deletions
diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py
index 42aed2c77..7cc22158d 100644
--- a/module/plugins/hoster/DateiTo.py
+++ b/module/plugins/hoster/DateiTo.py
@@ -35,7 +35,7 @@ class DateiTo(SimpleHoster):
data = {'P': 'I', 'ID': self.info['pattern']['ID']}
recaptcha = ReCaptcha(self)
- for _i in xrange(10):
+ for _i in xrange(3):
self.log_debug("URL", url, "POST", data)
self.html = self.load(url, post=data)
self.check_errors()
@@ -57,7 +57,7 @@ class DateiTo(SimpleHoster):
if url.endswith('recaptcha.php'):
data['recaptcha_response_field'], data['recaptcha_challenge_field'] = recaptcha.challenge()
else:
- self.fail(_("Too bad..."))
+ return
self.link = self.html
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index 2223068e5..96fec2b48 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class ShareonlineBiz(SimpleHoster):
__name__ = "ShareonlineBiz"
__type__ = "hoster"
- __version__ = "0.58"
+ __version__ = "0.59"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download\.php\?id=|dl/)(?P<ID>\w+)'
@@ -45,11 +45,11 @@ class ShareonlineBiz(SimpleHoster):
try:
if field[1] == "OK":
- info['fileid'] = field[0]
- info['status'] = 2
- info['name'] = field[2]
- info['size'] = field[3] #: In bytes
- info['md5'] = field[4].strip().lower().replace("\n\n", "") #: md5
+ info['fileid'] = field[0]
+ info['status'] = 2
+ info['name'] = field[2]
+ info['size'] = field[3] #: In bytes
+ info['md5'] = field[4].strip().lower().replace("\n\n", "") #: md5
elif field[1] in ("DELETED", "NOTFOUND"):
info['status'] = 1
@@ -102,7 +102,7 @@ class ShareonlineBiz(SimpleHoster):
def check_download(self):
check = self.check_file({'cookie': re.compile(r'<div id="dl_failure"'),
- 'fail' : re.compile(r"<title>Share-Online")})
+ 'fail' : re.compile(r"<title>Share-Online")})
if check == "cookie":
self.retry_captcha(5, 60, _("Cookie failure"))
@@ -114,19 +114,23 @@ class ShareonlineBiz(SimpleHoster):
def handle_premium(self, pyfile): #: Should be working better loading (account) api internally
+ self.api_data = dlinfo = {}
+
html = self.load("https://api.share-online.biz/account.php",
get={'username': self.account.user,
'password': self.account.get_login('password'),
'act' : "download",
'lid' : self.info['fileid']})
- self.api_data = dlinfo = {}
+ self.log_debug(html)
for line in html.splitlines():
- key, value = line.split(": ")
- dlinfo[key.lower()] = value
+ try:
+ key, value = line.split(": ")
+ dlinfo[key.lower()] = value
- self.log_debug(dlinfo)
+ except ValueError:
+ pass
if dlinfo['status'] != "online":
self.offline()
diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py
index cc07770d4..b0df1d97f 100644
--- a/module/plugins/hoster/UlozTo.py
+++ b/module/plugins/hoster/UlozTo.py
@@ -4,6 +4,7 @@ import re
import time
from module.common.json_layer import json_loads
+from module.plugins.internal.Plugin import timestamp
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
@@ -68,13 +69,14 @@ class UlozTo(SimpleHoster):
self.log_debug('Using "new" version')
xapca = self.load("http://www.ulozto.net/reloadXapca.php",
- get={'rnd': str(int(time.time()))})
+ get={'rnd': timestamp()})
+
xapca = xapca.replace('sound":"', 'sound":"http:').replace('image":"', 'image":"http:')
- self.log_debug("xapca = %s" % xapca)
+ self.log_debug("xapca: %s" % xapca)
data = json_loads(xapca)
- captcha_value = self.captcha.decrypt(str(data['image']))
- self.log_debug("CAPTCHA HASH: " + data['hash'], "CAPTCHA SALT: " + str(data['salt']), "CAPTCHA VALUE: " + captcha_value)
+ captcha_value = self.captcha.decrypt(data['image'])
+ self.log_debug("CAPTCHA HASH: " + data['hash'], "CAPTCHA SALT: %s" % data['salt'], "CAPTCHA VALUE: " + captcha_value)
inputs.update({'timestamp': data['timestamp'], 'salt': data['salt'], 'hash': data['hash'], 'captcha_value': captcha_value})
diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py
index 50006dd27..6af02438f 100644
--- a/module/plugins/hoster/UnibytesCom.py
+++ b/module/plugins/hoster/UnibytesCom.py
@@ -35,7 +35,7 @@ class UnibytesCom(SimpleHoster):
self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
- for _i in xrange(8):
+ for _i in xrange(3):
self.log_debug(action, post_data)
self.html = self.load(urlparse.urljoin(domain, action), post=post_data)
@@ -46,7 +46,7 @@ class UnibytesCom(SimpleHoster):
if '>Somebody else is already downloading using your IP-address<' in self.html:
self.wait(10 * 60, True)
- self.retry()
+ self.restart(premium=True)
if post_data['step'] == "last":
m = re.search(self.LINK_FREE_PATTERN, self.html)
@@ -67,9 +67,6 @@ class UnibytesCom(SimpleHoster):
elif last_step in ("captcha", "last"):
post_data['captcha'] = self.captcha.decrypt(urlparse.urljoin(domain, "captcha.jpg"))
- else:
- self.fail(_("No valid captcha code entered"))
-
self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py
index 098143751..4ea286eb8 100644
--- a/module/plugins/hoster/Xdcc.py
+++ b/module/plugins/hoster/Xdcc.py
@@ -43,6 +43,7 @@ class Xdcc(Hoster):
nmn = self.do_download(pyfile.url)
self.log_debug("Download of %s finished." % nmn)
return
+
except socket.error, e:
if hasattr(e, "errno"):
errno = e.errno