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/PornhostCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/PornhostCom.py') diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py index 61b382c81..18032519c 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -21,7 +21,7 @@ class PornhostCom(Hoster): pyfile.name = self.get_file_name() self.download(self.get_file_url()) - ### old interface + # Old interface def download_html(self): url = self.pyfile.url self.html = self.load(url) @@ -29,7 +29,7 @@ class PornhostCom(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 = re.search(r'download this file.*?pornhost\.com - free file hosting with a twist - gallery(.*?)', self.html) @@ -64,7 +64,7 @@ class PornhostCom(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'gallery not found', self.html) is not None or -- 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/PornhostCom.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'module/plugins/hoster/PornhostCom.py') diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py index 18032519c..6b53dc623 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -32,29 +32,27 @@ class PornhostCom(Hoster): if not self.html: self.download_html() - file_url = re.search(r'download this file.*?.*?.*?.*?pornhost\.com - free file hosting with a twist - gallery(.*?)', self.html) - if not name: + if name is None: name = re.search(r'id="url" value="http://www\.pornhost\.com/(.*?)/"', self.html) - if not name: + if name is None: name = re.search(r'pornhost\.com - free file hosting with a twist -(.*?)', self.html) - if not name: + if name is None: name = re.search(r'"http://file[0-9]+\.pornhost\.com/.*?/(.*?)"', self.html) name = name.group(1).strip() + ".flv" -- 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/PornhostCom.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/PornhostCom.py') diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py index 6b53dc623..f0621c420 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -1,18 +1,22 @@ # -*- coding: utf-8 -*- import re + from module.plugins.Hoster import Hoster class PornhostCom(Hoster): __name__ = "PornhostCom" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?pornhost\.com/([0-9]+/[0-9]+\.html|[0-9]+)' __version__ = "0.2" + + __pattern__ = r'http://(?:www\.)?pornhost\.com/([0-9]+/[0-9]+\.html|[0-9]+)' + __description__ = """Pornhost.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