summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-07 00:27:18 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-07 00:27:18 +0100
commit67587fbe0335cacfde28a86ba729b9d567ce1da7 (patch)
tree090ea3a41894437ce619fe06304508479ace6ab6 /module/plugins/hooks
parentPlugin code cosmetics (2) (diff)
downloadpyload-67587fbe0335cacfde28a86ba729b9d567ce1da7.tar.xz
Plugin code cosmetics (3)
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/AlldebridCom.py2
-rw-r--r--module/plugins/hooks/EasybytezCom.py17
-rw-r--r--module/plugins/hooks/FastixRu.py5
-rw-r--r--module/plugins/hooks/FreeWayMe.py2
-rw-r--r--module/plugins/hooks/LinksnappyCom.py2
-rw-r--r--module/plugins/hooks/MegaDebridEu.py2
-rw-r--r--module/plugins/hooks/MyfastfileCom.py2
-rw-r--r--module/plugins/hooks/OverLoadMe.py3
-rw-r--r--module/plugins/hooks/PremiumizeMe.py4
-rw-r--r--module/plugins/hooks/RPNetBiz.py2
-rw-r--r--module/plugins/hooks/RehostTo.py3
-rw-r--r--module/plugins/hooks/SimplyPremiumCom.py2
-rw-r--r--module/plugins/hooks/SimplydebridCom.py2
-rw-r--r--module/plugins/hooks/UnrestrictLi.py2
-rw-r--r--module/plugins/hooks/ZeveraCom.py2
15 files changed, 28 insertions, 24 deletions
diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py
index c06607a28..2d3c8aad7 100644
--- a/module/plugins/hooks/AlldebridCom.py
+++ b/module/plugins/hooks/AlldebridCom.py
@@ -22,6 +22,6 @@ class AlldebridCom(MultiHoster):
def getHoster(self):
https = "https" if self.getConfig("https") else "http"
- page = getURL(https + "://www.alldebrid.com/api.php?action=get_host").replace("\"", "").strip()
+ page = getURL(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip()
return [x.strip() for x in page.split(",") if x.strip()]
diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py
index 89deaed2b..3faa4fa1a 100644
--- a/module/plugins/hooks/EasybytezCom.py
+++ b/module/plugins/hooks/EasybytezCom.py
@@ -23,14 +23,17 @@ class EasybytezCom(MultiHoster):
user = self.account.selectAccount()[0]
try:
- req = self.account.getAccountRequest(user)
+ req = self.account.getAccountRequest(user)
page = req.load("http://www.easybytez.com")
- m = re.search(r'</textarea>\s*Supported sites:(.*)', page)
- return m.group(1).split(',')
+ hosters = re.search(r'</textarea>\s*Supported sites:(.*)', page).group(1).split(',')
+
except Exception, e:
- self.logDebug(e)
self.logWarning(_("Unable to load supported hoster list, using last known"))
- return ["bitshare.com", "crocko.com", "ddlstorage.com", "depositfiles.com", "extabit.com", "hotfile.com",
- "mediafire.com", "netload.in", "rapidgator.net", "rapidshare.com", "uploading.com", "uload.to",
- "uploaded.to"]
+ self.logDebug(e)
+
+ hosters = ["bitshare.com", "crocko.com", "ddlstorage.com", "depositfiles.com", "extabit.com", "hotfile.com",
+ "mediafire.com", "netload.in", "rapidgator.net", "rapidshare.com", "uploading.com", "uload.to",
+ "uploaded.to"]
+ finally:
+ return hosters
diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py
index fe89a190c..cec6c6f1f 100644
--- a/module/plugins/hooks/FastixRu.py
+++ b/module/plugins/hooks/FastixRu.py
@@ -20,8 +20,9 @@ class FastixRu(MultiHoster):
def getHoster(self):
- page = getURL(
- "http://fastix.ru/api_v2/?apikey=5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y&sub=allowed_sources")
+ page = getURL("http://fastix.ru/api_v2",
+ get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y",
+ 'sub' : "allowed_sources"})
host_list = json_loads(page)
host_list = host_list['allow']
return host_list
diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py
index 1d7dd369e..5abec29ba 100644
--- a/module/plugins/hooks/FreeWayMe.py
+++ b/module/plugins/hooks/FreeWayMe.py
@@ -20,6 +20,6 @@ class FreeWayMe(MultiHoster):
def getHoster(self):
- hostis = getURL("https://www.free-way.me/ajax/jd.php", get={"id": 3}).replace("\"", "").strip()
+ hostis = getURL("https://www.free-way.me/ajax/jd.php", get={'id': 3}).replace("\"", "").strip()
self.logDebug("Hosters", hostis)
return [x.strip() for x in hostis.split(",") if x.strip()]
diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py
index aa130f416..82edc30fd 100644
--- a/module/plugins/hooks/LinksnappyCom.py
+++ b/module/plugins/hooks/LinksnappyCom.py
@@ -21,7 +21,7 @@ class LinksnappyCom(MultiHoster):
def getHoster(self):
- json_data = getURL('http://gen.linksnappy.com/lseAPI.php?act=FILEHOSTS')
+ json_data = getURL("http://gen.linksnappy.com/lseAPI.php", get={'act': "FILEHOSTS"})
json_data = json_loads(json_data)
return json_data['return'].keys()
diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py
index d8e338aec..4f627b7e9 100644
--- a/module/plugins/hooks/MegaDebridEu.py
+++ b/module/plugins/hooks/MegaDebridEu.py
@@ -18,7 +18,7 @@ class MegaDebridEu(MultiHoster):
def getHoster(self):
- reponse = getURL('http://www.mega-debrid.eu/api.php?action=getHosters')
+ reponse = getURL("http://www.mega-debrid.eu/api.php", get={'action': "getHosters"})
json_data = json_loads(reponse)
if json_data['response_code'] == "ok":
diff --git a/module/plugins/hooks/MyfastfileCom.py b/module/plugins/hooks/MyfastfileCom.py
index 07731f1c2..0cf2c6c22 100644
--- a/module/plugins/hooks/MyfastfileCom.py
+++ b/module/plugins/hooks/MyfastfileCom.py
@@ -21,7 +21,7 @@ class MyfastfileCom(MultiHoster):
def getHoster(self):
- json_data = getURL('http://myfastfile.com/api.php?hosts', decode=True)
+ json_data = getURL("http://myfastfile.com/api.php", get={'hosts': ""}, decode=True)
self.logDebug("JSON data", json_data)
json_data = json_loads(json_data)
diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py
index f4cbdd7fe..baa9b0e0a 100644
--- a/module/plugins/hooks/OverLoadMe.py
+++ b/module/plugins/hooks/OverLoadMe.py
@@ -23,8 +23,7 @@ class OverLoadMe(MultiHoster):
def getHoster(self):
https = "https" if self.getConfig("https") else "http"
page = getURL(https + "://api.over-load.me/hoster.php",
- get={"auth": "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}
- ).replace("\"", "").strip()
+ get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip()
self.logDebug("Hosterlist", page)
return [x.strip() for x in page.split(",") if x.strip()]
diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py
index ec21fbcb4..c18e8cf8e 100644
--- a/module/plugins/hooks/PremiumizeMe.py
+++ b/module/plugins/hooks/PremiumizeMe.py
@@ -30,8 +30,8 @@ class PremiumizeMe(MultiHoster):
# Get supported hosters list from premiumize.me using the
# json API v1 (see https://secure.premiumize.me/?show=api)
- answer = getURL("https://api.premiumize.me/pm-api/v1.php?method=hosterlist&params[login]=%s&params[pass]=%s" % (
- user, data['password']))
+ answer = getURL("https://api.premiumize.me/pm-api/v1.php"
+ get={'method': "hosterlist", 'params[login]': user, 'params[pass]': data['password']})
data = json_loads(answer)
# If account is not valid thera are no hosters available
diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py
index 01591354d..e38aa8ea0 100644
--- a/module/plugins/hooks/RPNetBiz.py
+++ b/module/plugins/hooks/RPNetBiz.py
@@ -29,7 +29,7 @@ class RPNetBiz(MultiHoster):
(user, data) = self.account.selectAccount()
res = getURL("https://premium.rpnet.biz/client_api.php",
- get={"username": user, "password": data['password'], "action": "showHosterList"})
+ get={'username': user, 'password': data['password'], 'action': "showHosterList"})
hoster_list = json_loads(res)
# If account is not valid thera are no hosters available
diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py
index c58abf3f3..1bf7d2555 100644
--- a/module/plugins/hooks/RehostTo.py
+++ b/module/plugins/hooks/RehostTo.py
@@ -20,7 +20,8 @@ class RehostTo(MultiHoster):
def getHoster(self):
- page = getURL("http://rehost.to/api.php?cmd=get_supported_och_dl&long_ses=%s" % self.long_ses)
+ page = getURL("http://rehost.to/api.php",
+ get={'cmd': "get_supported_och_dl", 'long_ses': self.long_ses})
return [x.strip() for x in page.replace("\"", "").split(",")]
diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py
index ba0543691..cc7e9183c 100644
--- a/module/plugins/hooks/SimplyPremiumCom.py
+++ b/module/plugins/hooks/SimplyPremiumCom.py
@@ -22,7 +22,7 @@ class SimplyPremiumCom(MultiHoster):
def getHoster(self):
- json_data = getURL('http://www.simply-premium.com/api/hosts.php?format=json&online=1')
+ json_data = getURL("http://www.simply-premium.com/api/hosts.php", get={'format': "json", 'online': 1})
json_data = json_loads(json_data)
host_list = [element['regex'] for element in json_data['result']]
diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py
index 3fbc0459c..173206e75 100644
--- a/module/plugins/hooks/SimplydebridCom.py
+++ b/module/plugins/hooks/SimplydebridCom.py
@@ -18,5 +18,5 @@ class SimplydebridCom(MultiHoster):
def getHoster(self):
- page = getURL("http://simply-debrid.com/api.php?list=1")
+ page = getURL("http://simply-debrid.com/api.php", get={'list': 1})
return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")]
diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py
index 295cfaf5a..d87265ef4 100644
--- a/module/plugins/hooks/UnrestrictLi.py
+++ b/module/plugins/hooks/UnrestrictLi.py
@@ -22,7 +22,7 @@ class UnrestrictLi(MultiHoster):
def getHoster(self):
- json_data = getURL('http://unrestrict.li/api/jdownloader/hosts.php?format=json')
+ json_data = getURL("http://unrestrict.li/api/jdownloader/hosts.php", get={'format': "json"})
json_data = json_loads(json_data)
host_list = [element['host'] for element in json_data['result']]
diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py
index 6ea05de4f..6fafb9666 100644
--- a/module/plugins/hooks/ZeveraCom.py
+++ b/module/plugins/hooks/ZeveraCom.py
@@ -18,5 +18,5 @@ class ZeveraCom(MultiHoster):
def getHoster(self):
- page = getURL("http://www.zevera.com/jDownloader.ashx?cmd=gethosters")
+ page = getURL("http://www.zevera.com/jDownloader.ashx", get={'cmd': "gethosters"})
return [x.strip() for x in page.replace("\"", "").split(",")]