diff options
Diffstat (limited to 'module/plugins/hoster/XFileSharingPro.py')
-rw-r--r-- | module/plugins/hoster/XFileSharingPro.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index e670dc5af..fc348c90f 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo class XFileSharingPro(XFSPHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.38" + __version__ = "0.39" __pattern__ = r'^unmatchable$' @@ -20,12 +20,27 @@ class XFileSharingPro(XFSPHoster): FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files + def init(self): + self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] + self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() + + account_name = "".join([str.capitalize() for str in self.HOSTER_NAME.split('.')]) + account = self.core.accountManager.getAccountPlugin(account_name) + + if account and account.canUse(): + self.user, data = account.selectAccount() + self.req = account.getAccountRequest(self.user) + self.premium = account.isPremium(self.user) + + self.account = account + else: + self.account.HOSTER_NAME = self.HOSTER_NAME + + def setup(self): self.chunkLimit = 1 + self.resumeDownload = self.premium self.multiDL = True - self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] - self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() - getInfo = create_getInfo(XFileSharingPro) |