summaryrefslogtreecommitdiffstats
path: root/pyload/plugin
diff options
context:
space:
mode:
authorGravatar ardi69 <armin@diedering.de> 2015-04-18 14:08:18 +0200
committerGravatar ardi69 <armin@diedering.de> 2015-04-18 14:08:18 +0200
commit6e8f84e1dc06cff6fa9387559992f555182c1774 (patch)
tree476600f9896fae029880e4049eb4c5e6021b202d /pyload/plugin
parentfix: config cast (diff)
parentSpare code cosmetics (5) (diff)
downloadpyload-6e8f84e1dc06cff6fa9387559992f555182c1774.tar.xz
Merge pull request #3 from vuolter/0.4.10
merge vuolter HEAD
Diffstat (limited to 'pyload/plugin')
-rw-r--r--pyload/plugin/Account.py8
-rw-r--r--pyload/plugin/Addon.py1
-rw-r--r--pyload/plugin/Plugin.py13
-rw-r--r--pyload/plugin/account/NoPremiumPl.py14
-rw-r--r--pyload/plugin/account/OboomCom.py1
-rw-r--r--pyload/plugin/account/RapideoPl.py14
-rw-r--r--pyload/plugin/account/SmoozedCom.py9
-rw-r--r--pyload/plugin/account/UploadableCh.py2
-rw-r--r--pyload/plugin/account/WebshareCz.py2
-rw-r--r--pyload/plugin/account/ZeveraCom.py5
-rw-r--r--pyload/plugin/addon/UnSkipOnFail.py8
-rw-r--r--pyload/plugin/addon/XMPPInterface.py1
-rw-r--r--pyload/plugin/extractor/SevenZip.py4
-rw-r--r--pyload/plugin/hook/Captcha9Kw.py4
-rw-r--r--pyload/plugin/hook/NoPremiumPl.py2
-rw-r--r--pyload/plugin/hook/RapideoPl.py2
-rw-r--r--pyload/plugin/hook/XFileSharingPro.py4
-rw-r--r--pyload/plugin/hoster/BitshareCom.py2
-rw-r--r--pyload/plugin/hoster/MegaRapidoNet.py2
-rw-r--r--pyload/plugin/hoster/NoPremiumPl.py22
-rw-r--r--pyload/plugin/hoster/RapideoPl.py22
-rw-r--r--pyload/plugin/hoster/SimplyPremiumCom.py2
-rw-r--r--pyload/plugin/hoster/SmoozedCom.py16
-rw-r--r--pyload/plugin/hoster/UpstoreNet.py2
-rw-r--r--pyload/plugin/hoster/WebshareCz.py2
-rw-r--r--pyload/plugin/hoster/Xdcc.py2
-rw-r--r--pyload/plugin/hoster/ZippyshareCom.py2
-rw-r--r--pyload/plugin/internal/SimpleHoster.py5
28 files changed, 87 insertions, 86 deletions
diff --git a/pyload/plugin/Account.py b/pyload/plugin/Account.py
index 23f15e8fd..c46eae5e3 100644
--- a/pyload/plugin/Account.py
+++ b/pyload/plugin/Account.py
@@ -166,7 +166,7 @@ class Account(Base):
infos['timestamp'] = time()
self.infos[name] = infos
- elif "timestamp" in self.infos[name] and self.infos[name]["timestamp"] + self.info_threshold * 60 < time():
+ elif "timestamp" in self.infos[name] and self.infos[name]['timestamp'] + self.info_threshold * 60 < time():
self.logDebug("Reached timeout for account data")
self.scheduleRefresh(name)
@@ -231,7 +231,8 @@ class Account(Base):
""" returns an valid account name and data"""
usable = []
for user, data in self.accounts.iteritems():
- if not data['valid']: continue
+ if not data['valid']:
+ continue
if "time" in data['options'] and data['options']['time']:
time_data = ""
@@ -253,7 +254,8 @@ class Account(Base):
usable.append((user, data))
- if not usable: return None, None
+ if not usable:
+ return None, None
return choice(usable)
diff --git a/pyload/plugin/Addon.py b/pyload/plugin/Addon.py
index 35f010f29..bb90428e4 100644
--- a/pyload/plugin/Addon.py
+++ b/pyload/plugin/Addon.py
@@ -16,7 +16,6 @@ class Expose(object):
def threaded(fn):
-
def run(*args,**kwargs):
addonManager.startThread(fn, *args, **kwargs)
diff --git a/pyload/plugin/Plugin.py b/pyload/plugin/Plugin.py
index c18e16643..54963447c 100644
--- a/pyload/plugin/Plugin.py
+++ b/pyload/plugin/Plugin.py
@@ -57,6 +57,7 @@ class Base(object):
A Base class with log/config/db methods *all* plugin types can use
"""
+
def __init__(self, core):
#: Core instance
self.core = core
@@ -568,7 +569,8 @@ class Plugin(Base):
header = {"code": self.req.code}
for line in res.splitlines():
line = line.strip()
- if not line or ":" not in line: continue
+ if not line or ":" not in line:
+ continue
key, none, value = line.partition(":")
key = key.strip().lower()
@@ -693,8 +695,10 @@ class Plugin(Base):
size = stat(lastDownload)
size = size.st_size
- if api_size and api_size <= size: return None
- elif size > max_size and not read_size: return None
+ if api_size and api_size <= size:
+ return None
+ elif size > max_size and not read_size:
+ return None
self.logDebug("Download Check triggered")
with open(lastDownload, "rb") as f:
@@ -720,7 +724,8 @@ class Plugin(Base):
def getPassword(self):
""" get the password the user provided in the package"""
password = self.pyfile.package().password
- if not password: return ""
+ if not password:
+ return ""
return password
diff --git a/pyload/plugin/account/NoPremiumPl.py b/pyload/plugin/account/NoPremiumPl.py
index d825b38ed..6cefed550 100644
--- a/pyload/plugin/account/NoPremiumPl.py
+++ b/pyload/plugin/account/NoPremiumPl.py
@@ -37,16 +37,16 @@ class NoPremiumPl(Account):
try:
result = json_loads(self.runAuthQuery())
except Exception:
- # todo: return or let it be thrown?
+ #@TODO: return or let it be thrown?
return
premium = False
valid_untill = -1
- if "expire" in result.keys() and result["expire"]:
+ if "expire" in result.keys() and result['expire']:
premium = True
- valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple())
- traffic_left = result["balance"] * 2 ** 20
+ valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result['expire'])).timetuple())
+ traffic_left = result['balance'] * 2 ** 20
return ({
"validuntil": valid_untill,
@@ -57,7 +57,7 @@ class NoPremiumPl(Account):
def login(self, user, data, req):
self._usr = user
- self._pwd = hashlib.sha1(hashlib.md5(data["password"]).hexdigest()).hexdigest()
+ self._pwd = hashlib.sha1(hashlib.md5(data['password']).hexdigest()).hexdigest()
self._req = req
try:
@@ -73,8 +73,8 @@ class NoPremiumPl(Account):
def createAuthQuery(self):
query = self._api_query
- query["username"] = self._usr
- query["password"] = self._pwd
+ query['username'] = self._usr
+ query['password'] = self._pwd
return query
diff --git a/pyload/plugin/account/OboomCom.py b/pyload/plugin/account/OboomCom.py
index 68e083d75..8b33d0612 100644
--- a/pyload/plugin/account/OboomCom.py
+++ b/pyload/plugin/account/OboomCom.py
@@ -8,6 +8,7 @@ try:
except ImportError:
from beaker.crypto.pbkdf2 import pbkdf2
from binascii import b2a_hex
+
class PBKDF2(object):
def __init__(self, passphrase, salt, iterations=1000):
diff --git a/pyload/plugin/account/RapideoPl.py b/pyload/plugin/account/RapideoPl.py
index d40c76cb5..c58414b53 100644
--- a/pyload/plugin/account/RapideoPl.py
+++ b/pyload/plugin/account/RapideoPl.py
@@ -37,16 +37,16 @@ class RapideoPl(Account):
try:
result = json_loads(self.runAuthQuery())
except Exception:
- # todo: return or let it be thrown?
+ #@TODO: return or let it be thrown?
return
premium = False
valid_untill = -1
- if "expire" in result.keys() and result["expire"]:
+ if "expire" in result.keys() and result['expire']:
premium = True
- valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple())
+ valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result['expire'])).timetuple())
- traffic_left = result["balance"]
+ traffic_left = result['balance']
return ({
"validuntil": valid_untill,
@@ -57,7 +57,7 @@ class RapideoPl(Account):
def login(self, user, data, req):
self._usr = user
- self._pwd = hashlib.md5(data["password"]).hexdigest()
+ self._pwd = hashlib.md5(data['password']).hexdigest()
self._req = req
try:
response = json_loads(self.runAuthQuery())
@@ -72,8 +72,8 @@ class RapideoPl(Account):
def createAuthQuery(self):
query = self._api_query
- query["username"] = self._usr
- query["password"] = self._pwd
+ query['username'] = self._usr
+ query['password'] = self._pwd
return query
diff --git a/pyload/plugin/account/SmoozedCom.py b/pyload/plugin/account/SmoozedCom.py
index 7f4beb7d9..f24799caf 100644
--- a/pyload/plugin/account/SmoozedCom.py
+++ b/pyload/plugin/account/SmoozedCom.py
@@ -9,6 +9,7 @@ try:
except ImportError:
from beaker.crypto.pbkdf2 import pbkdf2
from binascii import b2a_hex
+
class PBKDF2(object):
def __init__(self, passphrase, salt, iterations=1000):
@@ -46,10 +47,10 @@ class SmoozedCom(Account):
'premium' : False}
else:
# Parse account info
- info = {'validuntil' : float(status["data"]["user"]["user_premium"]),
- 'trafficleft': max(0, status["data"]["traffic"][1] - status["data"]["traffic"][0]),
- 'session' : status["data"]["session_key"],
- 'hosters' : [hoster["name"] for hoster in status["data"]["hoster"]]}
+ info = {'validuntil' : float(status['data']['user']['user_premium']),
+ 'trafficleft': max(0, status['data']['traffic'][1] - status['data']['traffic'][0]),
+ 'session' : status['data']['session_key'],
+ 'hosters' : [hoster['name'] for hoster in status['data']['hoster']]}
if info['validuntil'] < time.time():
info['premium'] = False
diff --git a/pyload/plugin/account/UploadableCh.py b/pyload/plugin/account/UploadableCh.py
index 15717db44..c95fe7f0b 100644
--- a/pyload/plugin/account/UploadableCh.py
+++ b/pyload/plugin/account/UploadableCh.py
@@ -25,7 +25,7 @@ class UploadableCh(Account):
def login(self, user, data, req):
html = req.load("http://www.uploadable.ch/login.php",
post={'userName' : user,
- 'userPassword' : data["password"],
+ 'userPassword' : data['password'],
'autoLogin' : "1",
'action__login': "normalLogin"},
decode=True)
diff --git a/pyload/plugin/account/WebshareCz.py b/pyload/plugin/account/WebshareCz.py
index 47dfed255..5cbe6b1b8 100644
--- a/pyload/plugin/account/WebshareCz.py
+++ b/pyload/plugin/account/WebshareCz.py
@@ -51,7 +51,7 @@ class WebshareCz(Account):
self.wrongPassword()
salt = re.search('<salt>(.+)</salt>', salt).group(1)
- password = sha1(md5_crypt.encrypt(data["password"], salt=salt)).hexdigest()
+ password = sha1(md5_crypt.encrypt(data['password'], salt=salt)).hexdigest()
digest = md5(user + ":Webshare:" + password).hexdigest()
login = req.load("https://webshare.cz/api/login/",
diff --git a/pyload/plugin/account/ZeveraCom.py b/pyload/plugin/account/ZeveraCom.py
index 25c2c5512..1e5eacb4c 100644
--- a/pyload/plugin/account/ZeveraCom.py
+++ b/pyload/plugin/account/ZeveraCom.py
@@ -19,11 +19,6 @@ 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)
-
-
def init(self):
if not self.HOSTER_DOMAIN:
self.logError(_("Missing HOSTER_DOMAIN"))
diff --git a/pyload/plugin/addon/UnSkipOnFail.py b/pyload/plugin/addon/UnSkipOnFail.py
index 7fa9ef4e2..048547a1b 100644
--- a/pyload/plugin/addon/UnSkipOnFail.py
+++ b/pyload/plugin/addon/UnSkipOnFail.py
@@ -7,7 +7,7 @@ from pyload.plugin.Addon import Addon
class UnSkipOnFail(Addon):
__name = "UnSkipOnFail"
__type = "addon"
- __version = "0.06"
+ __version = "0.07"
__config = [("activated", "bool", "Activated", True)]
@@ -25,9 +25,9 @@ class UnSkipOnFail(Addon):
msg = _("Looking for skipped duplicates of: %s (pid:%s)")
self.logInfo(msg % (pyfile.name, pyfile.package().id))
- dup = self.findDuplicate(pyfile)
- if dup:
- self.logInfo(_("Queue found duplicate: %s (pid:%s)") % (dup.name, dup.packageID))
+ link = self.findDuplicate(pyfile)
+ if link:
+ self.logInfo(_("Queue found duplicate: %s (pid:%s)") % (link.name, link.packageID))
#: Change status of "link" to "new_status".
# "link" has to be a valid FileData object,
diff --git a/pyload/plugin/addon/XMPPInterface.py b/pyload/plugin/addon/XMPPInterface.py
index 2733cfde0..c977042e6 100644
--- a/pyload/plugin/addon/XMPPInterface.py
+++ b/pyload/plugin/addon/XMPPInterface.py
@@ -210,7 +210,6 @@ class XMPPInterface(IRCInterface, JabberClient):
class VersionHandler(object):
"""Provides handler for a version query.
-
This class will answer version query and announce 'jabber:iq:version' namespace
in the client's disco#info results."""
diff --git a/pyload/plugin/extractor/SevenZip.py b/pyload/plugin/extractor/SevenZip.py
index b6d86adab..9d01965e0 100644
--- a/pyload/plugin/extractor/SevenZip.py
+++ b/pyload/plugin/extractor/SevenZip.py
@@ -139,8 +139,8 @@ class SevenZip(UnRar):
args.append("-y")
#set a password
- if "password" in kwargs and kwargs["password"]:
- args.append("-p%s" % kwargs["password"])
+ if "password" in kwargs and kwargs['password']:
+ args.append("-p%s" % kwargs['password'])
else:
args.append("-p-")
diff --git a/pyload/plugin/hook/Captcha9Kw.py b/pyload/plugin/hook/Captcha9Kw.py
index 9cb8e7928..bbf283623 100644
--- a/pyload/plugin/hook/Captcha9Kw.py
+++ b/pyload/plugin/hook/Captcha9Kw.py
@@ -138,7 +138,7 @@ class Captcha9kw(Hook):
self.logDebug(_("NewCaptchaID ticket: %s") % res, task.captchaFile)
- task.data["ticket"] = res
+ task.data['ticket'] = res
for _i in xrange(int(self.getConfig('timeout') / 5)):
result = getURL(self.API_URL,
@@ -231,7 +231,7 @@ class Captcha9kw(Hook):
'correct': "1" if correct else "2",
'pyload' : "1",
'source' : "pyload",
- 'id' : task.data["ticket"]})
+ 'id' : task.data['ticket']})
self.logDebug("Request %s: %s" % (type, res))
diff --git a/pyload/plugin/hook/NoPremiumPl.py b/pyload/plugin/hook/NoPremiumPl.py
index 05bd6c0ba..527413a88 100644
--- a/pyload/plugin/hook/NoPremiumPl.py
+++ b/pyload/plugin/hook/NoPremiumPl.py
@@ -22,7 +22,7 @@ class NoPremiumPl(MultiHook):
def getHosters(self):
hostings = json_loads(self.getURL("https://www.nopremium.pl/clipboard.php?json=3").strip())
- hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"]
+ hostings_domains = [domain for row in hostings for domain in row['domains'] if row['sdownload'] == "0"]
self.logDebug(hostings_domains)
diff --git a/pyload/plugin/hook/RapideoPl.py b/pyload/plugin/hook/RapideoPl.py
index a850c7710..1761659db 100644
--- a/pyload/plugin/hook/RapideoPl.py
+++ b/pyload/plugin/hook/RapideoPl.py
@@ -22,7 +22,7 @@ class RapideoPl(MultiHook):
def getHosters(self):
hostings = json_loads(self.getURL("https://www.rapideo.pl/clipboard.php?json=3").strip())
- hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"]
+ hostings_domains = [domain for row in hostings for domain in row['domains'] if row['sdownload'] == "0"]
self.logDebug(hostings_domains)
diff --git a/pyload/plugin/hook/XFileSharingPro.py b/pyload/plugin/hook/XFileSharingPro.py
index 1f3a27fd5..3c16c618a 100644
--- a/pyload/plugin/hook/XFileSharingPro.py
+++ b/pyload/plugin/hook/XFileSharingPro.py
@@ -82,7 +82,7 @@ class XFileSharingPro(Hook):
pattern = self.regexp[type][1] % match_list.replace('.', '\.')
- dict = self.core.pluginManager.plugins[type]["XFileSharingPro"]
+ dict = self.core.pluginManager.plugins[type]['XFileSharingPro']
dict['pattern'] = pattern
dict['re'] = re.compile(pattern)
@@ -90,7 +90,7 @@ class XFileSharingPro(Hook):
def _unload(self, type):
- dict = self.core.pluginManager.plugins[type]["XFileSharingPro"]
+ dict = self.core.pluginManager.plugins[type]['XFileSharingPro']
dict['pattern'] = r'^unmatchable$'
dict['re'] = re.compile(dict['pattern'])
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))
diff --git a/pyload/plugin/internal/SimpleHoster.py b/pyload/plugin/internal/SimpleHoster.py
index add54786f..930f5a313 100644
--- a/pyload/plugin/internal/SimpleHoster.py
+++ b/pyload/plugin/internal/SimpleHoster.py
@@ -418,7 +418,7 @@ class SimpleHoster(Hoster):
self.info = {}
self.html = ""
- self.link = "" #@TODO: Move to hoster class in 0.4.10
+ self.link = "" #@TODO: Move to hoster class in 0.4.10
self.directDL = False #@TODO: Move to hoster class in 0.4.10
self.multihost = False #@TODO: Move to hoster class in 0.4.10
@@ -652,9 +652,8 @@ class SimpleHoster(Hoster):
self.checkStatus(getinfo=False)
- #: Deprecated
-
+ #: Deprecated
def getFileInfo(self):
self.info = {}
self.checkInfo()