diff options
author | ardi69 <armin@diedering.de> | 2015-04-18 14:08:18 +0200 |
---|---|---|
committer | ardi69 <armin@diedering.de> | 2015-04-18 14:08:18 +0200 |
commit | 6e8f84e1dc06cff6fa9387559992f555182c1774 (patch) | |
tree | 476600f9896fae029880e4049eb4c5e6021b202d /pyload/plugin/hoster | |
parent | fix: config cast (diff) | |
parent | Spare code cosmetics (5) (diff) | |
download | pyload-6e8f84e1dc06cff6fa9387559992f555182c1774.tar.xz |
Merge pull request #3 from vuolter/0.4.10
merge vuolter HEAD
Diffstat (limited to 'pyload/plugin/hoster')
-rw-r--r-- | pyload/plugin/hoster/BitshareCom.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/MegaRapidoNet.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/NoPremiumPl.py | 22 | ||||
-rw-r--r-- | pyload/plugin/hoster/RapideoPl.py | 22 | ||||
-rw-r--r-- | pyload/plugin/hoster/SimplyPremiumCom.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/SmoozedCom.py | 16 | ||||
-rw-r--r-- | pyload/plugin/hoster/UpstoreNet.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/WebshareCz.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/Xdcc.py | 2 | ||||
-rw-r--r-- | pyload/plugin/hoster/ZippyshareCom.py | 2 |
10 files changed, 37 insertions, 37 deletions
diff --git a/pyload/plugin/hoster/BitshareCom.py b/pyload/plugin/hoster/BitshareCom.py index afea970eb..0d26c2d53 100644 --- a/pyload/plugin/hoster/BitshareCom.py +++ b/pyload/plugin/hoster/BitshareCom.py @@ -114,7 +114,7 @@ class BitshareCom(SimpleHoster): recaptcha = ReCaptcha(self) # Try up to 3 times - for i in xrange(3): + for _i in xrange(3): response, challenge = recaptcha.challenge() res = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", post={"request" : "validateCaptcha", diff --git a/pyload/plugin/hoster/MegaRapidoNet.py b/pyload/plugin/hoster/MegaRapidoNet.py index d0c3ad917..311189d1c 100644 --- a/pyload/plugin/hoster/MegaRapidoNet.py +++ b/pyload/plugin/hoster/MegaRapidoNet.py @@ -8,7 +8,7 @@ from pyload.plugin.internal.MultiHoster import MultiHoster def random_with_N_digits(n): rand = "0." not_zero = 0 - for i in range(1, n + 1): + for _i in range(1, n + 1): r = randint(0, 9) if(r > 0): not_zero += 1 diff --git a/pyload/plugin/hoster/NoPremiumPl.py b/pyload/plugin/hoster/NoPremiumPl.py index 109932721..8921afe1c 100644 --- a/pyload/plugin/hoster/NoPremiumPl.py +++ b/pyload/plugin/hoster/NoPremiumPl.py @@ -46,9 +46,9 @@ class NoPremiumPl(MultiHoster): def runFileQuery(self, url, mode=None): query = self.API_QUERY.copy() - query["username"] = self.usr - query["password"] = self.pwd - query["url"] = url + query['username'] = self.usr + query['password'] = self.pwd + query['url'] = url if mode == "fileinfo": query['check'] = 2 @@ -77,24 +77,24 @@ class NoPremiumPl(MultiHoster): self.logDebug(parsed) if "errno" in parsed.keys(): - if parsed["errno"] in self.ERROR_CODES: + if parsed['errno'] in self.ERROR_CODES: # error code in known - self.fail(self.ERROR_CODES[parsed["errno"]] % self.__class__.__name__) + self.fail(self.ERROR_CODES[parsed['errno']] % self.__class__.__name__) else: # error code isn't yet added to plugin self.fail( - parsed["errstring"] - or _("Unknown error (code: %s)") % parsed["errno"] + parsed['errstring'] + or _("Unknown error (code: %s)") % parsed['errno'] ) if "sdownload" in parsed: - if parsed["sdownload"] == "1": + if parsed['sdownload'] == "1": self.fail( _("Download from %s is possible only using NoPremium.pl website \ - directly") % parsed["hosting"]) + directly") % parsed['hosting']) - pyfile.name = parsed["filename"] - pyfile.size = parsed["filesize"] + pyfile.name = parsed['filename'] + pyfile.size = parsed['filesize'] try: self.link = self.runFileQuery(pyfile.url, 'filedownload') diff --git a/pyload/plugin/hoster/RapideoPl.py b/pyload/plugin/hoster/RapideoPl.py index 70e3fd853..e19ccc45b 100644 --- a/pyload/plugin/hoster/RapideoPl.py +++ b/pyload/plugin/hoster/RapideoPl.py @@ -46,9 +46,9 @@ class RapideoPl(MultiHoster): def runFileQuery(self, url, mode=None): query = self.API_QUERY.copy() - query["username"] = self.usr - query["password"] = self.pwd - query["url"] = url + query['username'] = self.usr + query['password'] = self.pwd + query['url'] = url if mode == "fileinfo": query['check'] = 2 @@ -77,24 +77,24 @@ class RapideoPl(MultiHoster): self.logDebug(parsed) if "errno" in parsed.keys(): - if parsed["errno"] in self.ERROR_CODES: + if parsed['errno'] in self.ERROR_CODES: # error code in known - self.fail(self.ERROR_CODES[parsed["errno"]] % self.__class__.__name__) + self.fail(self.ERROR_CODES[parsed['errno']] % self.__class__.__name__) else: # error code isn't yet added to plugin self.fail( - parsed["errstring"] - or _("Unknown error (code: %s)") % parsed["errno"] + parsed['errstring'] + or _("Unknown error (code: %s)") % parsed['errno'] ) if "sdownload" in parsed: - if parsed["sdownload"] == "1": + if parsed['sdownload'] == "1": self.fail( _("Download from %s is possible only using Rapideo.pl website \ - directly") % parsed["hosting"]) + directly") % parsed['hosting']) - pyfile.name = parsed["filename"] - pyfile.size = parsed["filesize"] + pyfile.name = parsed['filename'] + pyfile.size = parsed['filesize'] try: self.link = self.runFileQuery(pyfile.url, 'filedownload') diff --git a/pyload/plugin/hoster/SimplyPremiumCom.py b/pyload/plugin/hoster/SimplyPremiumCom.py index 51b5ac577..327bfdcc1 100644 --- a/pyload/plugin/hoster/SimplyPremiumCom.py +++ b/pyload/plugin/hoster/SimplyPremiumCom.py @@ -46,7 +46,7 @@ class SimplyPremiumCom(MultiHoster): def handlePremium(self, pyfile): - for i in xrange(5): + for _i in xrange(5): self.html = self.load("http://www.simply-premium.com/premium.php", get={'info': "", 'link': self.pyfile.url}) if self.html: diff --git a/pyload/plugin/hoster/SmoozedCom.py b/pyload/plugin/hoster/SmoozedCom.py index 6d62cef23..1ed3a539d 100644 --- a/pyload/plugin/hoster/SmoozedCom.py +++ b/pyload/plugin/hoster/SmoozedCom.py @@ -35,17 +35,17 @@ class SmoozedCom(MultiHoster): data = json_loads(self.load("http://www2.smoozed.com/api/check", get=get_data)) - if data["state"] != "ok": - self.fail(data["message"]) + if data['state'] != "ok": + self.fail(data['message']) - if data["data"].get("state", "ok") != "ok": - if data["data"] == "Offline": + if data['data'].get("state", "ok") != "ok": + if data['data'] == "Offline": self.offline() else: - self.fail(data["data"]["message"]) + self.fail(data['data']['message']) - pyfile.name = data["data"]["name"] - pyfile.size = int(data["data"]["size"]) + pyfile.name = data['data']['name'] + pyfile.size = int(data['data']['size']) # Start the download header = self.load("http://www2.smoozed.com/api/download", get=get_data, just_header=True) @@ -53,7 +53,7 @@ class SmoozedCom(MultiHoster): if not "location" in header: self.fail(_("Unable to initialize download")) else: - self.link = header["location"][-1] if isinstance(header["location"], list) else header["location"] + self.link = header['location'][-1] if isinstance(header['location'], list) else header['location'] def checkFile(self, rules={}): diff --git a/pyload/plugin/hoster/UpstoreNet.py b/pyload/plugin/hoster/UpstoreNet.py index 27fc68dc6..adf63e382 100644 --- a/pyload/plugin/hoster/UpstoreNet.py +++ b/pyload/plugin/hoster/UpstoreNet.py @@ -43,7 +43,7 @@ class UpstoreNet(SimpleHoster): recaptcha = ReCaptcha(self) # try the captcha 5 times - for i in xrange(5): + for _i in xrange(5): m = re.search(self.WAIT_PATTERN, self.html) if m is None: self.error(_("Wait pattern not found")) diff --git a/pyload/plugin/hoster/WebshareCz.py b/pyload/plugin/hoster/WebshareCz.py index 11b7b37b0..49a8da89f 100644 --- a/pyload/plugin/hoster/WebshareCz.py +++ b/pyload/plugin/hoster/WebshareCz.py @@ -34,7 +34,7 @@ class WebshareCz(SimpleHoster): if 'File not found' in api_data: info['status'] = 1 else: - info["status"] = 2 + info['status'] = 2 info['name'] = re.search('<name>(.+)</name>', api_data).group(1) or info['name'] info['size'] = re.search('<size>(.+)</size>', api_data).group(1) or info['size'] diff --git a/pyload/plugin/hoster/Xdcc.py b/pyload/plugin/hoster/Xdcc.py index f2b5d0b8f..42491404f 100644 --- a/pyload/plugin/hoster/Xdcc.py +++ b/pyload/plugin/hoster/Xdcc.py @@ -117,7 +117,7 @@ class Xdcc(Hoster): 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.time(): #@TODO: add in config sock.send("QUIT :byebye\r\n") sock.close() self.fail(_("XDCC Bot did not answer")) diff --git a/pyload/plugin/hoster/ZippyshareCom.py b/pyload/plugin/hoster/ZippyshareCom.py index a062df458..dd78071c9 100644 --- a/pyload/plugin/hoster/ZippyshareCom.py +++ b/pyload/plugin/hoster/ZippyshareCom.py @@ -88,5 +88,5 @@ class ZippyshareCom(SimpleHoster): scripts = ['\n'.join(('try{', script, '} catch(err){}')) for script in scripts] # get the file's url by evaluating all the scripts - scripts = ['var GVAR = {}'] + list(initScripts) + scripts + ['GVAR["dlbutton_href"]'] + scripts = ['var GVAR = {}'] + list(initScripts) + scripts + ['GVAR['dlbutton_href']'] return self.js.eval('\n'.join(scripts)) |