summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/MegaRapidoNet.py2
-rw-r--r--module/plugins/hoster/NoPremiumPl.py22
-rw-r--r--module/plugins/hoster/RapideoPl.py22
-rw-r--r--module/plugins/hoster/SmoozedCom.py16
-rw-r--r--module/plugins/hoster/ZippyshareCom.py2
5 files changed, 32 insertions, 32 deletions
diff --git a/module/plugins/hoster/MegaRapidoNet.py b/module/plugins/hoster/MegaRapidoNet.py
index ee0948bf1..ce31308d0 100644
--- a/module/plugins/hoster/MegaRapidoNet.py
+++ b/module/plugins/hoster/MegaRapidoNet.py
@@ -8,7 +8,7 @@ from module.plugins.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 xrange(1, n + 1):
r = random.randint(0, 9)
if(r > 0):
not_zero += 1
diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py
index ec3699a08..29de7cc77 100644
--- a/module/plugins/hoster/NoPremiumPl.py
+++ b/module/plugins/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.__name__)
+ self.fail(self.ERROR_CODES[parsed['errno']] % self.__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/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py
index 6304bd38a..479371162 100644
--- a/module/plugins/hoster/RapideoPl.py
+++ b/module/plugins/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.__name__)
+ self.fail(self.ERROR_CODES[parsed['errno']] % self.__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/module/plugins/hoster/SmoozedCom.py b/module/plugins/hoster/SmoozedCom.py
index af6c8b68e..ab8e7b714 100644
--- a/module/plugins/hoster/SmoozedCom.py
+++ b/module/plugins/hoster/SmoozedCom.py
@@ -39,17 +39,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)
@@ -57,4 +57,4 @@ 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']
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index 7bae8cc19..302554624 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -87,7 +87,7 @@ 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))