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 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/PornhostCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/PornhostCom.py') diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py index f0621c420..2c9683620 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -13,8 +13,7 @@ class PornhostCom(Hoster): __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" + __authors__ = [("jeix", "jeix@hasnomail.de")] def process(self, pyfile): -- 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/PornhostCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/PornhostCom.py') diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py index 2c9683620..94bbb426b 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -13,6 +13,7 @@ class PornhostCom(Hoster): __pattern__ = r'http://(?:www\.)?pornhost\.com/([0-9]+/[0-9]+\.html|[0-9]+)' __description__ = """Pornhost.com hoster plugin""" + __license__ = "GPLv3" __authors__ = [("jeix", "jeix@hasnomail.de")] -- 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/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 94bbb426b..51426de71 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -10,7 +10,7 @@ class PornhostCom(Hoster): __type__ = "hoster" __version__ = "0.2" - __pattern__ = r'http://(?:www\.)?pornhost\.com/([0-9]+/[0-9]+\.html|[0-9]+)' + __pattern__ = r'http://(?:www\.)?pornhost\.com/(\d+/\d+\.html|\d+)' __description__ = """Pornhost.com hoster plugin""" __license__ = "GPLv3" @@ -38,11 +38,11 @@ class PornhostCom(Hoster): url = re.search(r'download this file.*?.*?pornhost\.com - free file hosting with a twist -(.*?)', self.html) if name is None: - name = re.search(r'"http://file[0-9]+\.pornhost\.com/.*?/(.*?)"', self.html) + name = re.search(r'"http://file\d+\.pornhost\.com/.*?/(.*?)"', self.html) name = name.group(1).strip() + ".flv" -- 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/PornhostCom.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'module/plugins/hoster/PornhostCom.py') diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py index 51426de71..6fb0fad83 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -25,11 +25,13 @@ class PornhostCom(Hoster): pyfile.name = self.get_file_name() self.download(self.get_file_url()) + # Old interface def download_html(self): url = self.pyfile.url self.html = self.load(url) + def get_file_url(self): """ returns the absolute downloadable filepath """ @@ -47,6 +49,7 @@ class PornhostCom(Hoster): return url.group(1).strip() + def get_file_name(self): if not self.html: self.download_html() @@ -63,6 +66,7 @@ class PornhostCom(Hoster): return name + def file_exists(self): """ returns True or False """ -- 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/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 6fb0fad83..a6f415043 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -6,15 +6,15 @@ from module.plugins.Hoster import Hoster class PornhostCom(Hoster): - __name__ = "PornhostCom" - __type__ = "hoster" + __name__ = "PornhostCom" + __type__ = "hoster" __version__ = "0.2" __pattern__ = r'http://(?:www\.)?pornhost\.com/(\d+/\d+\.html|\d+)' __description__ = """Pornhost.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("jeix", "jeix@hasnomail.de")] + __license__ = "GPLv3" + __authors__ = [("jeix", "jeix@hasnomail.de")] def process(self, pyfile): -- cgit v1.2.3 From 6151e81fa0b325dffda3da4228d5821e73db3ef3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 01:19:46 +0100 Subject: Fix __version__ format in some plugins --- module/plugins/hoster/PornhostCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/PornhostCom.py') diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py index a6f415043..71342f3e0 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -8,7 +8,7 @@ from module.plugins.Hoster import Hoster class PornhostCom(Hoster): __name__ = "PornhostCom" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?pornhost\.com/(\d+/\d+\.html|\d+)' -- cgit v1.2.3