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/File4safeCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index 9e06972e2..da63316ad 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -26,7 +26,7 @@ class File4safeCom(XFileSharingPro): self.req.http.c.setopt(FOLLOWLOCATION, 1) found = re.search(r"Location\s*:\s*(.*)", self.header, re.I) - if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)): + if found and re.match(self.LINK_PATTERN, found.group(1)): location = found.group(1).strip() self.startDownload(location) else: -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hoster/File4safeCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index da63316ad..bc0f20dbe 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -25,9 +25,9 @@ class File4safeCom(XFileSharingPro): self.header = self.req.http.header self.req.http.c.setopt(FOLLOWLOCATION, 1) - found = re.search(r"Location\s*:\s*(.*)", self.header, re.I) - if found and re.match(self.LINK_PATTERN, found.group(1)): - location = found.group(1).strip() + m = re.search(r"Location\s*:\s*(.*)", self.header, re.I) + if m and re.match(self.LINK_PATTERN, m.group(1)): + location = m.group(1).strip() self.startDownload(location) else: self.parseError("Unable to detect premium download link") -- 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/File4safeCom.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index bc0f20dbe..4ec814fd9 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re + from pycurl import FOLLOWLOCATION from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo @@ -9,14 +10,17 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf class File4safeCom(XFileSharingPro): __name__ = "File4safeCom" __type__ = "hoster" - __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w+' __version__ = "0.01" + + __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w+' + __description__ = """File4safe.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" HOSTER_NAME = "file4safe.com" + def handlePremium(self): self.req.http.lastURL = self.pyfile.url -- cgit v1.2.3 From 287980f82eb56d4208839fd9dfcb929df31110ee Mon Sep 17 00:00:00 2001 From: stickell Date: Sun, 7 Sep 2014 21:54:13 +0200 Subject: [File4safe] distributing LINK_PATTERN Fixes #729 --- module/plugins/hoster/File4safeCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index 4ec814fd9..7ec775103 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -10,7 +10,7 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf class File4safeCom(XFileSharingPro): __name__ = "File4safeCom" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w+' -- cgit v1.2.3 From 390f7deca39ba14f698b3c56660eee2a5502b79a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 28 Sep 2014 16:50:29 +0200 Subject: Cleaned-up XFileSharingPro based plugins --- module/plugins/hoster/File4safeCom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index 7ec775103..f1785011d 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -12,12 +12,13 @@ class File4safeCom(XFileSharingPro): __type__ = "hoster" __version__ = "0.02" - __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w+' + __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w{12}' __description__ = """File4safe.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" + HOSTER_NAME = "file4safe.com" -- 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/File4safeCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index f1785011d..41b10b905 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -15,8 +15,7 @@ class File4safeCom(XFileSharingPro): __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w{12}' __description__ = """File4safe.com hoster plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" + __authors__ = [("stickell", "l.stickell@yahoo.it")] HOSTER_NAME = "file4safe.com" -- cgit v1.2.3 From 60320d4addec35b9cbd14a05b6c33fba63d6c620 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 16:14:33 +0200 Subject: Update plugins XFileSharingPro based --- module/plugins/hoster/File4safeCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index 41b10b905..c5d69c644 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -4,13 +4,13 @@ import re from pycurl import FOLLOWLOCATION -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo +from module.plugins.hoster.XFSPHoster import XFSPHoster, create_getInfo -class File4safeCom(XFileSharingPro): +class File4safeCom(XFSPHoster): __name__ = "File4safeCom" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w{12}' -- cgit v1.2.3 From 355c80c5e456f22a4fd3247985710a46a43a79f9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 19:51:40 +0200 Subject: Fix previous plugins update --- module/plugins/hoster/File4safeCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index c5d69c644..ca116ef64 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -4,13 +4,13 @@ import re from pycurl import FOLLOWLOCATION -from module.plugins.hoster.XFSPHoster import XFSPHoster, create_getInfo +from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo class File4safeCom(XFSPHoster): __name__ = "File4safeCom" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w{12}' -- 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/File4safeCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index ca116ef64..e5927dd69 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -15,6 +15,7 @@ class File4safeCom(XFSPHoster): __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w{12}' __description__ = """File4safe.com hoster plugin""" + __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] -- cgit v1.2.3 From 2ae91b81a2f12a1c9b1f78524df78a2b3f1ef494 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 14:52:42 +0200 Subject: Update hosters to self.error --- module/plugins/hoster/File4safeCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index e5927dd69..211e668a1 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo class File4safeCom(XFSPHoster): __name__ = "File4safeCom" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w{12}' @@ -35,7 +35,7 @@ class File4safeCom(XFSPHoster): location = m.group(1).strip() self.startDownload(location) else: - self.parseError("Unable to detect premium download link") + self.error("Unable to detect premium download link") getInfo = create_getInfo(File4safeCom) -- 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/File4safeCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index 211e668a1..d7e951010 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -35,7 +35,7 @@ class File4safeCom(XFSPHoster): location = m.group(1).strip() self.startDownload(location) else: - self.error("Unable to detect premium download link") + self.error(_("LINK_PATTERN not found")) getInfo = create_getInfo(File4safeCom) -- 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/File4safeCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py index d7e951010..593a2baca 100644 --- a/module/plugins/hoster/File4safeCom.py +++ b/module/plugins/hoster/File4safeCom.py @@ -8,15 +8,15 @@ from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo class File4safeCom(XFSPHoster): - __name__ = "File4safeCom" - __type__ = "hoster" + __name__ = "File4safeCom" + __type__ = "hoster" __version__ = "0.05" __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w{12}' __description__ = """File4safe.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] HOSTER_NAME = "file4safe.com" -- cgit v1.2.3 From 1fd28722083230fd9dfe143414767f8c774cfb90 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 30 Oct 2014 17:17:16 +0100 Subject: [File4safeCom] Removed, use XFileSharingPro instead --- module/plugins/hoster/File4safeCom.py | 41 ----------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 module/plugins/hoster/File4safeCom.py (limited to 'module/plugins/hoster/File4safeCom.py') diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py deleted file mode 100644 index 593a2baca..000000000 --- a/module/plugins/hoster/File4safeCom.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from pycurl import FOLLOWLOCATION - -from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo - - -class File4safeCom(XFSPHoster): - __name__ = "File4safeCom" - __type__ = "hoster" - __version__ = "0.05" - - __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w{12}' - - __description__ = """File4safe.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] - - - HOSTER_NAME = "file4safe.com" - - - def handlePremium(self): - self.req.http.lastURL = self.pyfile.url - - self.req.http.c.setopt(FOLLOWLOCATION, 0) - self.load(self.pyfile.url, post=self.getPostParameters(), decode=True) - self.header = self.req.http.header - self.req.http.c.setopt(FOLLOWLOCATION, 1) - - m = re.search(r"Location\s*:\s*(.*)", self.header, re.I) - if m and re.match(self.LINK_PATTERN, m.group(1)): - location = m.group(1).strip() - self.startDownload(location) - else: - self.error(_("LINK_PATTERN not found")) - - -getInfo = create_getInfo(File4safeCom) -- cgit v1.2.3