diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-10 19:53:09 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-10 19:53:09 +0100 |
commit | aac6063859b9036612e86fb4029dc010d5c5d1e0 (patch) | |
tree | b29d1243838f3e5aca90f11181ee25defce5702a /module/plugins | |
parent | [MultiHoster] Use content-disposition (diff) | |
download | pyload-aac6063859b9036612e86fb4029dc010d5c5d1e0.tar.xz |
Code cosmetics
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/accounts/ZeveraCom.py | 8 | ||||
-rw-r--r-- | module/plugins/hoster/NetloadIn.py | 5 | ||||
-rw-r--r-- | module/plugins/hoster/Xdcc.py | 21 | ||||
-rw-r--r-- | module/plugins/internal/MultiHook.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/MultiHoster.py | 4 | ||||
-rw-r--r-- | module/plugins/internal/XFSAccount.py | 4 |
6 files changed, 24 insertions, 20 deletions
diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py index d863e4b37..8c7ab161e 100644 --- a/module/plugins/accounts/ZeveraCom.py +++ b/module/plugins/accounts/ZeveraCom.py @@ -17,8 +17,8 @@ class ZeveraCom(Account): HOSTER_DOMAIN = "zevera.com" - - + + def __init__(self, manager, accounts): #@TODO: remove in 0.4.10 self.init() return super(ZeveraCom, self).__init__(manager, accounts) @@ -30,8 +30,8 @@ class ZeveraCom(Account): if not self.API_URL: self.API_URL = "http://api.%s/jDownloader.ashx" % (self.HOSTER_DOMAIN or "") - - + + def loadAccountInfo(self, user, req): validuntil = None trafficleft = None diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 27fc08033..35c814656 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -3,7 +3,7 @@ import re from urlparse import urljoin -from time import sleep, time +from time import time from module.network.RequestFactory import getURL from module.plugins.Hoster import Hoster @@ -129,7 +129,8 @@ class NetloadIn(Hoster): get={"file_id": match.group(1), "auth": "Zf9SnQh9WiReEsb18akjvQGqT0I830e8", "bz": "1", "md5": "1"}, decode=True).strip() if not html and n <= 3: - sleep(0.2) + self.setWait(2) + self.wait() self.api_load(n + 1) return diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index ef6da4a71..bfa62b8db 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -4,11 +4,11 @@ import re import socket import struct import sys -import time from os import makedirs from os.path import exists, join from select import select +from time import time from module.plugins.Hoster import Hoster from module.utils import save_join @@ -84,15 +84,18 @@ class Xdcc(Hoster): ####################### # CONNECT TO IRC AND IDLE FOR REAL LINK - dl_time = time.time() + dl_time = time() sock = socket.socket() sock.connect((host, int(port))) if nick == "pyload": - nick = "pyload-%d" % (time.time() % 1000) # last 3 digits + nick = "pyload-%d" % (time() % 1000) # last 3 digits sock.send("NICK %s\r\n" % nick) sock.send("USER %s %s bla :%s\r\n" % (ident, host, real)) - time.sleep(3) + + self.setWait(3) + self.wait() + sock.send("JOIN #%s\r\n" % chan) sock.send("PRIVMSG %s :xdcc send #%s\r\n" % (bot, pack)) @@ -108,13 +111,13 @@ class Xdcc(Hoster): break if retry: - if time.time() > retry: + if time() > retry: retry = None - dl_time = time.time() + dl_time = time() sock.send("PRIVMSG %s :xdcc send #%s\r\n" % (bot, pack)) else: - if (dl_time + self.timeout) < time.time(): # todo: add in config + if (dl_time + self.timeout) < time(): # todo: add in config sock.send("QUIT :byebye\r\n") sock.close() self.fail(_("XDCC Bot did not answer")) @@ -156,7 +159,7 @@ class Xdcc(Hoster): sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface")) elif msg['text'] == "\x01TIME\x01": self.logDebug("Sending CTCP TIME") - sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time())) + sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time())) elif msg['text'] == "\x01LAG\x01": pass # don't know how to answer @@ -169,7 +172,7 @@ class Xdcc(Hoster): print "%s: %s" % (msg['origin'], msg['text']) if "You already requested that pack" in msg['text']: - retry = time.time() + 300 + retry = time() + 300 if "you must be on a known channel to request a pack" in msg['text']: self.fail(_("Wrong channel")) diff --git a/module/plugins/internal/MultiHook.py b/module/plugins/internal/MultiHook.py index ac53c0c9c..8bf72f21b 100644 --- a/module/plugins/internal/MultiHook.py +++ b/module/plugins/internal/MultiHook.py @@ -285,7 +285,7 @@ class MultiHook(Hook): else: retries = max(self.getConfig("retry", 10), 0) wait_time = max(self.getConfig("retryinterval", 1), 0) - + if 0 < retries > pyfile.plugin.retries: pyfile.plugin.retries += 1 pyfile.plugin.setCustomStatus("MultiHook", "queued") diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py index eca7e9ecd..8ca4d427f 100644 --- a/module/plugins/internal/MultiHoster.py +++ b/module/plugins/internal/MultiHoster.py @@ -76,13 +76,13 @@ class MultiHoster(SimpleHoster): self.downloadLink(self.link) self.checkFile() - + #@TODO: Remove in 0.4.10 def downloadLink(self, link): if link and isinstance(link, basestring): self.correctCaptcha() self.download(link, disposition=True) - + def handlePremium(self, pyfile): return self.handleFree(pyfile) diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index a767a878f..c350729ac 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" - __version__ = "0.34" + __version__ = "0.35" __description__ = """XFileSharing account plugin""" __license__ = "GPLv3" @@ -48,7 +48,7 @@ class XFSAccount(Account): self.logError(_("Missing HOSTER_DOMAIN")) if not self.HOSTER_URL: - self.HOSTER_URL = "http://www.%s/" % self.HOSTER_DOMAIN or "" + self.HOSTER_URL = "http://www.%s/" % (self.HOSTER_DOMAIN or "") def loadAccountInfo(self, user, req): |