diff options
author | 2015-08-09 00:50:54 +0200 | |
---|---|---|
committer | 2015-08-09 00:50:54 +0200 | |
commit | b0ef3f1673e1930916604bb1264ca3a38414bc8d (patch) | |
tree | c97936e4d2a4cd6eb1072c65c8a08a7d18816b18 /module/plugins/crypter/ShSt.py | |
parent | [XFileSharingPro][XFileSharingProFolder] Added default __pattern__ (diff) | |
parent | Fix https://github.com/pyload/pyload/issues/1707 (diff) | |
download | pyload-b0ef3f1673e1930916604bb1264ca3a38414bc8d.tar.xz |
Merge pull request #1 from pyload/stable
sync with stable
Diffstat (limited to 'module/plugins/crypter/ShSt.py')
-rw-r--r-- | module/plugins/crypter/ShSt.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/module/plugins/crypter/ShSt.py b/module/plugins/crypter/ShSt.py new file mode 100644 index 000000000..754bc542c --- /dev/null +++ b/module/plugins/crypter/ShSt.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.Crypter import Crypter + +import pycurl +import re + + +class ShSt(Crypter): + __name__ = "ShSt" + __type__ = "crypter" + __version__ = "0.04" + __status__ = "testing" + + __pattern__ = r'http://sh\.st/\w+' + + __description__ = """Sh.St decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("Frederik Möllers", "fred-public@posteo.de")] + + + NAME_PATTERN = r'<title>(?P<N>.+?) - .+</title>' + + + def decrypt(self, pyfile): + #: If we use curl as a user agent, we will get a straight redirect (no waiting!) + self.req.http.c.setopt(pycurl.USERAGENT, "curl/7.42.1") + #: Fetch the target URL + header = self.load(self.pyfile.url, just_header = True, decode = False) + target_url = header['location'] + self.urls.append(target_url) |