From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/hoster/VeehdCom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 22fc4b207..fd804d3f9 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -5,12 +5,12 @@ from module.plugins.Hoster import Hoster class VeehdCom(Hoster): - __name__ = 'VeehdCom' - __type__ = 'hoster' + __name__ = "VeehdCom" + __type__ = "hoster" __pattern__ = r'http://veehd\.com/video/\d+_\S+' __config__ = [("filename_spaces", "bool", "Allow spaces in filename", False), ("replacement_char", "str", "Filename replacement character", "_")] - __version__ = '0.23' + __version__ = "0.23" __description__ = """Veehd.com hoster plugin""" __author_name__ = "cat" __author_mail__ = "cat@pyload" @@ -36,7 +36,7 @@ class VeehdCom(Hoster): self.html = self.load(url) def file_exists(self): - if self.html is None: + if not self.html: self.download_html() if 'Veehd' in self.html: @@ -44,7 +44,7 @@ class VeehdCom(Hoster): return True def get_file_name(self): - if self.html is None: + if not self.html: self.download_html() match = re.search(r']*>([^<]+) on Veehd', self.html) @@ -65,7 +65,7 @@ class VeehdCom(Hoster): def get_file_url(self): """ returns the absolute downloadable filepath """ - if self.html is None: + if not self.html: self.download_html() match = re.search(r' Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/hoster/VeehdCom.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index fd804d3f9..33fa76d47 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -47,10 +47,11 @@ class VeehdCom(Hoster): if not self.html: self.download_html() - match = re.search(r']*>([^<]+) on Veehd', self.html) - if not match: + found = re.search(r']*>([^<]+) on Veehd', self.html) + if found is None: self.fail("video title not found") - name = match.group(1) + + name = found.group(1) # replace unwanted characters in filename if self.getConfig('filename_spaces'): @@ -58,9 +59,7 @@ class VeehdCom(Hoster): else: pattern = '[^0-9A-Za-z\.]+' - name = re.sub(pattern, self.getConfig('replacement_char'), - name) - return name + '.avi' + return re.sub(pattern, self.getConfig('replacement_char'), name) + '.avi' def get_file_url(self): """ returns the absolute downloadable filepath @@ -68,10 +67,9 @@ class VeehdCom(Hoster): if not self.html: self.download_html() - match = re.search(r' Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hoster/VeehdCom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 33fa76d47..15cff646f 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -47,11 +47,11 @@ class VeehdCom(Hoster): if not self.html: self.download_html() - found = re.search(r']*>([^<]+) on Veehd', self.html) - if found is None: + m = re.search(r']*>([^<]+) on Veehd', self.html) + if m is None: self.fail("video title not found") - name = found.group(1) + name = m.group(1) # replace unwanted characters in filename if self.getConfig('filename_spaces'): @@ -67,9 +67,9 @@ class VeehdCom(Hoster): if not self.html: self.download_html() - found = re.search(r' Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/VeehdCom.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 15cff646f..66c258439 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -1,20 +1,24 @@ # -*- coding: utf-8 -*- import re + from module.plugins.Hoster import Hoster class VeehdCom(Hoster): __name__ = "VeehdCom" __type__ = "hoster" + __version__ = "0.23" + __pattern__ = r'http://veehd\.com/video/\d+_\S+' __config__ = [("filename_spaces", "bool", "Allow spaces in filename", False), ("replacement_char", "str", "Filename replacement character", "_")] - __version__ = "0.23" + __description__ = """Veehd.com hoster plugin""" __author_name__ = "cat" __author_mail__ = "cat@pyload" + def _debug(self, msg): self.logDebug('[%s] %s' % (self.__name__, msg)) -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/hoster/VeehdCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 66c258439..bdca87cc8 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -20,7 +20,7 @@ class VeehdCom(Hoster): def _debug(self, msg): - self.logDebug('[%s] %s' % (self.__name__, msg)) + self.logDebug("[%s] %s" % (self.__name__, msg)) def setup(self): self.multiDL = True -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/VeehdCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index bdca87cc8..ffb1e9c56 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -15,8 +15,7 @@ class VeehdCom(Hoster): ("replacement_char", "str", "Filename replacement character", "_")] __description__ = """Veehd.com hoster plugin""" - __author_name__ = "cat" - __author_mail__ = "cat@pyload" + __authors__ = [("cat", "cat@pyload")] def _debug(self, msg): -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/VeehdCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index ffb1e9c56..50d24f4c9 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -15,6 +15,7 @@ class VeehdCom(Hoster): ("replacement_char", "str", "Filename replacement character", "_")] __description__ = """Veehd.com hoster plugin""" + __license__ = "GPLv3" __authors__ = [("cat", "cat@pyload")] -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- module/plugins/hoster/VeehdCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 50d24f4c9..f82d429d1 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -59,9 +59,9 @@ class VeehdCom(Hoster): # replace unwanted characters in filename if self.getConfig('filename_spaces'): - pattern = '[^0-9A-Za-z\.\ ]+' + pattern = '[^\w ]+' else: - pattern = '[^0-9A-Za-z\.]+' + pattern = '[^\w.]+' return re.sub(pattern, self.getConfig('replacement_char'), name) + '.avi' -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hoster/VeehdCom.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index f82d429d1..47f95ed41 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -22,10 +22,12 @@ class VeehdCom(Hoster): def _debug(self, msg): self.logDebug("[%s] %s" % (self.__name__, msg)) + def setup(self): self.multiDL = True self.req.canContinue = True + def process(self, pyfile): self.download_html() if not self.file_exists(): @@ -34,11 +36,13 @@ class VeehdCom(Hoster): pyfile.name = self.get_file_name() self.download(self.get_file_url()) + def download_html(self): url = self.pyfile.url self._debug("Requesting page: %s" % (repr(url),)) self.html = self.load(url) + def file_exists(self): if not self.html: self.download_html() @@ -47,6 +51,7 @@ class VeehdCom(Hoster): return False return True + def get_file_name(self): if not self.html: self.download_html() @@ -65,6 +70,7 @@ class VeehdCom(Hoster): return re.sub(pattern, self.getConfig('replacement_char'), name) + '.avi' + def get_file_url(self): """ returns the absolute downloadable filepath """ -- cgit v1.2.3 From 4da90891eb2544ac15a7d512aba8cb357f68ee5f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/VeehdCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 47f95ed41..0283674d1 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -58,7 +58,7 @@ class VeehdCom(Hoster): m = re.search(r']*>([^<]+) on Veehd', self.html) if m is None: - self.fail("video title not found") + self.error("Video title not found") name = m.group(1) @@ -80,6 +80,6 @@ class VeehdCom(Hoster): m = re.search(r' Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/VeehdCom.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 0283674d1..ad99793e4 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -19,10 +19,6 @@ class VeehdCom(Hoster): __authors__ = [("cat", "cat@pyload")] - def _debug(self, msg): - self.logDebug("[%s] %s" % (self.__name__, msg)) - - def setup(self): self.multiDL = True self.req.canContinue = True @@ -39,7 +35,7 @@ class VeehdCom(Hoster): def download_html(self): url = self.pyfile.url - self._debug("Requesting page: %s" % (repr(url),)) + self.logDebug("Requesting page: %s" % repr(url)) self.html = self.load(url) @@ -58,7 +54,7 @@ class VeehdCom(Hoster): m = re.search(r']*>([^<]+) on Veehd', self.html) if m is None: - self.error("Video title not found") + self.error(_("Video title not found")) name = m.group(1) @@ -80,6 +76,6 @@ class VeehdCom(Hoster): m = re.search(r' Date: Mon, 27 Oct 2014 01:18:45 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/VeehdCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index ad99793e4..921a9c205 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -35,7 +35,7 @@ class VeehdCom(Hoster): def download_html(self): url = self.pyfile.url - self.logDebug("Requesting page: %s" % repr(url)) + self.logDebug("Requesting page: %s" % url) self.html = self.load(url) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/VeehdCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/VeehdCom.py') diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py index 921a9c205..d894dab24 100644 --- a/module/plugins/hoster/VeehdCom.py +++ b/module/plugins/hoster/VeehdCom.py @@ -6,8 +6,8 @@ from module.plugins.Hoster import Hoster class VeehdCom(Hoster): - __name__ = "VeehdCom" - __type__ = "hoster" + __name__ = "VeehdCom" + __type__ = "hoster" __version__ = "0.23" __pattern__ = r'http://veehd\.com/video/\d+_\S+' @@ -15,8 +15,8 @@ class VeehdCom(Hoster): ("replacement_char", "str", "Filename replacement character", "_")] __description__ = """Veehd.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("cat", "cat@pyload")] + __license__ = "GPLv3" + __authors__ = [("cat", "cat@pyload")] def setup(self): -- cgit v1.2.3