From f8ee62fa313beddc7af46dc1c361adb8577d0fa4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 2 Jun 2015 03:26:41 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1446 --- module/plugins/hoster/WebshareCz.py | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'module/plugins/hoster/WebshareCz.py') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index ae670c8d4..b56d06a5b 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -9,42 +9,41 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class WebshareCz(SimpleHoster): __name__ = "WebshareCz" __type__ = "hoster" - __version__ = "0.16" + __version__ = "0.17" - __pattern__ = r'https?://(?:www\.)?webshare\.cz/(?:#/)?file/(?P\w+)' + __pattern__ = r'https?://(?:www\.)?(en\.)?webshare\.cz/(?:#/)?file/(?P\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """WebShare.cz hoster plugin""" __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it"), - ("rush", "radek.senfeld@gmail.com")] + __authors__ = [("stickell", "l.stickell@yahoo.it "), + ("rush" , "radek.senfeld@gmail.com")] @classmethod - def getInfo(cls, url="", html=""): - info = super(WebshareCz, cls).getInfo(url, html) + def apiInfo(cls, url): + info = super(WebshareCz, cls).apiInfo(url) - if url: - info['pattern'] = re.match(cls.__pattern__, url).groupdict() + info['pattern'] = re.match(cls.__pattern__, url).groupdict() - api_data = getURL("https://webshare.cz/api/file_info/", - post={'ident': info['pattern']['ID']}, - decode=True) + api_data = getURL("https://webshare.cz/api/file_info/", + post={'ident': info['pattern']['ID'], 'wst': ""}, + decode=True) - if 'File not found' in api_data: - info['status'] = 1 - else: - info["status"] = 2 - info['name'] = re.search('(.+)', api_data).group(1) or info['name'] - info['size'] = re.search('(.+)', api_data).group(1) or info['size'] + if not re.search(r'OK'): + info['status'] = 1 + else: + info['status'] = 2 + info['name'] = re.search(r'(.+?)<', api_data).group(1) + info['size'] = re.search(r'(.+?)<', api_data).group(1) return info def handleFree(self, pyfile): - wst = self.account.infos['wst'] if self.account and 'wst' in self.account.infos else "" + wst = self.account.getAccountData(self.user).get('wst', None) if self.account else None - api_data = getURL('https://webshare.cz/api/file_link/', + api_data = getURL("https://webshare.cz/api/file_link/", post={'ident': self.info['pattern']['ID'], 'wst': wst}, decode=True) -- cgit v1.2.3 From 89066413aa1ba9be46b2bc1ac1ea97c6c235e74b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 2 Jun 2015 22:35:17 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1446 (2) --- module/plugins/hoster/WebshareCz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/WebshareCz.py') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index b56d06a5b..c898d23ab 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class WebshareCz(SimpleHoster): __name__ = "WebshareCz" __type__ = "hoster" - __version__ = "0.17" + __version__ = "0.18" __pattern__ = r'https?://(?:www\.)?(en\.)?webshare\.cz/(?:#/)?file/(?P\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -30,7 +30,7 @@ class WebshareCz(SimpleHoster): post={'ident': info['pattern']['ID'], 'wst': ""}, decode=True) - if not re.search(r'OK'): + if not re.search(r'OK', api_data): info['status'] = 1 else: info['status'] = 2 -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/hoster/WebshareCz.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/WebshareCz.py') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index c898d23ab..6aac44df6 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -27,8 +27,7 @@ class WebshareCz(SimpleHoster): info['pattern'] = re.match(cls.__pattern__, url).groupdict() api_data = getURL("https://webshare.cz/api/file_info/", - post={'ident': info['pattern']['ID'], 'wst': ""}, - decode=True) + post={'ident': info['pattern']['ID'], 'wst': ""}) if not re.search(r'OK', api_data): info['status'] = 1 @@ -44,8 +43,7 @@ class WebshareCz(SimpleHoster): wst = self.account.getAccountData(self.user).get('wst', None) if self.account else None api_data = getURL("https://webshare.cz/api/file_link/", - post={'ident': self.info['pattern']['ID'], 'wst': wst}, - decode=True) + post={'ident': self.info['pattern']['ID'], 'wst': wst}) self.logDebug("API data: " + api_data) -- 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/WebshareCz.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/WebshareCz.py') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index 6aac44df6..2afe7421a 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class WebshareCz(SimpleHoster): __name__ = "WebshareCz" __type__ = "hoster" - __version__ = "0.18" + __version__ = "0.19" __pattern__ = r'https?://(?:www\.)?(en\.)?webshare\.cz/(?:#/)?file/(?P\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -21,8 +21,8 @@ class WebshareCz(SimpleHoster): @classmethod - def apiInfo(cls, url): - info = super(WebshareCz, cls).apiInfo(url) + def api_info(cls, url): + info = super(WebshareCz, cls).api_info(url) info['pattern'] = re.match(cls.__pattern__, url).groupdict() @@ -39,21 +39,21 @@ class WebshareCz(SimpleHoster): return info - def handleFree(self, pyfile): + def handle_free(self, pyfile): wst = self.account.getAccountData(self.user).get('wst', None) if self.account else None api_data = getURL("https://webshare.cz/api/file_link/", post={'ident': self.info['pattern']['ID'], 'wst': wst}) - self.logDebug("API data: " + api_data) + self.log_debug("API data: " + api_data) m = re.search('(.+)', api_data) if m: self.link = m.group(1) - def handlePremium(self, pyfile): - return self.handleFree(pyfile) + def handle_premium(self, pyfile): + return self.handle_free(pyfile) getInfo = create_getInfo(WebshareCz) -- 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/WebshareCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/WebshareCz.py') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index 2afe7421a..b650e9219 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -40,7 +40,7 @@ class WebshareCz(SimpleHoster): def handle_free(self, pyfile): - wst = self.account.getAccountData(self.user).get('wst', None) if self.account else None + wst = self.account.get_account_data(self.user).get('wst', None) if self.account else None api_data = getURL("https://webshare.cz/api/file_link/", post={'ident': self.info['pattern']['ID'], 'wst': wst}) -- cgit v1.2.3 From 9e5d813d7721e351ac02ba72bdc473a7d77ba6b7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Jul 2015 20:04:36 +0200 Subject: Code cosmetics --- module/plugins/hoster/WebshareCz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/WebshareCz.py') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index b650e9219..feea234f3 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -2,7 +2,7 @@ import re -from module.network.RequestFactory import getURL +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -26,7 +26,7 @@ class WebshareCz(SimpleHoster): info['pattern'] = re.match(cls.__pattern__, url).groupdict() - api_data = getURL("https://webshare.cz/api/file_info/", + api_data = get_url("https://webshare.cz/api/file_info/", post={'ident': info['pattern']['ID'], 'wst': ""}) if not re.search(r'OK', api_data): @@ -42,7 +42,7 @@ class WebshareCz(SimpleHoster): def handle_free(self, pyfile): wst = self.account.get_account_data(self.user).get('wst', None) if self.account else None - api_data = getURL("https://webshare.cz/api/file_link/", + api_data = get_url("https://webshare.cz/api/file_link/", post={'ident': self.info['pattern']['ID'], 'wst': wst}) self.log_debug("API data: " + api_data) -- cgit v1.2.3 From 33e2b36605e41962a2e8eee304a7f3d29690ffa8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 13:42:29 +0200 Subject: [OCR] Fix __init__ (2) --- module/plugins/hoster/WebshareCz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/WebshareCz.py') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index feea234f3..f772fa496 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -27,7 +27,7 @@ class WebshareCz(SimpleHoster): info['pattern'] = re.match(cls.__pattern__, url).groupdict() api_data = get_url("https://webshare.cz/api/file_info/", - post={'ident': info['pattern']['ID'], 'wst': ""}) + post={'ident': info['pattern']['ID'], 'wst': ""}) if not re.search(r'OK', api_data): info['status'] = 1 @@ -43,7 +43,7 @@ class WebshareCz(SimpleHoster): wst = self.account.get_account_data(self.user).get('wst', None) if self.account else None api_data = get_url("https://webshare.cz/api/file_link/", - post={'ident': self.info['pattern']['ID'], 'wst': wst}) + post={'ident': self.info['pattern']['ID'], 'wst': wst}) self.log_debug("API data: " + api_data) -- 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/WebshareCz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/WebshareCz.py') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index f772fa496..facd040c8 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -10,6 +10,7 @@ class WebshareCz(SimpleHoster): __name__ = "WebshareCz" __type__ = "hoster" __version__ = "0.19" + __status__ = "stable" __pattern__ = r'https?://(?:www\.)?(en\.)?webshare\.cz/(?:#/)?file/(?P\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", 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/hoster/WebshareCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/WebshareCz.py') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index facd040c8..6ea038751 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -10,7 +10,7 @@ class WebshareCz(SimpleHoster): __name__ = "WebshareCz" __type__ = "hoster" __version__ = "0.19" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(en\.)?webshare\.cz/(?:#/)?file/(?P\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] -- 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/WebshareCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/WebshareCz.py') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index 6ea038751..0a89363f8 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -41,7 +41,7 @@ class WebshareCz(SimpleHoster): def handle_free(self, pyfile): - wst = self.account.get_account_data(self.user).get('wst', None) if self.account else None + wst = self.account.get_data(self.user).get('wst', None) if self.account else None api_data = get_url("https://webshare.cz/api/file_link/", post={'ident': self.info['pattern']['ID'], 'wst': wst}) -- cgit v1.2.3