diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-11-02 22:42:58 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-11-02 22:42:58 +0100 |
commit | a98047d04df2790e63f5f5e6c1068821da1f36ae (patch) | |
tree | 7190982b787d8915fa17bea6c49aacd9c482ea6b /module/plugins/crypter | |
parent | [XFileSharingPro] Fix hook plugin (diff) | |
download | pyload-a98047d04df2790e63f5f5e6c1068821da1f36ae.tar.xz |
[XFileSharingPro] Fix hoster and crypter plugins
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/XFileSharingProFolder.py | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index bc795186a..dffd8909c 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -2,13 +2,13 @@ import re -from module.plugins.internal.XFSPCrypter import XFSPCrypter +from module.plugins.internal.XFSCrypter import XFSCrypter -class XFileSharingProFolder(XFSPCrypter): +class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), @@ -19,18 +19,29 @@ class XFileSharingProFolder(XFSPCrypter): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + def _log(self, type, args): + msg = " | ".join([str(a).strip() for a in args if a]) + logger = getattr(self.log, type) + logger("%s: %s: %s" % (self.__name__, self.HOSTER_NAME, msg or _("%s MARK" % type.upper()))) + + def init(self): + super(XFileSharingProFolder, self).init() + 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('.')]) - account = self.core.accountManager.getAccountPlugin(account_name) + self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group(1).lower() + self.HOSTER_NAME = "".join([str.capitalize() for str in self.HOSTER_DOMAIN.split('.')]) - if account and account.canUse(): - self.user, data = account.selectAccount() - self.req = account.getAccountRequest(self.user) - self.premium = account.isPremium(self.user) + account = self.core.accountManager.getAccountPlugin(self.HOSTER_NAME) + if account and account.canUse(): self.account = account + elif self.account: + self.account.HOSTER_DOMAIN = self.HOSTER_DOMAIN else: - self.account.HOSTER_NAME = self.HOSTER_NAME + return + + self.user, data = self.account.selectAccount() + self.req = self.account.getAccountRequest(self.user) + self.premium = self.account.isPremium(self.user) |