summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hooks/EasybytezComHook.py2
-rw-r--r--module/plugins/hooks/RehostToHook.py2
-rw-r--r--module/plugins/hooks/SmoozedComHook.py2
-rw-r--r--module/plugins/internal/Account.py7
-rw-r--r--module/plugins/internal/Addon.py5
-rw-r--r--module/plugins/internal/Captcha.py6
-rw-r--r--module/plugins/internal/Extractor.py6
-rw-r--r--module/plugins/internal/Hoster.py5
-rw-r--r--module/plugins/internal/OCR.py8
-rw-r--r--module/plugins/internal/Plugin.py8
10 files changed, 23 insertions, 28 deletions
diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py
index 9e33bbad0..6f53619ac 100644
--- a/module/plugins/hooks/EasybytezComHook.py
+++ b/module/plugins/hooks/EasybytezComHook.py
@@ -22,7 +22,7 @@ class EasybytezComHook(MultiHook):
def get_hosters(self):
- user, data = self.account.select()
+ user, info = self.account.select()
html = self.load("http://www.easybytez.com",
req=self.account.get_request(user))
diff --git a/module/plugins/hooks/RehostToHook.py b/module/plugins/hooks/RehostToHook.py
index 58367e241..7bb27e820 100644
--- a/module/plugins/hooks/RehostToHook.py
+++ b/module/plugins/hooks/RehostToHook.py
@@ -20,7 +20,7 @@ class RehostToHook(MultiHook):
def get_hosters(self):
- user, data = self.account.select()
+ user, info = self.account.select()
html = self.load("http://rehost.to/api.php",
get={'cmd' : "get_supported_och_dl",
'long_ses': self.account.get_data(user)['session']})
diff --git a/module/plugins/hooks/SmoozedComHook.py b/module/plugins/hooks/SmoozedComHook.py
index 6b9b688ff..b9825b223 100644
--- a/module/plugins/hooks/SmoozedComHook.py
+++ b/module/plugins/hooks/SmoozedComHook.py
@@ -20,5 +20,5 @@ class SmoozedComHook(MultiHook):
def get_hosters(self):
- user, data = self.account.select()
+ user, info = self.account.select()
return self.account.get_data(user)['hosters']
diff --git a/module/plugins/internal/Account.py b/module/plugins/internal/Account.py
index 021dedf60..1da31eede 100644
--- a/module/plugins/internal/Account.py
+++ b/module/plugins/internal/Account.py
@@ -13,7 +13,7 @@ from module.utils import compare_time, lock, parseFileSize as parse_size
class Account(Plugin):
__name__ = "Account"
__type__ = "account"
- __version__ = "0.13"
+ __version__ = "0.14"
__status__ = "testing"
__description__ = """Base account plugin"""
@@ -27,10 +27,9 @@ class Account(Plugin):
def __init__(self, manager, accounts):
- self.pyload = manager.core
- self.info = {} #: Provide information in dict here
+ self._init(manager.core)
+
self.lock = threading.RLock()
- self.req = None
self.accounts = accounts #@TODO: Remove in 0.4.10
self.init()
diff --git a/module/plugins/internal/Addon.py b/module/plugins/internal/Addon.py
index 649eccbc1..a2d51aa50 100644
--- a/module/plugins/internal/Addon.py
+++ b/module/plugins/internal/Addon.py
@@ -25,7 +25,7 @@ def threaded(fn):
class Addon(Plugin):
__name__ = "Addon"
__type__ = "hook" #@TODO: Change to `addon` in 0.4.10
- __version__ = "0.03"
+ __version__ = "0.04"
__status__ = "testing"
__config__ = [] #: [("name", "type", "desc", "default")]
@@ -37,8 +37,7 @@ class Addon(Plugin):
def __init__(self, core, manager):
- self.pyload = core
- self.info = {} #: Provide information in dict here
+ self._init(core)
#: `HookManager`
self.manager = manager
diff --git a/module/plugins/internal/Captcha.py b/module/plugins/internal/Captcha.py
index 14308fbf5..3ebe42a89 100644
--- a/module/plugins/internal/Captcha.py
+++ b/module/plugins/internal/Captcha.py
@@ -12,7 +12,7 @@ from module.plugins.internal.Plugin import Plugin
class Captcha(Plugin):
__name__ = "Captcha"
__type__ = "captcha"
- __version__ = "0.39"
+ __version__ = "0.40"
__status__ = "testing"
__description__ = """Base anti-captcha plugin"""
@@ -21,9 +21,9 @@ class Captcha(Plugin):
def __init__(self, plugin): #@TODO: Pass pyfile instead plugin, so store plugin's html in its associated pyfile as data
- self.pyload = plugin.pyload
+ self._init(plugin.pyload)
+
self.plugin = plugin
- self.info = {} #: Provide information in dict here
self.task = None #: captchaManager task
self.init()
diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py
index c16b1a846..7d1f9ced5 100644
--- a/module/plugins/internal/Extractor.py
+++ b/module/plugins/internal/Extractor.py
@@ -22,7 +22,7 @@ class PasswordError(Exception):
class Extractor(Plugin):
__name__ = "Extractor"
__type__ = "extractor"
- __version__ = "0.31"
+ __version__ = "0.32"
__status__ = "testing"
__description__ = """Base extractor plugin"""
@@ -86,9 +86,7 @@ class Extractor(Plugin):
"""
Initialize extractor for specific file
"""
- self.pyload = plugin.pyload
- self.plugin = plugin
- self.info = {} #: Provide information in dict here
+ self._init(plugin.pyload)
self.filename = filename
self.out = out
diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py
index d707154bb..edc6f5d30 100644
--- a/module/plugins/internal/Hoster.py
+++ b/module/plugins/internal/Hoster.py
@@ -43,7 +43,7 @@ def create_getInfo(klass):
class Hoster(Plugin):
__name__ = "Hoster"
__type__ = "hoster"
- __version__ = "0.16"
+ __version__ = "0.17"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
@@ -58,8 +58,7 @@ class Hoster(Plugin):
def __init__(self, pyfile):
- self.pyload = pyfile.m.core
- self.info = {} #: Provide information in dict here
+ self._init(pyfile.m.core)
#: Engage wan reconnection
self.wantReconnect = False #@TODO: Change to `want_reconnect` in 0.4.10
diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py
index 805755f39..a9982b076 100644
--- a/module/plugins/internal/OCR.py
+++ b/module/plugins/internal/OCR.py
@@ -21,7 +21,7 @@ from module.utils import save_join as fs_join
class OCR(Plugin):
__name__ = "OCR"
__type__ = "ocr"
- __version__ = "0.17"
+ __version__ = "0.18"
__status__ = "testing"
__description__ = """OCR base plugin"""
@@ -30,11 +30,7 @@ class OCR(Plugin):
def __init__(self, plugin):
- self.pyload = plugin.pyload
- self.plugin = plugin
- self.info = {} #: Provide information in dict here
-
- self.init()
+ super(OCR, self).__init__(plugin.pyload)
def init(self):
diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py
index 3d53b7d2d..601acd491 100644
--- a/module/plugins/internal/Plugin.py
+++ b/module/plugins/internal/Plugin.py
@@ -142,7 +142,7 @@ def chunks(iterable, size):
class Plugin(object):
__name__ = "Plugin"
__type__ = "hoster"
- __version__ = "0.24"
+ __version__ = "0.25"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
@@ -157,10 +157,14 @@ class Plugin(object):
def __init__(self, core):
+ self._init(core)
+ self.init()
+
+
+ def _init(self, core):
self.pyload = core
self.info = {} #: Provide information in dict here
self.req = None
- self.init()
def init(self):