summaryrefslogtreecommitdiffstats
path: root/pyload/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin')
-rw-r--r--pyload/plugin/Account.py2
-rw-r--r--pyload/plugin/account/NoPremiumPl.py12
-rw-r--r--pyload/plugin/account/RapideoPl.py12
-rw-r--r--pyload/plugin/account/SmoozedCom.py8
-rw-r--r--pyload/plugin/account/UploadableCh.py2
-rw-r--r--pyload/plugin/account/WebshareCz.py2
-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/NoPremiumPl.py22
-rw-r--r--pyload/plugin/hoster/RapideoPl.py22
-rw-r--r--pyload/plugin/hoster/SmoozedCom.py16
-rw-r--r--pyload/plugin/hoster/WebshareCz.py2
-rw-r--r--pyload/plugin/hoster/ZippyshareCom.py2
16 files changed, 59 insertions, 59 deletions
diff --git a/pyload/plugin/Account.py b/pyload/plugin/Account.py
index 23f15e8fd..bc13c0497 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)
diff --git a/pyload/plugin/account/NoPremiumPl.py b/pyload/plugin/account/NoPremiumPl.py
index d825b38ed..98f472848 100644
--- a/pyload/plugin/account/NoPremiumPl.py
+++ b/pyload/plugin/account/NoPremiumPl.py
@@ -43,10 +43,10 @@ class NoPremiumPl(Account):
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/RapideoPl.py b/pyload/plugin/account/RapideoPl.py
index d40c76cb5..d1cb47826 100644
--- a/pyload/plugin/account/RapideoPl.py
+++ b/pyload/plugin/account/RapideoPl.py
@@ -42,11 +42,11 @@ class RapideoPl(Account):
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..ae247b2b0 100644
--- a/pyload/plugin/account/SmoozedCom.py
+++ b/pyload/plugin/account/SmoozedCom.py
@@ -46,10 +46,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/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/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/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/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/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))