From fd105f8e51768ec1943cda2375bdfdbe5b0a3951 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 00:35:51 +0100 Subject: "New Year" Update: hoster plugins --- module/plugins/hoster/BasePlugin.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index d0d8e7cc8..32ba7094a 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -13,7 +13,7 @@ from module.plugins.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.26" + __version__ = "0.27" __pattern__ = r'^unmatchable$' @@ -58,7 +58,7 @@ class BasePlugin(Hoster): if server in servers: self.logDebug("Logging on to %s" % server) - self.req.addAuth(account.accounts[server]['password']) + self.req.addAuth(account.getAccountData(server)['password']) else: pwd = self.getPassword() if ':' in pwd: @@ -72,8 +72,11 @@ class BasePlugin(Hoster): else: self.fail(_("No file downloaded")) #@TODO: Move to hoster class in 0.4.10 - if self.checkDownload({'empty': re.compile(r"^$")}) is "empty": #@TODO: Move to hoster in 0.4.10 - self.fail(_("Empty file")) + check = self.checkDownload('empty file': re.compile(r'\A\Z'), + 'html file' : re.compile(r'\A\s*)?\d{3}(\Z|\s+)')}): + if check: + self.fail(check.capitalize()) def downloadFile(self, pyfile): -- cgit v1.2.3 From af428fa781e72c711ff446ad25402c66768c0333 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 21:06:46 +0100 Subject: [BasePlugin] Fix typo --- module/plugins/hoster/BasePlugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 32ba7094a..4113ff42a 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -13,7 +13,7 @@ from module.plugins.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.27" + __version__ = "0.28" __pattern__ = r'^unmatchable$' @@ -72,9 +72,9 @@ class BasePlugin(Hoster): else: self.fail(_("No file downloaded")) #@TODO: Move to hoster class in 0.4.10 - check = self.checkDownload('empty file': re.compile(r'\A\Z'), - 'html file' : re.compile(r'\A\s*)?\d{3}(\Z|\s+)')}): + check = self.checkDownload({'empty file': re.compile(r'\A\Z'), + 'html file' : re.compile(r'\A\s*)?\d{3}(\Z|\s+)')}): if check: self.fail(check.capitalize()) -- cgit v1.2.3 From 995195e65c7ff8751df8eca6316524db6638c005 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 9 Jan 2015 22:18:36 +0100 Subject: [BasePlugin] Fix another typo Removed ':' from line 77 --- 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 4113ff42a..e4cc84f6b 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -74,7 +74,7 @@ class BasePlugin(Hoster): check = self.checkDownload({'empty file': re.compile(r'\A\Z'), 'html file' : re.compile(r'\A\s*)?\d{3}(\Z|\s+)')}): + 'html error': re.compile(r'\A\s*(<.+>)?\d{3}(\Z|\s+)')}) if check: self.fail(check.capitalize()) -- cgit v1.2.3 From 5afd8891a199f3817b8c798b19f0e1fa0b606c6b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 23:20:16 +0100 Subject: [BasePlugin] Bump up version --- 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 e4cc84f6b..c2825493b 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -13,7 +13,7 @@ from module.plugins.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.28" + __version__ = "0.29" __pattern__ = r'^unmatchable$' -- cgit v1.2.3 From 502c1437e838282aa56a286bb3751382c3aaf65e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 10 Jan 2015 16:01:38 +0100 Subject: Improve getInfo --- module/plugins/hoster/BasePlugin.py | 10 ++++++++-- 1 file changed, 8 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 c2825493b..6d3132e65 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -13,7 +13,7 @@ from module.plugins.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.29" + __version__ = "0.30" __pattern__ = r'^unmatchable$' @@ -25,7 +25,13 @@ class BasePlugin(Hoster): @classmethod def getInfo(cls, url="", html=""): #@TODO: Move to hoster class in 0.4.10 - return {'name': urlparse(unquote(url)).path.split('/')[-1] or _("Unknown"), 'size': 0, 'status': 3 if url else 1, 'url': unquote(url) or ""} + url = unquote(url) + return {'name' : (urlparse(url).path.split('/')[-1] + or urlparse(url).query.split('=', 1)[::-1][0].split('&', 1)[0] + or _("Unknown")), + 'size' : 0, + 'status': 3 if url else 8, + 'url' : url} def setup(self): -- cgit v1.2.3