summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/AlldebridComHook.py2
-rw-r--r--module/plugins/hooks/AndroidPhoneNotify.py3
-rw-r--r--module/plugins/hooks/BypassCaptcha.py18
-rw-r--r--module/plugins/hooks/Captcha9Kw.py12
-rw-r--r--module/plugins/hooks/CaptchaBrotherhood.py6
-rw-r--r--module/plugins/hooks/DeathByCaptcha.py8
-rw-r--r--module/plugins/hooks/DebridItaliaComHook.py2
-rw-r--r--module/plugins/hooks/EasybytezComHook.py2
-rw-r--r--module/plugins/hooks/ExpertDecoders.py13
-rw-r--r--module/plugins/hooks/ExternalScripts.py5
-rw-r--r--module/plugins/hooks/ExtractArchive.py2
-rw-r--r--module/plugins/hooks/FastixRuHook.py2
-rw-r--r--module/plugins/hooks/FreeWayMeHook.py2
-rw-r--r--module/plugins/hooks/HighWayMeHook.py2
-rw-r--r--module/plugins/hooks/IRCInterface.py5
-rw-r--r--module/plugins/hooks/ImageTyperz.py17
-rw-r--r--module/plugins/hooks/LinkdecrypterComHook.py2
-rw-r--r--module/plugins/hooks/LinksnappyComHook.py2
-rw-r--r--module/plugins/hooks/MegaDebridEuHook.py2
-rw-r--r--module/plugins/hooks/MultishareCzHook.py2
-rw-r--r--module/plugins/hooks/MyfastfileComHook.py2
-rw-r--r--module/plugins/hooks/NoPremiumPlHook.py2
-rw-r--r--module/plugins/hooks/OverLoadMeHook.py2
-rw-r--r--module/plugins/hooks/PremiumToHook.py2
-rw-r--r--module/plugins/hooks/PremiumizeMeHook.py2
-rw-r--r--module/plugins/hooks/RPNetBizHook.py2
-rw-r--r--module/plugins/hooks/RapideoPlHook.py2
-rw-r--r--module/plugins/hooks/RealdebridComHook.py2
-rw-r--r--module/plugins/hooks/RehostToHook.py2
-rw-r--r--module/plugins/hooks/SimplyPremiumComHook.py2
-rw-r--r--module/plugins/hooks/SimplydebridComHook.py2
-rw-r--r--module/plugins/hooks/SkipRev.py3
-rw-r--r--module/plugins/hooks/UpdateManager.py6
-rw-r--r--module/plugins/hooks/UserAgentSwitcher.py2
-rw-r--r--module/plugins/hooks/XMPPInterface.py2
35 files changed, 72 insertions, 72 deletions
diff --git a/module/plugins/hooks/AlldebridComHook.py b/module/plugins/hooks/AlldebridComHook.py
index 092921134..c55f013a4 100644
--- a/module/plugins/hooks/AlldebridComHook.py
+++ b/module/plugins/hooks/AlldebridComHook.py
@@ -22,6 +22,6 @@ class AlldebridComHook(MultiHook):
def getHosters(self):
https = "https" if self.getConfig('ssl') else "http"
- html = self.getURL(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip()
+ html = self.load(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip()
return [x.strip() for x in html.split(",") if x.strip()]
diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py
index e775b785b..daf4c1a27 100644
--- a/module/plugins/hooks/AndroidPhoneNotify.py
+++ b/module/plugins/hooks/AndroidPhoneNotify.py
@@ -2,7 +2,6 @@
import time
-from module.network.RequestFactory import getURL
from module.plugins.internal.Hook import Hook, Expose
@@ -106,7 +105,7 @@ class AndroidPhoneNotify(Hook):
elif self.notifications >= self.getConfig("sendpermin"):
return
- getURL("http://www.notifymyandroid.com/publicapi/notify",
+ self.load("http://www.notifymyandroid.com/publicapi/notify",
get={'apikey' : key,
'application': "pyLoad",
'event' : event,
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py
index bbbe96b73..1651ea067 100644
--- a/module/plugins/hooks/BypassCaptcha.py
+++ b/module/plugins/hooks/BypassCaptcha.py
@@ -3,7 +3,7 @@
import pycurl
from module.network.HTTPRequest import BadHeader
-from module.network.RequestFactory import getURL, getRequest
+from module.network.RequestFactory import getRequest
from module.plugins.internal.Hook import Hook, threaded
@@ -54,7 +54,7 @@ class BypassCaptcha(Hook):
def getCredits(self):
- res = getURL(self.GETCREDITS_URL, post={"key": self.getConfig('passkey')})
+ res = self.load(self.GETCREDITS_URL, post={"key": self.getConfig('passkey')})
data = dict(x.split(' ', 1) for x in res.splitlines())
return int(data['Left'])
@@ -67,12 +67,12 @@ class BypassCaptcha(Hook):
req.c.setopt(pycurl.LOW_SPEED_TIME, 80)
try:
- res = req.load(self.SUBMIT_URL,
- post={'vendor_key': self.PYLOAD_KEY,
- 'key': self.getConfig('passkey'),
- 'gen_task_id': "1",
- 'file': (pycurl.FORM_FILE, captcha)},
- multipart=True)
+ res = self.load(self.SUBMIT_URL,
+ post={'vendor_key': self.PYLOAD_KEY,
+ 'key': self.getConfig('passkey'),
+ 'gen_task_id': "1",
+ 'file': (pycurl.FORM_FILE, captcha)},
+ req=req)
finally:
req.close()
@@ -89,7 +89,7 @@ class BypassCaptcha(Hook):
def respond(self, ticket, success):
try:
- res = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig('passkey'),
+ res = self.load(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig('passkey'),
"cv": 1 if success else 0})
except BadHeader, e:
self.logError(_("Could not send response"), e)
diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py
index 85bbb7924..a67e5bfc3 100644
--- a/module/plugins/hooks/Captcha9Kw.py
+++ b/module/plugins/hooks/Captcha9Kw.py
@@ -8,8 +8,6 @@ import time
from base64 import b64encode
from module.network.HTTPRequest import BadHeader
-from module.network.RequestFactory import getURL
-
from module.plugins.internal.Hook import Hook, threaded
@@ -48,7 +46,7 @@ class Captcha9Kw(Hook):
def getCredits(self):
- res = getURL(self.API_URL,
+ res = self.load(self.API_URL,
get={'apikey': self.getConfig('passkey'),
'pyload': "1",
'source': "pyload",
@@ -129,7 +127,7 @@ class Captcha9Kw(Hook):
for _i in xrange(5):
try:
- res = getURL(self.API_URL, post=post_data)
+ res = self.load(self.API_URL, post=post_data)
except BadHeader, e:
time.sleep(3)
else:
@@ -144,7 +142,7 @@ class Captcha9Kw(Hook):
task.data["ticket"] = res
for _i in xrange(int(self.getConfig('timeout') / 5)):
- result = getURL(self.API_URL,
+ result = self.load(self.API_URL,
get={'apikey': self.getConfig('passkey'),
'id' : res,
'pyload': "1",
@@ -186,7 +184,7 @@ class Captcha9Kw(Hook):
pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1)
for _i in xrange(5):
- servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt")
+ servercheck = self.load("http://www.9kw.eu/grafik/servercheck.txt")
if queue < re.search(r'queue=(\d+)', servercheck).group(1):
break
@@ -227,7 +225,7 @@ class Captcha9Kw(Hook):
passkey = self.getConfig('passkey')
for _i in xrange(3):
- res = getURL(self.API_URL,
+ res = self.load(self.API_URL,
get={'action' : "usercaptchacorrectback",
'apikey' : passkey,
'api_key': passkey,
diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py
index 1f2bbf956..3992c6ca7 100644
--- a/module/plugins/hooks/CaptchaBrotherhood.py
+++ b/module/plugins/hooks/CaptchaBrotherhood.py
@@ -12,7 +12,7 @@ try:
except ImportError:
import Image
-from module.network.RequestFactory import getURL, getRequest
+from module.network.RequestFactory import getRequest
from module.plugins.internal.Hook import Hook, threaded
@@ -59,7 +59,7 @@ class CaptchaBrotherhood(Hook):
def getCredits(self):
- res = getURL(self.API_URL + "askCredits.aspx",
+ res = self.load(self.API_URL + "askCredits.aspx",
get={"username": self.getConfig('username'), "password": self.getConfig('passkey')})
if not res.startswith("OK"):
raise CaptchaBrotherhoodException(res)
@@ -122,7 +122,7 @@ class CaptchaBrotherhood(Hook):
def api_response(self, api, ticket):
- res = getURL("%s%s.aspx" % (self.API_URL, api),
+ res = self.load("%s%s.aspx" % (self.API_URL, api),
get={"username": self.getConfig('username'),
"password": self.getConfig('passkey'),
"captchaID": ticket})
diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py
index 1ece35bdb..50331d512 100644
--- a/module/plugins/hooks/DeathByCaptcha.py
+++ b/module/plugins/hooks/DeathByCaptcha.py
@@ -84,9 +84,11 @@ class DeathByCaptcha(Hook):
res = None
try:
- json = req.load("%s%s" % (self.API_URL, api),
- post=post,
- multipart=multipart)
+ json = self.load("%s%s" % (self.API_URL, api),
+ post=post,
+ multipart=multipart,
+ req=req)
+
self.logDebug(json)
res = json_loads(json)
diff --git a/module/plugins/hooks/DebridItaliaComHook.py b/module/plugins/hooks/DebridItaliaComHook.py
index 36b307696..b9a5f1b60 100644
--- a/module/plugins/hooks/DebridItaliaComHook.py
+++ b/module/plugins/hooks/DebridItaliaComHook.py
@@ -23,4 +23,4 @@ class DebridItaliaComHook(MultiHook):
def getHosters(self):
- return self.getURL("http://debriditalia.com/api.php", get={'hosts': ""}).replace('"', '').split(',')
+ return self.load("http://debriditalia.com/api.php", get={'hosts': ""}).replace('"', '').split(',')
diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py
index 43efb5048..951d95479 100644
--- a/module/plugins/hooks/EasybytezComHook.py
+++ b/module/plugins/hooks/EasybytezComHook.py
@@ -25,6 +25,6 @@ class EasybytezComHook(MultiHook):
user, data = self.account.selectAccount()
req = self.account.getAccountRequest(user)
- html = req.load("http://www.easybytez.com")
+ html = self.load("http://www.easybytez.com", req=req)
return re.search(r'</textarea>\s*Supported sites:(.*)', html).group(1).split(',')
diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py
index 13289f8d1..af5f2cfcd 100644
--- a/module/plugins/hooks/ExpertDecoders.py
+++ b/module/plugins/hooks/ExpertDecoders.py
@@ -8,7 +8,7 @@ import uuid
from base64 import b64encode
from module.network.HTTPRequest import BadHeader
-from module.network.RequestFactory import getURL, getRequest
+from module.network.RequestFactory import getRequest
from module.plugins.internal.Hook import Hook, threaded
@@ -36,7 +36,7 @@ class ExpertDecoders(Hook):
def getCredits(self):
- res = getURL(self.API_URL, post={"key": self.getConfig('passkey'), "action": "balance"})
+ res = self.load(self.API_URL, post={"key": self.getConfig('passkey'), "action": "balance"})
if res.isdigit():
self.logInfo(_("%s credits left") % res)
@@ -60,11 +60,12 @@ class ExpertDecoders(Hook):
req.c.setopt(pycurl.LOW_SPEED_TIME, 80)
try:
- result = req.load(self.API_URL,
- post={'action' : "upload",
+ result = self.load(self.API_URL,
+ post={'action' : "upload",
'key' : self.getConfig('passkey'),
'file' : b64encode(data),
- 'gen_task_id': ticket})
+ 'gen_task_id': ticket},
+ req=req)
finally:
req.close()
@@ -95,7 +96,7 @@ class ExpertDecoders(Hook):
if "ticket" in task.data:
try:
- res = getURL(self.API_URL,
+ res = self.load(self.API_URL,
post={'action': "refund", 'key': self.getConfig('passkey'), 'gen_task_id': task.data['ticket']})
self.logInfo(_("Request refund"), res)
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py
index 85df87a23..6b3d21d68 100644
--- a/module/plugins/hooks/ExternalScripts.py
+++ b/module/plugins/hooks/ExternalScripts.py
@@ -82,11 +82,12 @@ class ExternalScripts(Hook):
def callScript(self, script, *args):
try:
- cmd_args = [fs_encode(str(x) if not isinstance(x, basestring) else x) for x in args]
- cmd = [script] + cmd_args
+ cmd_args = (fs_encode(x) if isinstande(x, basestring) else str(x) for x in args) #@NOTE: `fs_encode` -> `encode` in 0.4.10
self.logDebug("Executing: %s" % os.path.abspath(script), "Args: " + ' '.join(cmd_args))
+ cmd = (script,) + cmd_args
+
p = subprocess.Popen(cmd, bufsize=-1) #@NOTE: output goes to pyload
if self.getConfig('waitend'):
p.communicate()
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 2c0d68f3e..c9f368e9f 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -54,8 +54,8 @@ if os.name != "nt":
from pwd import getpwnam
from module.plugins.internal.Hook import Hook, Expose, threaded
+from module.plugins.internal.Plugin import replace_patterns
from module.plugins.internal.Extractor import ArchiveError, CRCError, PasswordError
-from module.plugins.internal.SimpleHoster import replace_patterns
from module.utils import fs_encode, save_join as fs_join, uniqify
diff --git a/module/plugins/hooks/FastixRuHook.py b/module/plugins/hooks/FastixRuHook.py
index 16e30e93a..24b18cb9f 100644
--- a/module/plugins/hooks/FastixRuHook.py
+++ b/module/plugins/hooks/FastixRuHook.py
@@ -21,7 +21,7 @@ class FastixRuHook(MultiHook):
def getHosters(self):
- html = self.getURL("http://fastix.ru/api_v2",
+ html = self.load("http://fastix.ru/api_v2",
get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y",
'sub' : "allowed_sources"})
host_list = json_loads(html)
diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py
index b4219a953..473bd7d26 100644
--- a/module/plugins/hooks/FreeWayMeHook.py
+++ b/module/plugins/hooks/FreeWayMeHook.py
@@ -21,5 +21,5 @@ class FreeWayMeHook(MultiHook):
def getHosters(self):
user, data = self.account.selectAccount()
- hostis = self.getURL("http://www.free-way.bz/ajax/jd.php", get={"id": 3, "user": user, "pass": data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10
+ hostis = self.load("http://www.free-way.bz/ajax/jd.php", get={"id": 3, "user": user, "pass": data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10
return [x.strip() for x in hostis.split(",") if x.strip()]
diff --git a/module/plugins/hooks/HighWayMeHook.py b/module/plugins/hooks/HighWayMeHook.py
index ff4d3f96b..c04fc969e 100644
--- a/module/plugins/hooks/HighWayMeHook.py
+++ b/module/plugins/hooks/HighWayMeHook.py
@@ -21,6 +21,6 @@ class HighWayMeHook(MultiHook):
def getHosters(self):
- json_data = json_loads(self.getURL("https://high-way.me/api.php",
+ json_data = json_loads(self.load("https://high-way.me/api.php",
get={'hoster': 1}))
return [element['name'] for element in json_data['hoster']]
diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py
index e24691bde..9176f2d2c 100644
--- a/module/plugins/hooks/IRCInterface.py
+++ b/module/plugins/hooks/IRCInterface.py
@@ -11,7 +11,6 @@ from select import select
from threading import Thread
from module.Api import PackageDoesNotExists, FileDoesNotExists
-from module.network.RequestFactory import getURL
from module.plugins.internal.Hook import Hook
from module.utils import formatSize
@@ -76,8 +75,8 @@ class IRCInterface(Thread, Hook):
task.handler.append(self)
task.setWaiting(60)
- html = getURL("http://www.freeimagehosting.net/upload.php",
- post={"attached": (pycurl.FORM_FILE, task.captchaFile)}, multipart=True)
+ html = self.load("http://www.freeimagehosting.net/upload.php",
+ post={"attached": (pycurl.FORM_FILE, task.captchaFile)})
url = re.search(r"\[img\]([^\[]+)\[/img\]\[/url\]", html).group(1)
self.response(_("New Captcha Request: %s") % url)
diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py
index 7fb642250..15097fd5a 100644
--- a/module/plugins/hooks/ImageTyperz.py
+++ b/module/plugins/hooks/ImageTyperz.py
@@ -7,7 +7,7 @@ import re
from base64 import b64encode
-from module.network.RequestFactory import getURL, getRequest
+from module.network.RequestFactory import getRequest
from module.plugins.internal.Hook import Hook, threaded
@@ -56,7 +56,7 @@ class ImageTyperz(Hook):
def getCredits(self):
- res = getURL(self.GETCREDITS_URL,
+ res = self.load(self.GETCREDITS_URL,
post={'action': "REQUESTBALANCE",
'username': self.getConfig('username'),
'password': self.getConfig('passkey')})
@@ -89,11 +89,12 @@ class ImageTyperz(Hook):
data = f.read()
data = b64encode(data)
- res = req.load(self.SUBMIT_URL,
- post={'action': "UPLOADCAPTCHA",
- 'username': self.getConfig('username'),
- 'password': self.getConfig('passkey'), "file": data},
- multipart=multipart)
+ res = self.load(self.SUBMIT_URL,
+ post={'action': "UPLOADCAPTCHA",
+ 'username': self.getConfig('username'),
+ 'password': self.getConfig('passkey'), "file": data},
+ multipart=multipart,
+ req=req)
finally:
req.close()
@@ -134,7 +135,7 @@ class ImageTyperz(Hook):
def captcha_invalid(self, task):
if task.data['service'] == self.__name__ and "ticket" in task.data:
- res = getURL(self.RESPOND_URL,
+ res = self.load(self.RESPOND_URL,
post={'action': "SETBADIMAGE",
'username': self.getConfig('username'),
'password': self.getConfig('passkey'),
diff --git a/module/plugins/hooks/LinkdecrypterComHook.py b/module/plugins/hooks/LinkdecrypterComHook.py
index b2eaece62..76167524b 100644
--- a/module/plugins/hooks/LinkdecrypterComHook.py
+++ b/module/plugins/hooks/LinkdecrypterComHook.py
@@ -23,7 +23,7 @@ class LinkdecrypterComHook(MultiHook):
def getHosters(self):
list = re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)',
- self.getURL("http://linkdecrypter.com/", decode=True).replace("(g)", "")).group(1).split(', ')
+ self.load("http://linkdecrypter.com/").replace("(g)", "")).group(1).split(', ')
try:
list.remove("download.serienjunkies.org")
except ValueError:
diff --git a/module/plugins/hooks/LinksnappyComHook.py b/module/plugins/hooks/LinksnappyComHook.py
index 72282575b..d1bd19f1e 100644
--- a/module/plugins/hooks/LinksnappyComHook.py
+++ b/module/plugins/hooks/LinksnappyComHook.py
@@ -21,7 +21,7 @@ class LinksnappyComHook(MultiHook):
def getHosters(self):
- json_data = self.getURL("http://gen.linksnappy.com/lseAPI.php", get={'act': "FILEHOSTS"})
+ json_data = self.load("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/MegaDebridEuHook.py b/module/plugins/hooks/MegaDebridEuHook.py
index 0de7b4dcf..0e18f6f9d 100644
--- a/module/plugins/hooks/MegaDebridEuHook.py
+++ b/module/plugins/hooks/MegaDebridEuHook.py
@@ -21,7 +21,7 @@ class MegaDebridEuHook(MultiHook):
def getHosters(self):
- reponse = self.getURL("http://www.mega-debrid.eu/api.php", get={'action': "getHosters"})
+ reponse = self.load("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/MultishareCzHook.py b/module/plugins/hooks/MultishareCzHook.py
index 6052b7673..c3e923d9b 100644
--- a/module/plugins/hooks/MultishareCzHook.py
+++ b/module/plugins/hooks/MultishareCzHook.py
@@ -25,5 +25,5 @@ class MultishareCzHook(MultiHook):
def getHosters(self):
- html = self.getURL("http://www.multishare.cz/monitoring/")
+ html = self.load("http://www.multishare.cz/monitoring/")
return re.findall(self.HOSTER_PATTERN, html)
diff --git a/module/plugins/hooks/MyfastfileComHook.py b/module/plugins/hooks/MyfastfileComHook.py
index 20a1cfac2..10d128a31 100644
--- a/module/plugins/hooks/MyfastfileComHook.py
+++ b/module/plugins/hooks/MyfastfileComHook.py
@@ -21,7 +21,7 @@ class MyfastfileComHook(MultiHook):
def getHosters(self):
- json_data = self.getURL("http://myfastfile.com/api.php", get={'hosts': ""}, decode=True)
+ json_data = self.load("http://myfastfile.com/api.php", get={'hosts': ""})
self.logDebug("JSON data", json_data)
json_data = json_loads(json_data)
diff --git a/module/plugins/hooks/NoPremiumPlHook.py b/module/plugins/hooks/NoPremiumPlHook.py
index b5a007ff9..264f3462a 100644
--- a/module/plugins/hooks/NoPremiumPlHook.py
+++ b/module/plugins/hooks/NoPremiumPlHook.py
@@ -21,7 +21,7 @@ class NoPremiumPlHook(MultiHook):
def getHosters(self):
- hostings = json_loads(self.getURL("https://www.nopremium.pl/clipboard.php?json=3").strip())
+ hostings = json_loads(self.load("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"]
self.logDebug(hostings_domains)
diff --git a/module/plugins/hooks/OverLoadMeHook.py b/module/plugins/hooks/OverLoadMeHook.py
index d608a2ecd..a618938a4 100644
--- a/module/plugins/hooks/OverLoadMeHook.py
+++ b/module/plugins/hooks/OverLoadMeHook.py
@@ -22,7 +22,7 @@ class OverLoadMeHook(MultiHook):
def getHosters(self):
https = "https" if self.getConfig('ssl') else "http"
- html = self.getURL(https + "://api.over-load.me/hoster.php",
+ html = self.load(https + "://api.over-load.me/hoster.php",
get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip()
self.logDebug("Hosterlist", html)
diff --git a/module/plugins/hooks/PremiumToHook.py b/module/plugins/hooks/PremiumToHook.py
index 11f0f3c8a..63e3c72c8 100644
--- a/module/plugins/hooks/PremiumToHook.py
+++ b/module/plugins/hooks/PremiumToHook.py
@@ -23,6 +23,6 @@ class PremiumToHook(MultiHook):
def getHosters(self):
user, data = self.account.selectAccount()
- html = self.getURL("http://premium.to/api/hosters.php",
+ html = self.load("http://premium.to/api/hosters.php",
get={'username': user, 'password': data['password']})
return [x.strip() for x in html.replace("\"", "").split(";")]
diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py
index 35ad70970..bc803b1f5 100644
--- a/module/plugins/hooks/PremiumizeMeHook.py
+++ b/module/plugins/hooks/PremiumizeMeHook.py
@@ -26,7 +26,7 @@ class PremiumizeMeHook(MultiHook):
# Get supported hosters list from premiumize.me using the
# json API v1 (see https://secure.premiumize.me/?show=api)
- answer = self.getURL("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10
+ answer = self.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10
get={'method': "hosterlist", 'params[login]': user, 'params[pass]': data['password']})
data = json_loads(answer)
diff --git a/module/plugins/hooks/RPNetBizHook.py b/module/plugins/hooks/RPNetBizHook.py
index 10332948d..872eb7e08 100644
--- a/module/plugins/hooks/RPNetBizHook.py
+++ b/module/plugins/hooks/RPNetBizHook.py
@@ -24,7 +24,7 @@ class RPNetBizHook(MultiHook):
# Get account data
user, data = self.account.selectAccount()
- res = self.getURL("https://premium.rpnet.biz/client_api.php",
+ res = self.load("https://premium.rpnet.biz/client_api.php",
get={'username': user, 'password': data['password'], 'action': "showHosterList"})
hoster_list = json_loads(res)
diff --git a/module/plugins/hooks/RapideoPlHook.py b/module/plugins/hooks/RapideoPlHook.py
index 0400f07ba..f498def2a 100644
--- a/module/plugins/hooks/RapideoPlHook.py
+++ b/module/plugins/hooks/RapideoPlHook.py
@@ -21,7 +21,7 @@ class RapideoPlHook(MultiHook):
def getHosters(self):
- hostings = json_loads(self.getURL("https://www.rapideo.pl/clipboard.php?json=3").strip())
+ hostings = json_loads(self.load("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"]
self.logDebug(hostings_domains)
diff --git a/module/plugins/hooks/RealdebridComHook.py b/module/plugins/hooks/RealdebridComHook.py
index aa0c9f640..d1a503136 100644
--- a/module/plugins/hooks/RealdebridComHook.py
+++ b/module/plugins/hooks/RealdebridComHook.py
@@ -22,6 +22,6 @@ class RealdebridComHook(MultiHook):
def getHosters(self):
https = "https" if self.getConfig('ssl') else "http"
- html = self.getURL(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip()
+ html = self.load(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip()
return [x.strip() for x in html.split(",") if x.strip()]
diff --git a/module/plugins/hooks/RehostToHook.py b/module/plugins/hooks/RehostToHook.py
index a2415129a..febad818a 100644
--- a/module/plugins/hooks/RehostToHook.py
+++ b/module/plugins/hooks/RehostToHook.py
@@ -21,7 +21,7 @@ class RehostToHook(MultiHook):
def getHosters(self):
user, data = self.account.selectAccount()
- html = self.getURL("http://rehost.to/api.php",
+ html = self.load("http://rehost.to/api.php",
get={'cmd' : "get_supported_och_dl",
'long_ses': self.account.getAccountInfo(user)['session']})
return [x.strip() for x in html.replace("\"", "").split(",")]
diff --git a/module/plugins/hooks/SimplyPremiumComHook.py b/module/plugins/hooks/SimplyPremiumComHook.py
index 116e3a76e..e211abd30 100644
--- a/module/plugins/hooks/SimplyPremiumComHook.py
+++ b/module/plugins/hooks/SimplyPremiumComHook.py
@@ -21,7 +21,7 @@ class SimplyPremiumComHook(MultiHook):
def getHosters(self):
- json_data = self.getURL("http://www.simply-premium.com/api/hosts.php", get={'format': "json", 'online': 1})
+ json_data = self.load("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/SimplydebridComHook.py b/module/plugins/hooks/SimplydebridComHook.py
index 01629df99..b844aad49 100644
--- a/module/plugins/hooks/SimplydebridComHook.py
+++ b/module/plugins/hooks/SimplydebridComHook.py
@@ -20,5 +20,5 @@ class SimplydebridComHook(MultiHook):
def getHosters(self):
- html = self.getURL("http://simply-debrid.com/api.php", get={'list': 1})
+ html = self.load("http://simply-debrid.com/api.php", get={'list': 1})
return [x.strip() for x in html.rstrip(';').replace("\"", "").split(";")]
diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py
index 0457f9b55..32454d255 100644
--- a/module/plugins/hooks/SkipRev.py
+++ b/module/plugins/hooks/SkipRev.py
@@ -8,7 +8,6 @@ from types import MethodType
from module.PyFile import PyFile
from module.plugins.internal.Hook import Hook
-from module.plugins.internal.Plugin import Skip
class SkipRev(Hook):
@@ -35,7 +34,7 @@ class SkipRev(Hook):
def _setup(self):
self.pyfile.plugin._setup()
if self.pyfile.hasStatus("skipped"):
- raise Skip(self.pyfile.statusname or self.pyfile.pluginname)
+ self.skip(self.pyfile.statusname or self.pyfile.pluginname)
def _name(self, pyfile):
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index f555e4ff3..26b0cc448 100644
--- a/module/plugins/hooks/UpdateManager.py
+++ b/module/plugins/hooks/UpdateManager.py
@@ -9,7 +9,6 @@ import time
from operator import itemgetter
-from module.network.RequestFactory import getURL
from module.plugins.internal.Hook import Expose, Hook, threaded
from module.utils import save_join as fs_join
@@ -128,7 +127,8 @@ class UpdateManager(Hook):
def server_response(self):
try:
- return getURL(self.SERVER_URL, get={'v': self.core.api.getServerVersion()}).splitlines()
+ return self.load(self.SERVER_URL,
+ get={'v': self.core.api.getServerVersion()}).splitlines()
except Exception:
self.logWarning(_("Unable to retrieve server to get updates"))
@@ -253,7 +253,7 @@ class UpdateManager(Hook):
'oldver': oldver,
'newver': newver})
try:
- content = getURL(url % plugin)
+ content = self.load(url % plugin)
m = VERSION.search(content)
if m and m.group(2) == version:
diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py
index 0504ec9d0..ea2d84a43 100644
--- a/module/plugins/hooks/UserAgentSwitcher.py
+++ b/module/plugins/hooks/UserAgentSwitcher.py
@@ -30,7 +30,7 @@ class UserAgentSwitcher(Hook):
def download_preparing(self, pyfile):
connecttimeout = self.getConfig('connecttimeout')
maxredirs = self.getConfig('maxredirs')
- useragent = self.getConfig('useragent').encode("utf8", "replace") #@TODO: Remove `encode` in 0.4.10
+ useragent = self.getConfig('useragent')
if connecttimeout:
pyfile.plugin.req.http.c.setopt(pycurl.CONNECTTIMEOUT, connecttimeout)
diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py
index 053817bef..f93273df4 100644
--- a/module/plugins/hooks/XMPPInterface.py
+++ b/module/plugins/hooks/XMPPInterface.py
@@ -123,7 +123,7 @@ class XMPPInterface(IRCInterface, JabberClient):
subject = stanza.get_subject()
body = stanza.get_body()
t = stanza.get_type()
- self.logDebug("Message from %s received." % unicode(stanza.get_from()))
+ self.logDebug("Message from %s received." % stanza.get_from())
self.logDebug("Body: %s Subject: %s Type: %s" % (body, subject, t))
if t == "headline":