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