summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/hoster/XFileSharingPro.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin/hoster/XFileSharingPro.py')
-rw-r--r--pyload/plugin/hoster/XFileSharingPro.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/pyload/plugin/hoster/XFileSharingPro.py b/pyload/plugin/hoster/XFileSharingPro.py
new file mode 100644
index 000000000..140a69a72
--- /dev/null
+++ b/pyload/plugin/hoster/XFileSharingPro.py
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from pyload.plugin.internal.XFSHoster import XFSHoster
+
+
+class XFileSharingPro(XFSHoster):
+ __name = "XFileSharingPro"
+ __type = "hoster"
+ __version = "0.45"
+
+ __pattern = r'^unmatchable$'
+
+ __description = """XFileSharingPro dummy hoster plugin for hook"""
+ __license = "GPLv3"
+ __authors = [("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ URL_REPLACEMENTS = [("/embed-", "/")]
+
+
+ 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.getClassName(), self.HOSTER_NAME, msg or _("%s MARK" % type.upper())))
+
+
+ def init(self):
+ super(XFileSharingPro, self).init()
+
+ self.__pattern = self.core.pluginManager.hosterPlugins[self.getClassName()]['pattern']
+
+ 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.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:
+ return
+
+ 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