summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Account.py3
-rw-r--r--module/plugins/Hook.py3
-rw-r--r--module/plugins/MultiHoster.py15
3 files changed, 19 insertions, 2 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py
index e5b90d95e..780a8ee69 100644
--- a/module/plugins/Account.py
+++ b/module/plugins/Account.py
@@ -4,8 +4,7 @@ from time import time
from traceback import print_exc
from threading import RLock
-from module.utils import compare_time, parseFileSize, lock
-from module.config.converter import from_string
+from module.utils import compare_time, parseFileSize, lock, from_string
from module.Api import AccountInfo
from module.network.CookieJar import CookieJar
diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py
index c1090aa70..6e2057f03 100644
--- a/module/plugins/Hook.py
+++ b/module/plugins/Hook.py
@@ -156,6 +156,9 @@ class Hook(Base):
def downloadFinished(self, pyfile):
pass
+ def downloadFailed(self, pyfile):
+ pass
+
def packageFinished(self, pypack):
pass
diff --git a/module/plugins/MultiHoster.py b/module/plugins/MultiHoster.py
index f7e560c10..047b9155e 100644
--- a/module/plugins/MultiHoster.py
+++ b/module/plugins/MultiHoster.py
@@ -2,8 +2,14 @@
from time import time
+from module.utils import remove_chars
+
from Account import Account
+def normalize(domain):
+ """ Normalize domain/plugin name, so they are comparable """
+ return remove_chars(domain.strip().lower(), "-.")
+
#noinspection PyUnresolvedReferences
class MultiHoster(Account):
"""
@@ -36,6 +42,15 @@ class MultiHoster(Account):
"""
raise NotImplementedError
+
+ def isHosterUsuable(self, domain):
+ """ Determine before downloading if hoster should be used.
+
+ :param domain: domain name
+ :return: True to let the MultiHoster download, False to fallback to default plugin
+ """
+ return True
+
def getHosterList(self, force=False):
if self.ts + self.hoster_timeout < time() or force:
req = self.getAccountRequest()