summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-08-02 18:37:00 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-08-02 18:37:00 +0200
commitd0acce3be51760fc97c6d8cf298ef37ba2f299ec (patch)
treebb1e7491daf640ae06b86befbcbb4e6a5c986b01 /module/plugins/crypter
parentMerge pull request #1665 from J-8/stable (diff)
downloadpyload-d0acce3be51760fc97c6d8cf298ef37ba2f299ec.tar.xz
Fix https://github.com/pyload/pyload/issues/1591
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/XFileSharingProFolder.py43
1 files changed, 32 insertions, 11 deletions
diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py
index a0931d6ba..584cc7668 100644
--- a/module/plugins/crypter/XFileSharingProFolder.py
+++ b/module/plugins/crypter/XFileSharingProFolder.py
@@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo
class XFileSharingProFolder(XFSCrypter):
__name__ = "XFileSharingProFolder"
__type__ = "crypter"
- __version__ = "0.12"
+ __version__ = "0.13"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+'
@@ -35,20 +35,41 @@ class XFileSharingProFolder(XFSCrypter):
self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group("DOMAIN").lower()
self.HOSTER_NAME = "".join(part.capitalize() for part in re.split(r'(\.|\d+|\-)', self.HOSTER_DOMAIN) if part != '.')
- account = self.pyload.accountManager.getAccountPlugin(self.HOSTER_NAME)
- if account and account.can_use():
- self.account = account
-
- elif self.account:
- self.account.HOSTER_DOMAIN = self.HOSTER_DOMAIN
+ def _setup(self):
+ account_name = self.__name__ if self.account.HOSTER_DOMAIN is None else self.HOSTER_NAME
+ self.chunk_limit = 1
+ self.multiDL = True
+ if self.account:
+ self.req = self.pyload.requestFactory.getRequest(accountname, self.user)
+ self.premium = self.account.is_premium(self.user)
+ self.resume_download = self.premium
else:
- return
+ self.req = self.pyload.requestFactory.getRequest(account_name)
+ self.premium = False
+ self.resume_download = False
+
+
+ def load_account(self):
+ if self.req:
+ self.req.close()
+
+ if not self.account:
+ self.account = self.pyload.accountManager.getAccountPlugin(self.HOSTER_NAME)
+
+ if not self.account:
+ self.account = self.pyload.accountManager.getAccountPlugin(self.__name__)
+
+ if self.account:
+ if not self.account.HOSTER_DOMAIN:
+ self.account.HOSTER_DOMAIN = self.HOSTER_DOMAIN
+
+ if not self.user:
+ self.user = self.account.select()[0]
- self.user, data = self.account.select()
- self.req = self.account.get_request(self.user)
- self.premium = self.account.is_premium(self.user)
+ if not self.user or not self.account.is_logged(self.user, True):
+ self.account = False
getInfo = create_getInfo(XFileSharingProFolder)