summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/SimpleCrypter.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-08-01 22:34:51 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-08-01 22:34:51 +0200
commitb612fbda4fa6ed8cb0b4e2e3015e8127a20aaea2 (patch)
tree5ad7daff9f92555b73bd207447a710e0a01367a9 /module/plugins/internal/SimpleCrypter.py
parentFix https://github.com/pyload/pyload/issues/1636 (diff)
downloadpyload-b612fbda4fa6ed8cb0b4e2e3015e8127a20aaea2.tar.xz
Fix load_account routine
Diffstat (limited to 'module/plugins/internal/SimpleCrypter.py')
-rw-r--r--module/plugins/internal/SimpleCrypter.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
index 20a03df9f..084bc133c 100644
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -10,7 +10,7 @@ from module.utils import fixup, html_unescape
class SimpleCrypter(Crypter, SimpleHoster):
__name__ = "SimpleCrypter"
__type__ = "crypter"
- __version__ = "0.58"
+ __version__ = "0.59"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
@@ -57,10 +57,25 @@ class SimpleCrypter(Crypter, SimpleHoster):
#@TODO: Remove in 0.4.10
- def init(self):
- account_name = (self.__name__ + ".py").replace("Folder.py", "").replace(".py", "")
- self.account = self.pyload.accountManager.getAccountPlugin(account_name)
- self.load_account()
+ def load_account(self):
+ accountname = (self.__name__ + ".py").replace("Folder.py", "").replace(".py", "")
+
+ if self.req:
+ self.req.close()
+
+ if not self.account:
+ self.account = self.pyload.accountManager.getAccountPlugin(accountname)
+
+ if self.account:
+ if not self.user:
+ self.user, data = self.account.select()
+
+ if not self.user or not self.account.is_logged(self.user, relogin=True):
+ self.account = False
+
+ #: Browser instance, see `network.Browser`
+ self.req = self.pyload.requestFactory.getRequest(accountname,
+ self.user if self.account else None)
def handle_direct(self, pyfile):