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/YourfilesTo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/YourfilesTo.py') diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index c8c5c523c..3fb517eef 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -31,7 +31,7 @@ class YourfilesTo(Hoster): self.wait() def get_waiting_time(self): - if self.html is None: + if not self.html: self.download_html() #var zzipitime = 15; @@ -59,7 +59,7 @@ class YourfilesTo(Hoster): self.fail("absolute filepath could not be found. offline? ") def get_file_name(self): - if self.html is None: + if not self.html: self.download_html() return re.search("(.*)", self.html).group(1) @@ -67,7 +67,7 @@ class YourfilesTo(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"HTTP Status 404", self.html) is not None: -- 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/YourfilesTo.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/YourfilesTo.py') diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 3fb517eef..bdb91819f 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -1,19 +1,24 @@ # -*- coding: utf-8 -*- import re -import urllib + +from urllib import unquote + from module.plugins.Hoster import Hoster class YourfilesTo(Hoster): __name__ = "YourfilesTo" __type__ = "hoster" - __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+' __version__ = "0.21" + + __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+' + __description__ = """Youfiles.to hoster plugin""" __author_name__ = ("jeix", "skydancer") __author_mail__ = ("jeix@hasnomail.de", "skydancer@hasnomail.de") + def process(self, pyfile): self.pyfile = pyfile self.prepare() @@ -53,7 +58,7 @@ class YourfilesTo(Hoster): url = re.search(r"var bla = '(.*?)';", self.html) if url: url = url.group(1) - url = urllib.unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", "")) + url = unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", "")) return url else: self.fail("absolute filepath could not be found. offline? ") -- 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/YourfilesTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/YourfilesTo.py') diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index bdb91819f..8b91ebe89 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -15,8 +15,8 @@ class YourfilesTo(Hoster): __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+' __description__ = """Youfiles.to hoster plugin""" - __author_name__ = ("jeix", "skydancer") - __author_mail__ = ("jeix@hasnomail.de", "skydancer@hasnomail.de") + __authors__ = [("jeix", "jeix@hasnomail.de"), + ("skydancer", "skydancer@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/YourfilesTo.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/YourfilesTo.py') diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 8b91ebe89..efbb927f0 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -15,6 +15,7 @@ class YourfilesTo(Hoster): __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+' __description__ = """Youfiles.to hoster plugin""" + __license__ = "GPLv3" __authors__ = [("jeix", "jeix@hasnomail.de"), ("skydancer", "skydancer@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/YourfilesTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/YourfilesTo.py') diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index efbb927f0..4487a728a 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -12,7 +12,7 @@ class YourfilesTo(Hoster): __type__ = "hoster" __version__ = "0.21" - __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+' + __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=\w+' __description__ = """Youfiles.to hoster plugin""" __license__ = "GPLv3" -- 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/YourfilesTo.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'module/plugins/hoster/YourfilesTo.py') diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 4487a728a..9de5929ff 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -25,6 +25,7 @@ class YourfilesTo(Hoster): self.prepare() self.download(self.get_file_url()) + def prepare(self): if not self.file_exists(): self.offline() @@ -36,6 +37,7 @@ class YourfilesTo(Hoster): self.logDebug("%s: Waiting %d seconds." % (self.__name__, wait_time)) self.wait() + def get_waiting_time(self): if not self.html: self.download_html() @@ -49,10 +51,12 @@ class YourfilesTo(Hoster): return sec + def download_html(self): url = self.pyfile.url self.html = self.load(url) + def get_file_url(self): """ returns the absolute downloadable filepath """ @@ -64,12 +68,14 @@ class YourfilesTo(Hoster): else: self.fail("absolute filepath could not be found. offline? ") + def get_file_name(self): if not self.html: self.download_html() return re.search("(.*)", self.html).group(1) + def file_exists(self): """ returns True or False """ -- 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/YourfilesTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/YourfilesTo.py') diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 9de5929ff..38cae4deb 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -66,7 +66,7 @@ class YourfilesTo(Hoster): url = unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", "")) return url else: - self.fail("absolute filepath could not be found. offline? ") + self.error("Absolute filepath not found") def get_file_name(self): -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro 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/YourfilesTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/YourfilesTo.py') diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 38cae4deb..401f3174a 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -34,7 +34,7 @@ class YourfilesTo(Hoster): wait_time = self.get_waiting_time() self.setWait(wait_time) - self.logDebug("%s: Waiting %d seconds." % (self.__name__, wait_time)) + self.logDebug("Waiting %d seconds." % wait_time) self.wait() @@ -66,7 +66,7 @@ class YourfilesTo(Hoster): url = unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", "")) return url else: - self.error("Absolute filepath not found") + self.error(_("Absolute filepath not found")) def get_file_name(self): -- 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/YourfilesTo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/YourfilesTo.py') diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index 401f3174a..caa259cbd 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -8,16 +8,16 @@ from module.plugins.Hoster import Hoster class YourfilesTo(Hoster): - __name__ = "YourfilesTo" - __type__ = "hoster" + __name__ = "YourfilesTo" + __type__ = "hoster" __version__ = "0.21" __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=\w+' __description__ = """Youfiles.to hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("jeix", "jeix@hasnomail.de"), - ("skydancer", "skydancer@hasnomail.de")] + __license__ = "GPLv3" + __authors__ = [("jeix", "jeix@hasnomail.de"), + ("skydancer", "skydancer@hasnomail.de")] def process(self, pyfile): -- cgit v1.2.3 From 38a5cae36ebeb1894fa3c6a5c2f2eb2d58fe293b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 01:39:26 +0100 Subject: [Plugin] Fix wait routine 2 --- module/plugins/hoster/YourfilesTo.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hoster/YourfilesTo.py') diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index caa259cbd..83ab89110 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -34,7 +34,6 @@ class YourfilesTo(Hoster): wait_time = self.get_waiting_time() self.setWait(wait_time) - self.logDebug("Waiting %d seconds." % wait_time) self.wait() -- cgit v1.2.3