diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-09-26 15:39:33 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-09-26 15:39:33 +0200 |
commit | 76c67b22c0b2dbd275fae77e8a3121acb2d4301b (patch) | |
tree | 1b5db66ef14830ceaadeddd7ac0c84904f7647c9 /module/plugins/internal/SimpleCrypter.py | |
parent | Remove ReCaptcha (diff) | |
download | pyload-76c67b22c0b2dbd275fae77e8a3121acb2d4301b.tar.xz |
Fix cookie deletion + Account support for SimpleCrypter
Fix: https://github.com/pyload/pyload/issues/749
Diffstat (limited to 'module/plugins/internal/SimpleCrypter.py')
-rw-r--r-- | module/plugins/internal/SimpleCrypter.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 3cd52d9f1..bacfce1dd 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -10,7 +10,7 @@ from module.utils import html_unescape class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" __type__ = "crypter" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = None @@ -48,9 +48,14 @@ class SimpleCrypter(Crypter): return the html of the page number page_n """ + URL_REPLACEMENTS = [] - SH_COOKIES = True # or False or list of tuples [(domain, name, value)] + SH_BROKEN_ENCODING = False #: Set to True or encoding name if encoding in http header is not correct + SH_COOKIES = True #: or False or list of tuples [(domain, name, value)] + + LOGIN_ACCOUNT = False + LOGIN_PREMIUM = False def setup(self): @@ -59,9 +64,15 @@ class SimpleCrypter(Crypter): def decrypt(self, pyfile): + if self.LOGIN_ACCOUNT and not self.account: + self.fail('Required account not found!') + + if self.LOGIN_PREMIUM and not self.premium: + self.fail('Required premium account not found!') + pyfile.url = replace_patterns(pyfile.url, self.URL_REPLACEMENTS) - self.html = self.load(pyfile.url, decode=True) + self.html = self.load(pyfile.url, decode=not self.SH_BROKEN_ENCODING, cookies=self.SH_COOKIES) self.checkOnline() |