diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-22 02:49:38 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-22 02:49:38 +0200 |
commit | b7840691a013e38ab8ac08087cb6d4eb1e45febc (patch) | |
tree | 02df566d1c80b428cdc1140a55fdc44b6e628e60 /module/plugins/internal/SimpleCrypter.py | |
parent | [SimpleHoster] Fix http://forum.pyload.org/viewtopic.php?f=12&t=4637 (diff) | |
download | pyload-b7840691a013e38ab8ac08087cb6d4eb1e45febc.tar.xz |
[SimpleCrypter] Fix https://github.com/pyload/pyload/issues/2094
Diffstat (limited to 'module/plugins/internal/SimpleCrypter.py')
-rw-r--r-- | module/plugins/internal/SimpleCrypter.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index dc02cd056..bdd58da1b 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -129,19 +129,25 @@ class SimpleCrypter(Crypter): #@TODO: Remove in 0.4.10 - def _setup(self): - orig_name = self.classname - self.classname = orig_name.rstrip("Folder") - super(SimpleCrypter, self)._setup() - self.classname = orig_name + def setup_base(self): + class_name = self.classname.rsplit("Folder", 1)[0] + + if self.account: + self.req = self.pyload.requestFactory.getRequest(class_name, self.account.user) + self.premium = self.account.info['data']['premium'] #@NOTE: Avoid one unnecessary get_info call by `self.account.premium` here + else: + self.req = self.pyload.requestFactory.getRequest(class_name) + self.premium = False + + super(SimpleCrypter, self).setup_base() #@TODO: Remove in 0.4.10 def load_account(self): - orig_name = self.classname - self.classname = orig_name.rstrip("Folder") + class_name = self.classname + self.__class__.__name__ = class_name.rsplit("Folder", 1)[0] super(SimpleCrypter, self).load_account() - self.classname = orig_name + self.__class__.__name__ = class_name def handle_direct(self, pyfile): |