From 3af8bfcf685f82de097ef6b110dffa77fd529eaf Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 10:01:24 +0200 Subject: [SimpleHoster] Improve logging and file checking --- module/plugins/hoster/XFileSharingPro.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 169fbc8d3..c62a42779 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.46" + __version__ = "0.47" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' @@ -21,9 +21,7 @@ class XFileSharingPro(XFSHoster): 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()))) + return super(XFileSharingPro, self)._log(type, [self.HOSTER_NAME] + args) def init(self): -- cgit v1.2.3 From d462f5224bf4ea895e813b97a3ab993c83ea0ac3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 10 Jun 2015 01:45:05 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1479 --- module/plugins/hoster/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index c62a42779..f58b7f0de 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.47" + __version__ = "0.48" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' @@ -21,7 +21,7 @@ class XFileSharingPro(XFSHoster): def _log(self, type, args): - return super(XFileSharingPro, self)._log(type, [self.HOSTER_NAME] + args) + return super(XFileSharingPro, self)._log(type, (self.HOSTER_NAME,) + args) def init(self): -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/hoster/XFileSharingPro.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index f58b7f0de..860fd5309 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.48" + __version__ = "0.49" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' @@ -49,9 +49,9 @@ class XFileSharingPro(XFSHoster): def setup(self): - self.chunkLimit = 1 - self.resumeDownload = self.premium - self.multiDL = True + self.chunk_limit = 1 + self.resume_download = self.premium + self.multi_dl = True getInfo = create_getInfo(XFileSharingPro) -- cgit v1.2.3 From d2e2b127651a5a44b56337eb6d9ca246c97a208a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/hoster/XFileSharingPro.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 860fd5309..2cbd42906 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -34,7 +34,7 @@ class XFileSharingPro(XFSHoster): account = self.core.accountManager.getAccountPlugin(self.HOSTER_NAME) - if account and account.canUse(): + if account and account.can_use(): self.account = account elif self.account: @@ -43,9 +43,9 @@ class XFileSharingPro(XFSHoster): else: return - self.user, data = self.account.selectAccount() - self.req = self.account.getAccountRequest(self.user) - self.premium = self.account.isPremium(self.user) + self.user, data = self.account.select_account() + self.req = self.account.get_account_request(self.user) + self.premium = self.account.is_premium(self.user) def setup(self): -- cgit v1.2.3 From 56389e28ba5d2f5658278bc7f486d73be747f135 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 11:44:49 +0200 Subject: Rename self.core to self.pyload (plugins only) --- module/plugins/hoster/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 2cbd42906..6d484ac61 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -27,12 +27,12 @@ class XFileSharingPro(XFSHoster): def init(self): super(XFileSharingPro, self).init() - self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] + self.__pattern__ = self.pyload.pluginManager.hosterPlugins[self.__name__]['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) + account = self.pyload.accountManager.getAccountPlugin(self.HOSTER_NAME) if account and account.can_use(): self.account = account -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/hoster/XFileSharingPro.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 6d484ac61..4d6877b2b 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -9,6 +9,7 @@ class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" __version__ = "0.49" + __status__ = "stable" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/hoster/XFileSharingPro.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 4d6877b2b..bd629d51e 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -9,7 +9,7 @@ class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" __version__ = "0.49" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' @@ -21,8 +21,8 @@ class XFileSharingPro(XFSHoster): URL_REPLACEMENTS = [("/embed-", "/")] - def _log(self, type, args): - return super(XFileSharingPro, self)._log(type, (self.HOSTER_NAME,) + args) + def _log(self, level, args): + return super(XFileSharingPro, self)._log(level, (self.HOSTER_NAME,) + args) def init(self): @@ -52,7 +52,7 @@ class XFileSharingPro(XFSHoster): def setup(self): self.chunk_limit = 1 self.resume_download = self.premium - self.multi_dl = True + self.multiDL = True getInfo = create_getInfo(XFileSharingPro) -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- module/plugins/hoster/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index bd629d51e..d7caf3097 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -44,8 +44,8 @@ class XFileSharingPro(XFSHoster): else: return - self.user, data = self.account.select_account() - self.req = self.account.get_account_request(self.user) + self.user, data = self.account.select() + self.req = self.account.get_request(self.user) self.premium = self.account.is_premium(self.user) -- cgit v1.2.3 From ecf37227de05c73b7ffe2da89a5eda1259a72543 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Jul 2015 01:09:59 +0200 Subject: Improve _log method --- module/plugins/hoster/XFileSharingPro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index d7caf3097..42d4d637e 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.49" + __version__ = "0.50" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' @@ -21,8 +21,8 @@ class XFileSharingPro(XFSHoster): URL_REPLACEMENTS = [("/embed-", "/")] - def _log(self, level, args): - return super(XFileSharingPro, self)._log(level, (self.HOSTER_NAME,) + args) + def _log(self, level, plugintype, pluginname, messages): + return super(XFileSharingPro, self)._log(level, plugintype, pluginname, (self.HOSTER_NAME,) + messages) def init(self): -- cgit v1.2.3 From e42f5783442fcbaa53e6c0faf943dd33c397e0b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 08:40:17 +0200 Subject: Fix _log method --- module/plugins/hoster/XFileSharingPro.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 42d4d637e..1613a9a5c 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.50" + __version__ = "0.51" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' @@ -22,7 +22,10 @@ class XFileSharingPro(XFSHoster): def _log(self, level, plugintype, pluginname, messages): - return super(XFileSharingPro, self)._log(level, plugintype, pluginname, (self.HOSTER_NAME,) + messages) + return super(XFileSharingPro, self)._log(level, + plugintype, + "%s: %s" % (pluginname, self.HOSTER_NAME), + messages) def init(self): -- cgit v1.2.3 From c7e2c7771fe6acd64f5ef461bf121fa77ad0c931 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 13:23:52 +0200 Subject: New plugins: AniStreamCom and CloudsixMe --- module/plugins/hoster/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 1613a9a5c..a4e7a8bf4 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.51" + __version__ = "0.52" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' @@ -34,7 +34,7 @@ class XFileSharingPro(XFSHoster): self.__pattern__ = self.pyload.pluginManager.hosterPlugins[self.__name__]['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 != '.') + 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) -- cgit v1.2.3 From d0acce3be51760fc97c6d8cf298ef37ba2f299ec Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 18:37:00 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1591 --- module/plugins/hoster/XFileSharingPro.py | 47 ++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index a4e7a8bf4..8ede709de 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.52" + __version__ = "0.53" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' @@ -29,33 +29,46 @@ class XFileSharingPro(XFSHoster): def init(self): - super(XFileSharingPro, self).init() - self.__pattern__ = self.pyload.pluginManager.hosterPlugins[self.__name__]['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.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__) - self.user, data = self.account.select() - self.req = self.account.get_request(self.user) - self.premium = self.account.is_premium(self.user) + 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] - def setup(self): - self.chunk_limit = 1 - self.resume_download = self.premium - self.multiDL = True + if not self.user or not self.account.is_logged(self.user, True): + self.account = False getInfo = create_getInfo(XFileSharingPro) -- cgit v1.2.3