diff options
Diffstat (limited to 'module/plugins/internal')
-rw-r--r-- | module/plugins/internal/Account.py | 6 | ||||
-rw-r--r-- | module/plugins/internal/AdYouLike.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/AdsCaptcha.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/DeadCrypter.py | 13 | ||||
-rw-r--r-- | module/plugins/internal/DeadHoster.py | 13 | ||||
-rw-r--r-- | module/plugins/internal/Hoster.py | 6 | ||||
-rw-r--r-- | module/plugins/internal/MultiHook.py | 4 | ||||
-rw-r--r-- | module/plugins/internal/Plugin.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/ReCaptcha.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 8 | ||||
-rw-r--r-- | module/plugins/internal/SolveMedia.py | 6 |
11 files changed, 31 insertions, 33 deletions
diff --git a/module/plugins/internal/Account.py b/module/plugins/internal/Account.py index 8fd16bba9..b437b4a55 100644 --- a/module/plugins/internal/Account.py +++ b/module/plugins/internal/Account.py @@ -6,7 +6,7 @@ import time import traceback from module.plugins.internal.Plugin import Plugin -from module.utils import compare_time, lock, parseFileSize +from module.utils import compare_time, lock, parseFileSize as parse_size class WrongPassword(Exception): @@ -266,7 +266,7 @@ class Account(Plugin): if not compare_time(start.split(":"), end.split(":")): continue except Exception: - self.log_warning(_("Your Time %s has wrong format, use: 1:22-3:44") % time_data) + self.log_warning(_("Your Time %s has wrong format, use 1:22-3:44") % time_data) if user in self.infos: if "validuntil" in self.infos[user]: @@ -291,7 +291,7 @@ class Account(Plugin): def parse_traffic(self, value, unit=None): #: return kilobytes if not unit and not isinstance(value, basestring): unit = "KB" - return parseFileSize(value, unit) + return parse_size(value, unit) def wrong_password(self): diff --git a/module/plugins/internal/AdYouLike.py b/module/plugins/internal/AdYouLike.py index 07e7e4d17..9036b4632 100644 --- a/module/plugins/internal/AdYouLike.py +++ b/module/plugins/internal/AdYouLike.py @@ -30,7 +30,7 @@ class AdYouLike(Captcha): self.log_debug("Ayl: %s | Callback: %s" % self.key) return self.key #: key is the tuple(ayl, callback) else: - self.log_warning("Ayl or callback pattern not found") + self.log_warning(_("Ayl or callback pattern not found")) return None diff --git a/module/plugins/internal/AdsCaptcha.py b/module/plugins/internal/AdsCaptcha.py index b45a6dfda..788b5e71a 100644 --- a/module/plugins/internal/AdsCaptcha.py +++ b/module/plugins/internal/AdsCaptcha.py @@ -30,7 +30,7 @@ class AdsCaptcha(Captcha): self.log_debug("Key: %s | ID: %s" % self.key) return self.key else: - self.log_warning("Key or id pattern not found") + self.log_warning(_("Key or id pattern not found")) return None diff --git a/module/plugins/internal/DeadCrypter.py b/module/plugins/internal/DeadCrypter.py index d79551b52..15ba68b28 100644 --- a/module/plugins/internal/DeadCrypter.py +++ b/module/plugins/internal/DeadCrypter.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.Crypter import Crypter -from module.plugins.internal.SimpleCrypter import create_getInfo +from module.plugins.internal.Crypter import Crypter, create_getInfo class DeadCrypter(Crypter): __name__ = "DeadCrypter" __type__ = "crypter" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'^unmatchable$' @@ -17,10 +16,10 @@ class DeadCrypter(Crypter): @classmethod - def api_info(cls, *args, **kwargs): - api = super(DeadCrypter, cls).api_info(*args, **kwargs) - api['status'] = 1 - return api + def get_info(cls, *args, **kwargs): + info = super(DeadCrypter, cls).get_info(*args, **kwargs) + info['status'] = 1 + return info def setup(self): diff --git a/module/plugins/internal/DeadHoster.py b/module/plugins/internal/DeadHoster.py index 86f4381a3..5050ba059 100644 --- a/module/plugins/internal/DeadHoster.py +++ b/module/plugins/internal/DeadHoster.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.Hoster import Hoster -from module.plugins.internal.SimpleHoster import create_getInfo +from module.plugins.internal.Hoster import Hoster, create_getInfo class DeadHoster(Hoster): __name__ = "DeadHoster" __type__ = "hoster" - __version__ = "0.17" + __version__ = "0.18" __pattern__ = r'^unmatchable$' @@ -17,10 +16,10 @@ class DeadHoster(Hoster): @classmethod - def api_info(cls, *args, **kwargs): - api = super(DeadHoster, cls).api_info(*args, **kwargs) - api['status'] = 1 - return api + def get_info(cls, *args, **kwargs): + info = super(DeadHoster, cls).get_info(*args, **kwargs) + info['status'] = 1 + return info def setup(self): diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py index 9a9e61e46..15c46101b 100644 --- a/module/plugins/internal/Hoster.py +++ b/module/plugins/internal/Hoster.py @@ -216,7 +216,7 @@ class Hoster(Plugin): wait_until = time.time() + wait_time + 1 self.log_debug("Set waitUntil to: %f (previous: %f)" % (wait_until, self.pyfile.waitUntil), - "Wait: %d+1 seconds" % wait_time) + "Wait: %d (+1) seconds" % wait_time) self.pyfile.waitUntil = wait_until @@ -242,7 +242,7 @@ class Hoster(Plugin): pyfile.setStatus("waiting") self.log_info(_("Wait: %d seconds") % (pyfile.waitUntil - time.time()), - _("Reconnect: %s") % self.want_reconnect) + _("Reconnect: %s") % self.want_reconnect) if self.account: self.log_debug("Ignore reconnection due account logged") @@ -443,7 +443,7 @@ class Hoster(Plugin): self.fail(_("No url given")) if self.core.debug: - self.log_debug("Download url: " + url, *["%s=%s" % (key, val) for key, val in locals().iteritems() if key not in ("self", "url")]) + self.log_debug("Download url " + url, *["%s=%s" % (key, val) for key, val in locals().iteritems() if key not in ("self", "url")]) self.correct_captcha() self.check_for_same_files() diff --git a/module/plugins/internal/MultiHook.py b/module/plugins/internal/MultiHook.py index 2e99afa1c..7afe95705 100644 --- a/module/plugins/internal/MultiHook.py +++ b/module/plugins/internal/MultiHook.py @@ -76,7 +76,7 @@ class MultiHook(Hook): self.pluginmodule = self.core.pluginManager.loadModule(self.plugintype, self.pluginname) self.pluginclass = getattr(self.pluginmodule, self.pluginname) else: - self.log_warning("Hook plugin will be deactivated due missing plugin reference") + self.log_warning(_("Hook plugin will be deactivated due missing plugin reference")) self.set_config('activated', False) @@ -87,7 +87,7 @@ class MultiHook(Hook): self.account = None if not self.account and hasattr(self.pluginclass, "LOGIN_ACCOUNT") and self.pluginclass.LOGIN_ACCOUNT: - self.log_warning("Hook plugin will be deactivated due missing account reference") + self.log_warning(_("Hook plugin will be deactivated due missing account reference")) self.set_config('activated', False) diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index d1b8bb1cf..dc5995e65 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -282,7 +282,7 @@ class Plugin(object): self.fail(_("No url given")) if self.core.debug: - self.log_debug("Load url: " + url, *["%s=%s" % (key, val) for key, val in locals().iteritems() if key not in ("self", "url")]) + self.log_debug("Load url " + url, *["%s=%s" % (key, val) for key, val in locals().iteritems() if key not in ("self", "url")]) if req is None: if hasattr(self, "req"): diff --git a/module/plugins/internal/ReCaptcha.py b/module/plugins/internal/ReCaptcha.py index 79bda9051..1caf6b7b0 100644 --- a/module/plugins/internal/ReCaptcha.py +++ b/module/plugins/internal/ReCaptcha.py @@ -35,7 +35,7 @@ class ReCaptcha(Captcha): self.log_debug("Key: %s" % self.key) return self.key else: - self.log_warning("Key pattern not found") + self.log_warning(_("Key pattern not found")) return None diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 772e6ea2f..93008f16d 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -12,8 +12,8 @@ import urlparse from module.PyFile import statusMap as _statusMap from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getURL -from module.plugins.internal.Hoster import Hoster, parse_fileInfo, create_getInfo +from module.network.RequestFactory import getURL as get_url +from module.plugins.internal.Hoster import Hoster, create_getInfo, parse_fileInfo from module.plugins.internal.Plugin import Fail, Retry, replace_patterns, set_cookies from module.utils import fixup, fs_encode, parseFileSize as parse_size @@ -136,7 +136,7 @@ class SimpleHoster(Hoster): elif info['status'] is 3: try: - html = getURL(url, cookies=cls.COOKIES, decode=cls.TEXT_ENCODING) + html = get_url(url, cookies=cls.COOKIES, decode=cls.TEXT_ENCODING) except BadHeader, e: info['error'] = "%d: %s" % (e.code, e.content) @@ -322,7 +322,7 @@ class SimpleHoster(Hoster): except Exception: pass - self.log_warning("Check result: " + errmsg, "Waiting 1 minute and retry") + self.log_warning(_("Check result: ") + errmsg, _("Waiting 1 minute and retry")) self.want_reconnect = True self.retry(wait_time=60, reason=errmsg) else: diff --git a/module/plugins/internal/SolveMedia.py b/module/plugins/internal/SolveMedia.py index 927d4e536..87537470f 100644 --- a/module/plugins/internal/SolveMedia.py +++ b/module/plugins/internal/SolveMedia.py @@ -28,7 +28,7 @@ class SolveMedia(Captcha): self.log_debug("Key: %s" % self.key) return self.key else: - self.log_warning("Key pattern not found") + self.log_warning(_("Key pattern not found") return None @@ -43,7 +43,7 @@ class SolveMedia(Captcha): magic = re.search(r'name="magic" value="(.+?)"', html).group(1) except AttributeError: - self.log_warning("Magic pattern not found") + self.log_warning(_("Magic pattern not found") magic = None try: @@ -81,7 +81,7 @@ class SolveMedia(Captcha): else: if "error" in html: - self.log_warning("Captcha code was invalid") + self.log_warning(_("Captcha code was invalid")) self.log_debug("Retry #%d" % i) html = self.plugin.load(redirect) else: |