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 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/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 f76942f6d..c6ed6a95c 100644 --- a/module/plugins/hoster/FileshareInUa.py +++ b/module/plugins/hoster/FileshareInUa.py @@ -15,8 +15,8 @@ class FileshareInUa(Hoster): __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" + __authors__ = [("fwannmacher", "felipe@warhammerproject.com")] + PATTERN_FILENAME = r'

(.*?)

' PATTERN_FILESIZE = r'(.*?)' -- 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/FileshareInUa.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/FileshareInUa.py') diff --git a/module/plugins/hoster/FileshareInUa.py b/module/plugins/hoster/FileshareInUa.py index c6ed6a95c..d6ccc9e3e 100644 --- a/module/plugins/hoster/FileshareInUa.py +++ b/module/plugins/hoster/FileshareInUa.py @@ -15,6 +15,7 @@ class FileshareInUa(Hoster): __pattern__ = r'http://(?:www\.)?fileshare.in.ua/[A-Za-z0-9]+' __description__ = """Fileshare.in.ua hoster plugin""" + __license__ = "GPLv3" __authors__ = [("fwannmacher", "felipe@warhammerproject.com")] -- cgit v1.2.3 From e600362d2450ef13567b255004861bead011e0ef Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:03:26 +0200 Subject: [FileshareInUa] Mark dead --- module/plugins/hoster/FileshareInUa.py | 76 +++------------------------------- 1 file changed, 5 insertions(+), 71 deletions(-) (limited to 'module/plugins/hoster/FileshareInUa.py') diff --git a/module/plugins/hoster/FileshareInUa.py b/module/plugins/hoster/FileshareInUa.py index d6ccc9e3e..3f8c3d4d4 100644 --- a/module/plugins/hoster/FileshareInUa.py +++ b/module/plugins/hoster/FileshareInUa.py @@ -1,84 +1,18 @@ # -*- coding: utf-8 -*- -import re +from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo -from module.network.RequestFactory import getURL -from module.plugins.Hoster import Hoster -from module.utils import parseFileSize - -class FileshareInUa(Hoster): +class FileshareInUa(DeadHoster): __name__ = "FileshareInUa" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" - __pattern__ = r'http://(?:www\.)?fileshare.in.ua/[A-Za-z0-9]+' + __pattern__ = r'https?://(?:www\.)?fileshare\.in\.ua/\w{7}' __description__ = """Fileshare.in.ua hoster plugin""" __license__ = "GPLv3" __authors__ = [("fwannmacher", "felipe@warhammerproject.com")] - PATTERN_FILENAME = r'

(.*?)

' - PATTERN_FILESIZE = r'(.*?)' - PATTERN_OFFLINE = r"This file doesn't exist, or has been removed." - - - def setup(self): - self.resumeDownload = self.multiDL = True - - def process(self, pyfile): - self.pyfile = pyfile - self.html = self.load(pyfile.url, decode=True) - - if not self._checkOnline(): - self.offline() - - pyfile.name = self._getName() - - link = self._getLink() - - if not link.startswith('http://'): - link = "http://fileshare.in.ua" + link - - self.download(link) - - def _checkOnline(self): - if re.search(self.PATTERN_OFFLINE, self.html): - return False - else: - return True - - def _getName(self): - name = re.search(self.PATTERN_FILENAME, self.html) - if name is None: - self.fail("%s: Plugin broken." % self.__name__) - - return name.group(1) - - def _getLink(self): - return re.search("", self.html).group(1) - - -def getInfo(urls): - result = [] - - for url in urls: - html = getURL(url) - - if re.search(FileshareInUa.PATTERN_OFFLINE, html): - result.append((url, 0, 1, url)) - else: - name = re.search(FileshareInUa.PATTERN_FILENAME, html) - - if name is None: - result.append((url, 0, 1, url)) - continue - - name = name.group(1) - size = re.search(FileshareInUa.PATTERN_FILESIZE, html) - size = parseFileSize(size.group(1)) - - result.append((name, size, 3, url)) - - yield result +getInfo = create_getInfo(FileshareInUa) -- 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/FileshareInUa.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/FileshareInUa.py') diff --git a/module/plugins/hoster/FileshareInUa.py b/module/plugins/hoster/FileshareInUa.py index 3f8c3d4d4..08e10dccb 100644 --- a/module/plugins/hoster/FileshareInUa.py +++ b/module/plugins/hoster/FileshareInUa.py @@ -4,15 +4,15 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo class FileshareInUa(DeadHoster): - __name__ = "FileshareInUa" - __type__ = "hoster" + __name__ = "FileshareInUa" + __type__ = "hoster" __version__ = "0.02" __pattern__ = r'https?://(?:www\.)?fileshare\.in\.ua/\w{7}' __description__ = """Fileshare.in.ua hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("fwannmacher", "felipe@warhammerproject.com")] + __license__ = "GPLv3" + __authors__ = [("fwannmacher", "felipe@warhammerproject.com")] getInfo = create_getInfo(FileshareInUa) -- cgit v1.2.3