diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-02 16:45:49 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-02 16:45:49 +0200 |
commit | e6f7ba06c3d7ab9708f4960cbf359684155f9a5f (patch) | |
tree | 42799025e3d7b65e20295ac8a87b114924846601 /module/plugins | |
parent | [ClickAndLoad] Queue destination support (2) (diff) | |
download | pyload-e6f7ba06c3d7ab9708f4960cbf359684155f9a5f.tar.xz |
Fix https://github.com/pyload/pyload/issues/1911#issuecomment-145026557
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/internal/Account.py | 11 | ||||
-rw-r--r-- | module/plugins/internal/Addon.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/Plugin.py | 4 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 4 | ||||
-rw-r--r-- | module/plugins/internal/XFSAccount.py | 16 | ||||
-rw-r--r-- | module/plugins/internal/XFSCrypter.py | 16 | ||||
-rw-r--r-- | module/plugins/internal/XFSHoster.py | 16 |
7 files changed, 44 insertions, 25 deletions
diff --git a/module/plugins/internal/Account.py b/module/plugins/internal/Account.py index f1b85f358..724322a4c 100644 --- a/module/plugins/internal/Account.py +++ b/module/plugins/internal/Account.py @@ -94,7 +94,7 @@ class Account(Plugin): except Skip: self.info['login']['valid'] = True if self.auto_timeout: - self.auto_timeout *= 2 + self.auto_timeout *= 3 self.interval = self.auto_timeout except Exception, e: @@ -104,7 +104,7 @@ class Account(Plugin): else: self.info['login']['valid'] = True if self.interval is self.auto_timeout: - self.interval = self.auto_timeout / 2 + self.interval = self.auto_timeout / 3 self.auto_timeout = False finally: @@ -114,11 +114,18 @@ class Account(Plugin): #@TODO: Recheck in 0.4.10 def syncback(self): + """ + Wrapper to directly sync self.info -> self.accounts[self.user] + """ return self.sync(reverse=True) #@TODO: Recheck in 0.4.10 def sync(self, reverse=False): + """ + Sync self.accounts[self.user] -> self.info + or self.info -> self.accounts[self.user] (if reverse is True) + """ if not self.user: return diff --git a/module/plugins/internal/Addon.py b/module/plugins/internal/Addon.py index 3a252fdfb..371f1da1b 100644 --- a/module/plugins/internal/Addon.py +++ b/module/plugins/internal/Addon.py @@ -101,7 +101,7 @@ class Addon(Plugin): except Exception, e: self.log_error(_("Error executing periodical task: %s") % e) - self.cb = self.pyload.scheduler.addJob(self.interval, self._periodical, [threaded], threaded=threaded) + self.init_periodical(self.interval, threaded) def periodical(self): diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 4ab330975..cc35d919c 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -110,7 +110,7 @@ def parse_time(string): else: this = re.compile("this", re.I) - regex = re.compile(r'(\d+|\w+)\s*(hr|hour|min|sec|)', re.I) + regex = re.compile(r'(\d+|[\w\-]+)\s*(hr|hour|min|sec|)', re.I) time = sum(1 if this.match(v) else str2int(v) * {'hr': 3600, 'hour': 3600, 'min': 60, 'sec': 1, '': 1}[u.lower()] @@ -228,7 +228,7 @@ def chunks(iterable, size): class Plugin(object): __name__ = "Plugin" __type__ = "plugin" - __version__ = "0.45" + __version__ = "0.46" __status__ = "testing" __pattern__ = r'^unmatchable$' diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index fb621a278..8f1b3ac5d 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -16,7 +16,7 @@ from module.utils import fixup, fs_encode, parseFileSize as parse_size class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.94" + __version__ = "1.95" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -414,7 +414,7 @@ class SimpleHoster(Hoster): waitmsg = m.group(0).strip() wait_time = parse_time(waitmsg) - self.wait(wait_time, econnect=wait_time > 300) + self.wait(wait_time, reconnect=wait_time > 300) self.info.pop('error', None) diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 7b9410222..8b0aadf12 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -13,7 +13,7 @@ from module.plugins.internal.Plugin import parse_html_form, set_cookie class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" - __version__ = "0.49" + __version__ = "0.50" __status__ = "testing" __description__ = """XFileSharing account plugin""" @@ -43,13 +43,16 @@ class XFSAccount(Account): def set_xfs_cookie(self): - if not self.COOKIES: + if not self.PLUGIN_DOMAIN: + self.log_error(_("Unable to set xfs cookie due missing PLUGIN_DOMAIN")) return - if isinstance(self.COOKIES, list) and (self.PLUGIN_DOMAIN, "lang", "english") not in self.COOKIES: - self.COOKIES.insert((self.PLUGIN_DOMAIN, "lang", "english")) + cookie = (self.PLUGIN_DOMAIN, "lang", "english") + + if isinstance(self.COOKIES, list) and cookie not in self.COOKIES: + self.COOKIES.insert(cookie) else: - set_cookie(self.req.cj, self.PLUGIN_DOMAIN, "lang", "english") + set_cookie(self.req.cj, *cookie) def grab_info(self, user, password, data): @@ -156,7 +159,8 @@ class XFSAccount(Account): if not self.PLUGIN_URL: self.PLUGIN_URL = "http://www.%s/" % self.PLUGIN_DOMAIN - self.set_xfs_cookie() + if self.COOKIES: + self.set_xfs_cookie() if not self.PLUGIN_URL: self.fail_login(_("Missing PLUGIN_URL")) diff --git a/module/plugins/internal/XFSCrypter.py b/module/plugins/internal/XFSCrypter.py index 876575874..dd2fba568 100644 --- a/module/plugins/internal/XFSCrypter.py +++ b/module/plugins/internal/XFSCrypter.py @@ -7,7 +7,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class XFSCrypter(SimpleCrypter): __name__ = "XFSCrypter" __type__ = "crypter" - __version__ = "0.16" + __version__ = "0.17" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -32,13 +32,16 @@ class XFSCrypter(SimpleCrypter): def set_xfs_cookie(self): - if not self.COOKIES: + if not self.PLUGIN_DOMAIN: + self.log_error(_("Unable to set xfs cookie due missing PLUGIN_DOMAIN")) return - if isinstance(self.COOKIES, list) and (self.PLUGIN_DOMAIN, "lang", "english") not in self.COOKIES: - self.COOKIES.insert((self.PLUGIN_DOMAIN, "lang", "english")) + cookie = (self.PLUGIN_DOMAIN, "lang", "english") + + if isinstance(self.COOKIES, list) and cookie not in self.COOKIES: + self.COOKIES.insert(cookie) else: - set_cookie(self.req.cj, self.PLUGIN_DOMAIN, "lang", "english") + set_cookie(self.req.cj, *cookie) def prepare(self): @@ -54,6 +57,7 @@ class XFSCrypter(SimpleCrypter): else: self.fail(_("Missing PLUGIN_DOMAIN")) - self.set_xfs_cookie() + if self.COOKIES: + self.set_xfs_cookie() return super(XFSCrypter, self).prepare() diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index b59f34122..99a091129 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -14,7 +14,7 @@ from module.utils import html_unescape class XFSHoster(SimpleHoster): __name__ = "XFSHoster" __type__ = "hoster" - __version__ = "0.63" + __version__ = "0.64" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -61,13 +61,16 @@ class XFSHoster(SimpleHoster): def set_xfs_cookie(self): - if not self.COOKIES: + if not self.PLUGIN_DOMAIN: + self.log_error(_("Unable to set xfs cookie due missing PLUGIN_DOMAIN")) return - if isinstance(self.COOKIES, list) and (self.PLUGIN_DOMAIN, "lang", "english") not in self.COOKIES: - self.COOKIES.insert((self.PLUGIN_DOMAIN, "lang", "english")) + cookie = (self.PLUGIN_DOMAIN, "lang", "english") + + if isinstance(self.COOKIES, list) and cookie not in self.COOKIES: + self.COOKIES.insert(cookie) else: - set_cookie(self.req.cj, self.PLUGIN_DOMAIN, "lang", "english") + set_cookie(self.req.cj, *cookie) def prepare(self): @@ -85,7 +88,8 @@ class XFSHoster(SimpleHoster): else: self.fail(_("Missing PLUGIN_DOMAIN")) - self.set_xfs_cookie() + if self.COOKIES: + self.set_xfs_cookie() if not self.LINK_PATTERN: pattern = r'(?:file: "(.+?)"|(https?://(?:www\.)?([^/]*?%s|\d+\.\d+\.\d+\.\d+)(\:\d+)?(/d/|(/files)?/\d+/\w+/).+?)["\'<])' |