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/crypter/XFileSharingProFolder.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index 2e1a2f022..8043a1183 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.06" + __version__ = "0.07" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), @@ -20,9 +20,7 @@ class XFileSharingProFolder(XFSCrypter): 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(XFileSharingProFolder, 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/crypter/XFileSharingProFolder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index 8043a1183..70e7365dd 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), @@ -20,7 +20,7 @@ class XFileSharingProFolder(XFSCrypter): def _log(self, type, args): - return super(XFileSharingProFolder, self)._log(type, [self.HOSTER_NAME] + args) + return super(XFileSharingProFolder, 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/crypter/XFileSharingProFolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index 70e7365dd..b9b1b4f23 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), -- 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/crypter/XFileSharingProFolder.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index b9b1b4f23..a7af1f0b0 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -33,7 +33,7 @@ class XFileSharingProFolder(XFSCrypter): 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: @@ -42,9 +42,9 @@ class XFileSharingProFolder(XFSCrypter): 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) getInfo = create_getInfo(XFileSharingProFolder) -- 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/crypter/XFileSharingProFolder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index a7af1f0b0..a68ebd77e 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -26,12 +26,12 @@ class XFileSharingProFolder(XFSCrypter): def init(self): super(XFileSharingProFolder, self).init() - self.__pattern__ = self.core.pluginManager.crypterPlugins[self.__name__]['pattern'] + self.__pattern__ = self.pyload.pluginManager.crypterPlugins[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/crypter/XFileSharingProFolder.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index a68ebd77e..a831b7e95 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -9,6 +9,7 @@ class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" __version__ = "0.09" + __status__ = "stable" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), -- 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/crypter/XFileSharingProFolder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index a831b7e95..12335515e 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -9,7 +9,7 @@ class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" __version__ = "0.09" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), @@ -20,8 +20,8 @@ class XFileSharingProFolder(XFSCrypter): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - def _log(self, type, args): - return super(XFileSharingProFolder, self)._log(type, (self.HOSTER_NAME,) + args) + def _log(self, level, args): + return super(XFileSharingProFolder, self)._log(level, (self.HOSTER_NAME,) + args) def init(self): -- 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/crypter/XFileSharingProFolder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index 12335515e..c81123b7e 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -43,8 +43,8 @@ class XFileSharingProFolder(XFSCrypter): 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/crypter/XFileSharingProFolder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index c81123b7e..834843c71 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.09" + __version__ = "0.10" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+' @@ -20,8 +20,8 @@ class XFileSharingProFolder(XFSCrypter): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - def _log(self, level, args): - return super(XFileSharingProFolder, self)._log(level, (self.HOSTER_NAME,) + args) + def _log(self, level, plugintype, pluginname, messages): + return super(XFileSharingProFolder, 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/crypter/XFileSharingProFolder.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index 834843c71..1340faf35 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.10" + __version__ = "0.11" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+' @@ -21,7 +21,10 @@ class XFileSharingProFolder(XFSCrypter): def _log(self, level, plugintype, pluginname, messages): - return super(XFileSharingProFolder, self)._log(level, plugintype, pluginname, (self.HOSTER_NAME,) + messages) + return super(XFileSharingProFolder, 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/crypter/XFileSharingProFolder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index 1340faf35..a0931d6ba 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.11" + __version__ = "0.12" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+' @@ -33,7 +33,7 @@ class XFileSharingProFolder(XFSCrypter): self.__pattern__ = self.pyload.pluginManager.crypterPlugins[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/crypter/XFileSharingProFolder.py | 43 ++++++++++++++++++------- 1 file changed, 32 insertions(+), 11 deletions(-) (limited to 'module/plugins/crypter/XFileSharingProFolder.py') diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py index a0931d6ba..584cc7668 100644 --- a/module/plugins/crypter/XFileSharingProFolder.py +++ b/module/plugins/crypter/XFileSharingProFolder.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo class XFileSharingProFolder(XFSCrypter): __name__ = "XFileSharingProFolder" __type__ = "crypter" - __version__ = "0.12" + __version__ = "0.13" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+' @@ -35,20 +35,41 @@ class XFileSharingProFolder(XFSCrypter): 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__) + + 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] - self.user, data = self.account.select() - self.req = self.account.get_request(self.user) - self.premium = self.account.is_premium(self.user) + if not self.user or not self.account.is_logged(self.user, True): + self.account = False getInfo = create_getInfo(XFileSharingProFolder) -- cgit v1.2.3