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