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/RedtubeCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/RedtubeCom.py') diff --git a/module/plugins/hoster/RedtubeCom.py b/module/plugins/hoster/RedtubeCom.py index a2bbf3883..465803a1c 100644 --- a/module/plugins/hoster/RedtubeCom.py +++ b/module/plugins/hoster/RedtubeCom.py @@ -29,7 +29,7 @@ class RedtubeCom(Hoster): def get_file_url(self): """ returns the absolute downloadable filepath """ - if self.html is None: + if not self.html: self.download_html() file_url = unescape(re.search(r'hashlink=(http.*?)"', self.html).group(1)) @@ -37,7 +37,7 @@ class RedtubeCom(Hoster): return file_url def get_file_name(self): - if self.html is None: + if not self.html: self.download_html() name = re.search('(.*?)- RedTube - Free Porn Videos', self.html).group(1).strip() + ".flv" @@ -46,7 +46,7 @@ class RedtubeCom(Hoster): def file_exists(self): """ returns True or False """ - if self.html is None: + if not self.html: self.download_html() if re.search(r'This video has been removed.', self.html) is not None: -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/hoster/RedtubeCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/RedtubeCom.py') diff --git a/module/plugins/hoster/RedtubeCom.py b/module/plugins/hoster/RedtubeCom.py index 465803a1c..d9cb6489a 100644 --- a/module/plugins/hoster/RedtubeCom.py +++ b/module/plugins/hoster/RedtubeCom.py @@ -40,8 +40,7 @@ class RedtubeCom(Hoster): if not self.html: self.download_html() - name = re.search('(.*?)- RedTube - Free Porn Videos', self.html).group(1).strip() + ".flv" - return name + return re.search('(.*?)- RedTube - Free Porn Videos', self.html).group(1).strip() + ".flv" def file_exists(self): """ returns True or False -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro 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/RedtubeCom.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/RedtubeCom.py') diff --git a/module/plugins/hoster/RedtubeCom.py b/module/plugins/hoster/RedtubeCom.py index d9cb6489a..bdb948d6d 100644 --- a/module/plugins/hoster/RedtubeCom.py +++ b/module/plugins/hoster/RedtubeCom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re + from module.plugins.Hoster import Hoster from module.unescape import unescape @@ -8,12 +9,15 @@ from module.unescape import unescape class RedtubeCom(Hoster): __name__ = "RedtubeCom" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?redtube\.com/\d+' __version__ = "0.2" + + __pattern__ = r'http://(?:www\.)?redtube\.com/\d+' + __description__ = """Redtube.com hoster plugin""" __author_name__ = "jeix" __author_mail__ = "jeix@hasnomail.de" + def process(self, pyfile): self.download_html() if not self.file_exists(): -- cgit v1.2.3