From 76c67b22c0b2dbd275fae77e8a3121acb2d4301b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Sep 2014 15:39:33 +0200 Subject: Fix cookie deletion + Account support for SimpleCrypter Fix: https://github.com/pyload/pyload/issues/749 --- module/plugins/internal/SimpleCrypter.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/SimpleCrypter.py') 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() -- cgit v1.2.3