From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/hoster/BasePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 2228516aa..e081c4fa9 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -6,13 +6,13 @@ import urlparse from module.network.HTTPRequest import BadHeader from module.plugins.internal.SimpleHoster import create_getInfo, getFileURL -from module.plugins.Hoster import Hoster +from module.plugins.internal.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.43" + __version__ = "0.44" __pattern__ = r'^unmatchable$' -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/hoster/BasePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index e081c4fa9..de5bca207 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -5,7 +5,7 @@ import urllib import urlparse from module.network.HTTPRequest import BadHeader -from module.plugins.internal.SimpleHoster import create_getInfo, getFileURL +from module.plugins.internal.SimpleHoster import create_getInfo from module.plugins.internal.Hoster import Hoster @@ -50,7 +50,7 @@ class BasePlugin(Hoster): for _i in xrange(5): try: - link = getFileURL(self, urllib.unquote(pyfile.url)) + link = self.directLink(self, urllib.unquote(pyfile.url)) if link: self.download(link, ref=False, disposition=True) -- cgit v1.2.3 From 164512b6a74c94a731fcee7435dce1ccfa2f71e7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:29:50 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/BasePlugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index de5bca207..82311dd6b 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -41,8 +41,9 @@ class BasePlugin(Hoster): def process(self, pyfile): - """main function""" - + """ + Main function + """ pyfile.name = self.getInfo(pyfile.url)['name'] if not pyfile.url.startswith("http"): -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/hoster/BasePlugin.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 82311dd6b..7fc0426ea 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -12,7 +12,7 @@ from module.plugins.internal.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.44" + __version__ = "0.45" __pattern__ = r'^unmatchable$' @@ -23,7 +23,7 @@ class BasePlugin(Hoster): @classmethod - def getInfo(cls, url="", html=""): #@TODO: Move to hoster class in 0.4.10 + def get_info(cls, url="", html=""): #@TODO: Move to hoster class in 0.4.10 url = urllib.unquote(url) url_p = urlparse.urlparse(url) return {'name' : (url_p.path.split('/')[-1] @@ -35,23 +35,23 @@ class BasePlugin(Hoster): def setup(self): - self.chunkLimit = -1 - self.multiDL = True - self.resumeDownload = True + self.chunk_limit = -1 + self.multi_dl = True + self.resume_download = True def process(self, pyfile): """ Main function """ - pyfile.name = self.getInfo(pyfile.url)['name'] + pyfile.name = self.get_info(pyfile.url)['name'] if not pyfile.url.startswith("http"): self.fail(_("No plugin matched")) for _i in xrange(5): try: - link = self.directLink(self, urllib.unquote(pyfile.url)) + link = self.direct_link(self, urllib.unquote(pyfile.url)) if link: self.download(link, ref=False, disposition=True) @@ -63,17 +63,17 @@ class BasePlugin(Hoster): self.offline() elif e.code in (401, 403): - self.logDebug("Auth required", "Received HTTP status code: %d" % e.code) + self.log_debug("Auth required", "Received HTTP status code: %d" % e.code) account = self.core.accountManager.getAccountPlugin('Http') servers = [x['login'] for x in account.getAllAccounts()] server = urlparse.urlparse(pyfile.url).netloc if server in servers: - self.logDebug("Logging on to %s" % server) + self.log_debug("Logging on to %s" % server) self.req.addAuth(account.getAccountData(server)['password']) else: - pwd = self.getPassword() + pwd = self.get_password() if ':' in pwd: self.req.addAuth(pwd) else: @@ -85,7 +85,7 @@ class BasePlugin(Hoster): else: self.fail(_("No file downloaded")) #@TODO: Move to hoster class in 0.4.10 - errmsg = self.checkDownload({'Empty file' : re.compile(r'\A\s*\Z'), + errmsg = self.check_download({'Empty file' : re.compile(r'\A\s*\Z'), 'Html error' : re.compile(r'\A(?:\s*<.+>)?((?:[\w\s]*(?:[Ee]rror|ERROR)\s*\:?)?\s*\d{3})(?:\Z|\s+)'), 'Html file' : re.compile(r'\A\s* Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/hoster/BasePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 7fc0426ea..909b350c9 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -66,12 +66,12 @@ class BasePlugin(Hoster): self.log_debug("Auth required", "Received HTTP status code: %d" % e.code) account = self.core.accountManager.getAccountPlugin('Http') - servers = [x['login'] for x in account.getAllAccounts()] + servers = [x['login'] for x in account.get_all_accounts()] server = urlparse.urlparse(pyfile.url).netloc if server in servers: self.log_debug("Logging on to %s" % server) - self.req.addAuth(account.getAccountData(server)['password']) + self.req.addAuth(account.get_account_data(server)['password']) else: pwd = self.get_password() if ':' in pwd: -- cgit v1.2.3 From 9e5d813d7721e351ac02ba72bdc473a7d77ba6b7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Jul 2015 20:04:36 +0200 Subject: Code cosmetics --- module/plugins/hoster/BasePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 909b350c9..ed8c8b32c 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -97,7 +97,7 @@ class BasePlugin(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.retry(3, 60, errmsg) -- cgit v1.2.3 From 56389e28ba5d2f5658278bc7f486d73be747f135 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 11:44:49 +0200 Subject: Rename self.core to self.pyload (plugins only) --- module/plugins/hoster/BasePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index ed8c8b32c..e9871e366 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -65,7 +65,7 @@ class BasePlugin(Hoster): elif e.code in (401, 403): self.log_debug("Auth required", "Received HTTP status code: %d" % e.code) - account = self.core.accountManager.getAccountPlugin('Http') + account = self.pyload.accountManager.getAccountPlugin('Http') servers = [x['login'] for x in account.get_all_accounts()] server = urlparse.urlparse(pyfile.url).netloc -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/hoster/BasePlugin.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index e9871e366..b39257f13 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -13,6 +13,7 @@ class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" __version__ = "0.45" + __status__ = "stable" __pattern__ = r'^unmatchable$' -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/hoster/BasePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index b39257f13..538e5ded2 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -13,7 +13,7 @@ class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" __version__ = "0.45" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -37,7 +37,7 @@ class BasePlugin(Hoster): def setup(self): self.chunk_limit = -1 - self.multi_dl = True + self.multiDL = True self.resume_download = True -- cgit v1.2.3 From 761ca5c66e07559925ebbdbc6531f9ca658b12ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 16:11:58 +0200 Subject: Code cosmetics --- module/plugins/hoster/BasePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 538e5ded2..dd7490365 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -60,7 +60,7 @@ class BasePlugin(Hoster): self.fail(_("File not found")) except BadHeader, e: - if e.code is 404: + if e.code == 404: self.offline() elif e.code in (401, 403): -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- module/plugins/hoster/BasePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index dd7490365..c8fb1f3db 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -67,12 +67,12 @@ class BasePlugin(Hoster): self.log_debug("Auth required", "Received HTTP status code: %d" % e.code) account = self.pyload.accountManager.getAccountPlugin('Http') - servers = [x['login'] for x in account.get_all_accounts()] + servers = [x['login'] for x in account.getAllAccounts()] #@TODO: Recheck in 0.4.10 server = urlparse.urlparse(pyfile.url).netloc if server in servers: self.log_debug("Logging on to %s" % server) - self.req.addAuth(account.get_account_data(server)['password']) + self.req.addAuth(account.get_data(server)['password']) else: pwd = self.get_password() if ':' in pwd: -- cgit v1.2.3 From a95c217627a1cb651b24e69f20640df40797aff9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 09:34:18 +0200 Subject: Account rewritten (2) --- module/plugins/hoster/BasePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index c8fb1f3db..eb583b105 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -72,7 +72,7 @@ class BasePlugin(Hoster): if server in servers: self.log_debug("Logging on to %s" % server) - self.req.addAuth(account.get_data(server)['password']) + self.req.addAuth(account.get_info(server)['login']['password']) else: pwd = self.get_password() if ':' in pwd: -- cgit v1.2.3 From 5ceb174cb7eb6a3cf706a1ed861ddd778069d7b6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Jul 2015 10:29:06 +0200 Subject: Then update others --- module/plugins/hoster/BasePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index eb583b105..2e9ae4e48 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -52,7 +52,7 @@ class BasePlugin(Hoster): for _i in xrange(5): try: - link = self.direct_link(self, urllib.unquote(pyfile.url)) + link = self.direct_link(urllib.unquote(pyfile.url)) if link: self.download(link, ref=False, disposition=True) -- cgit v1.2.3