diff options
-rw-r--r-- | module/plugins/Account.py | 6 | ||||
-rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py index 30561f126..9c46f5398 100644 --- a/module/plugins/Account.py +++ b/module/plugins/Account.py @@ -58,7 +58,11 @@ class Account(): print_exc() finally: if req: req.close() - + + def relogin(self): + for user, data in self.accounts.iteritems(): + self._login(user, data) + def setAccounts(self, accounts): self.accounts = accounts for user, data in self.accounts.iteritems(): diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index f238c59bc..31cbc8285 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -120,7 +120,12 @@ class ShareonlineBiz(Hoster): """ returns the absolute downloadable filepath """ if self.account: - return re.search('loadfilelink\.decode\("(.*?)"\);', self.html, re.S).group(1) + try: + return re.search('loadfilelink\.decode\("(.*?)"\);', self.html, re.S).group(1) + except: + self.log.debug("Login issue, trying again") + self.account.relogin() + self.retry() file_url_pattern = r'var\sdl="(.*?)"' return b64decode(re.search(file_url_pattern, self.html).group(1)) |