From 4cf4db16ea8f2e58c46a701409df55f8bfe7b33c Mon Sep 17 00:00:00 2001 From: OndrejIT Date: Mon, 2 May 2016 13:46:16 +0200 Subject: Fix WebshareCz --- module/plugins/hoster/WebshareCz.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index b9c1274f5..4f083b24f 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -9,10 +9,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class WebshareCz(SimpleHoster): __name__ = "WebshareCz" __type__ = "hoster" - __version__ = "0.23" + __version__ = "0.24" __status__ = "testing" - __pattern__ = r'https?://(?:www\.)?(en\.)?webshare\.cz/(?:#/)?file/(?P\w+)' + __pattern__ = r'https?://(?:www\.)?(en\.)?webshare\.cz/(?:#/)?(file/)?(?P\w+)' __config__ = [("activated" , "bool", "Activated" , True), ("use_premium" , "bool", "Use premium account if available" , True), ("fallback" , "bool", "Fallback to free download if premium fails" , True), @@ -21,8 +21,9 @@ class WebshareCz(SimpleHoster): __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"), + ("ondrej" , "git@ondrej.it" ),] @classmethod @@ -33,7 +34,8 @@ class WebshareCz(SimpleHoster): 'wst' : ""}) if not re.search(r'OK', api): - info['status'] = 1 + info['status'] = 8 + info['error'] = _("Could not find required xml data") else: info['status'] = 2 info['name'] = re.search(r'(.+?)<', api).group(1) -- cgit v1.2.3 From acdaab15e769dfb75a85a1d802d4810db473fd87 Mon Sep 17 00:00:00 2001 From: OndrejIT Date: Mon, 2 May 2016 20:32:18 +0200 Subject: Improved error... --- module/plugins/hoster/WebshareCz.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index 4f083b24f..33f2ec7d6 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -29,17 +29,19 @@ class WebshareCz(SimpleHoster): @classmethod def api_info(cls, url): info = {} - api = get_url("https://webshare.cz/api/file_info/", + api_data = get_url("https://webshare.cz/api/file_info/", post={'ident': re.match(cls.__pattern__, url).group('ID'), 'wst' : ""}) - if not re.search(r'OK', api): + if re.search(r'OK', api_data): + info['status'] = 2 + info['name'] = re.search(r'(.+?)<', api_data).group(1) + info['size'] = re.search(r'(.+?)<', api_data).group(1) + elif re.search(r'FATAL', api_data): + info['status'] = 1 + else: info['status'] = 8 info['error'] = _("Could not find required xml data") - else: - info['status'] = 2 - info['name'] = re.search(r'(.+?)<', api).group(1) - info['size'] = re.search(r'(.+?)<', api).group(1) return info -- cgit v1.2.3 From 3da85ed4672334a5b15e0a5ef79792df85845a19 Mon Sep 17 00:00:00 2001 From: OndrejIT Date: Mon, 2 May 2016 20:50:32 +0200 Subject: Add one space... --- module/plugins/hoster/WebshareCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index 33f2ec7d6..5e013c892 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -41,7 +41,7 @@ class WebshareCz(SimpleHoster): info['status'] = 1 else: info['status'] = 8 - info['error'] = _("Could not find required xml data") + info['error'] = _("Could not find required xml data") return info -- cgit v1.2.3