diff options
-rw-r--r-- | module/plugins/crypter/XFileSharingProFolder.py | 12 | ||||
-rw-r--r-- | module/plugins/hoster/XFileSharingPro.py | 19 |
2 files changed, 25 insertions, 6 deletions
diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index f3003e2aa..ba8c7b8b7 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSPCrypter import XFSPCrypter class XFileSharingProFolder(XFSPCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.01" + __version__ = "0.02" __pattern__ = r'^unmatchable$' @@ -17,6 +17,14 @@ class XFileSharingProFolder(XFSPCrypter): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - def setup(self): + def init(self): self.__pattern__ = self.core.pluginManager.crypterPlugins[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('.')]) + self.account = self.core.accountManager.getAccountPlugin(account_name) + + if self.account and self.account.canUse(): + self.user, data = self.account.selectAccount() + self.req = self.account.getAccountRequest(self.user) + self.premium = self.account.isPremium(self.user) diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index e670dc5af..4eb6e95d3 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,23 @@ 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('.')]) + self.account = self.core.accountManager.getAccountPlugin(account_name) + + if self.account and self.account.canUse(): + self.user, data = self.account.selectAccount() + self.req = self.account.getAccountRequest(self.user) + self.premium = self.account.isPremium(self.user) + + 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) |