From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/hoster/FileshareInUa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FileshareInUa.py') diff --git a/module/plugins/hoster/FileshareInUa.py b/module/plugins/hoster/FileshareInUa.py index db2b1a998..4ec33485e 100644 --- a/module/plugins/hoster/FileshareInUa.py +++ b/module/plugins/hoster/FileshareInUa.py @@ -17,7 +17,7 @@ class FileshareInUa(Hoster): PATTERN_FILENAME = r'

(.*?)

' PATTERN_FILESIZE = r'(.*?)' - PATTERN_OFFLINE = "This file doesn't exist, or has been removed." + PATTERN_OFFLINE = r"This file doesn't exist, or has been removed." def setup(self): self.resumeDownload = self.multiDL = True -- cgit v1.2.3 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/FileshareInUa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FileshareInUa.py') diff --git a/module/plugins/hoster/FileshareInUa.py b/module/plugins/hoster/FileshareInUa.py index 4ec33485e..52e084b9c 100644 --- a/module/plugins/hoster/FileshareInUa.py +++ b/module/plugins/hoster/FileshareInUa.py @@ -46,7 +46,7 @@ class FileshareInUa(Hoster): def _getName(self): name = re.search(self.PATTERN_FILENAME, self.html) - if name is None: + if not name: self.fail("%s: Plugin broken." % self.__name__) return name.group(1) @@ -66,7 +66,7 @@ def getInfo(urls): else: name = re.search(FileshareInUa.PATTERN_FILENAME, html) - if name is None: + if not name: result.append((url, 0, 1, url)) continue -- 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/FileshareInUa.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/FileshareInUa.py') diff --git a/module/plugins/hoster/FileshareInUa.py b/module/plugins/hoster/FileshareInUa.py index 52e084b9c..7c8c6f8ff 100644 --- a/module/plugins/hoster/FileshareInUa.py +++ b/module/plugins/hoster/FileshareInUa.py @@ -31,12 +31,12 @@ class FileshareInUa(Hoster): pyfile.name = self._getName() - self.link = self._getLink() + link = self._getLink() - if not self.link.startswith('http://'): - self.link = "http://fileshare.in.ua" + self.link + if not link.startswith('http://'): + link = "http://fileshare.in.ua" + link - self.download(self.link) + self.download(link) def _checkOnline(self): if re.search(self.PATTERN_OFFLINE, self.html): @@ -46,7 +46,7 @@ class FileshareInUa(Hoster): def _getName(self): name = re.search(self.PATTERN_FILENAME, self.html) - if not name: + if name is None: self.fail("%s: Plugin broken." % self.__name__) return name.group(1) @@ -66,7 +66,7 @@ def getInfo(urls): else: name = re.search(FileshareInUa.PATTERN_FILENAME, html) - if not name: + if name is None: result.append((url, 0, 1, url)) continue -- 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/FileshareInUa.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FileshareInUa.py') diff --git a/module/plugins/hoster/FileshareInUa.py b/module/plugins/hoster/FileshareInUa.py index 7c8c6f8ff..f76942f6d 100644 --- a/module/plugins/hoster/FileshareInUa.py +++ b/module/plugins/hoster/FileshareInUa.py @@ -1,16 +1,19 @@ # -*- coding: utf-8 -*- import re -from module.plugins.Hoster import Hoster + from module.network.RequestFactory import getURL +from module.plugins.Hoster import Hoster from module.utils import parseFileSize class FileshareInUa(Hoster): __name__ = "FileshareInUa" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?fileshare.in.ua/[A-Za-z0-9]+' __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?fileshare.in.ua/[A-Za-z0-9]+' + __description__ = """Fileshare.in.ua hoster plugin""" __author_name__ = "fwannmacher" __author_mail__ = "felipe@warhammerproject.com" @@ -19,6 +22,7 @@ class FileshareInUa(Hoster): PATTERN_FILESIZE = r'(.*?)' PATTERN_OFFLINE = r"This file doesn't exist, or has been removed." + def setup(self): self.resumeDownload = self.multiDL = True -- cgit v1.2.3