diff options
author | Stefano <l.stickell@yahoo.it> | 2014-05-03 22:24:38 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-05-03 22:24:58 +0200 |
commit | bd4ead18e025c6aff3d37b74cacae2731e738aa2 (patch) | |
tree | 3b1bf1dc667c226ae20f4186ebbd26863efa0784 /module/plugins/hoster/File4safeCom.py | |
parent | 1Fichier: premium support (diff) | |
download | pyload-bd4ead18e025c6aff3d37b74cacae2731e738aa2.tar.xz |
File4safe premium
+ XFSPAccount improved
Resolves #431
Diffstat (limited to 'module/plugins/hoster/File4safeCom.py')
-rw-r--r-- | module/plugins/hoster/File4safeCom.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py new file mode 100644 index 000000000..9e06972e2 --- /dev/null +++ b/module/plugins/hoster/File4safeCom.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +import re +from pycurl import FOLLOWLOCATION + +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + + +class File4safeCom(XFileSharingPro): + __name__ = "File4safeCom" + __type__ = "hoster" + __pattern__ = r'https?://(?:www\.)?file4safe\.com/\w+' + __version__ = "0.01" + __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 + + 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) + + found = re.search(r"Location\s*:\s*(.*)", self.header, re.I) + if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)): + location = found.group(1).strip() + self.startDownload(location) + else: + self.parseError("Unable to detect premium download link") + + +getInfo = create_getInfo(File4safeCom) |