diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-11-01 18:50:11 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-11-01 18:50:11 +0100 |
commit | 7d21001f0495102a2948912d5416dbd3362dc446 (patch) | |
tree | bb97b9076b11c6b77a5e09cd3e380c564eb40c50 /module/plugins/internal | |
parent | [XFileSharingPro] Tiny code cosmetics (diff) | |
download | pyload-7d21001f0495102a2948912d5416dbd3362dc446.tar.xz |
[SimpleCrypter] Move TEXT_ENCODING check to prepare routine
Diffstat (limited to 'module/plugins/internal')
-rw-r--r-- | module/plugins/internal/SimpleCrypter.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index e586580d7..86e8077e7 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -13,7 +13,7 @@ from module.utils import fixup, html_unescape class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" __type__ = "crypter" - __version__ = "0.23" + __version__ = "0.24" __pattern__ = None __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), #: Overrides core.config['general']['folder_per_package'] @@ -93,8 +93,12 @@ class SimpleCrypter(Crypter): set_cookies(self.req.cj, self.COOKIES) self.pyfile.url = replace_patterns(self.pyfile.url, self.URL_REPLACEMENTS) + self.html = self.load(self.pyfile.url, decode=not self.TEXT_ENCODING, cookies=bool(self.COOKIES)) + if isinstance(self.TEXT_ENCODING, basestring): + self.html = unicode(self.html, self.TEXT_ENCODING) + def decrypt(self, pyfile): self.prepare() @@ -130,9 +134,6 @@ class SimpleCrypter(Crypter): def getPackageNameAndFolder(self): - if isinstance(self.TEXT_ENCODING, basestring): - self.html = unicode(self.html, self.TEXT_ENCODING) - if hasattr(self, 'TITLE_PATTERN'): try: m = re.search(self.TITLE_PATTERN, self.html) |