diff options
author | OndrejIT <git@ondrej.it> | 2016-05-02 20:32:18 +0200 |
---|---|---|
committer | OndrejIT <git@ondrej.it> | 2016-05-02 20:32:18 +0200 |
commit | acdaab15e769dfb75a85a1d802d4810db473fd87 (patch) | |
tree | 95338eaca96c20419f217a9fccb302255ea277af /module | |
parent | Fix WebshareCz (diff) | |
download | pyload-acdaab15e769dfb75a85a1d802d4810db473fd87.tar.xz |
Improved error...
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hoster/WebshareCz.py | 14 |
1 files changed, 8 insertions, 6 deletions
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'<status>OK', api): + if re.search(r'<status>OK', api_data): + info['status'] = 2 + info['name'] = re.search(r'<name>(.+?)<', api_data).group(1) + info['size'] = re.search(r'<size>(.+?)<', api_data).group(1) + elif re.search(r'<status>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'<name>(.+?)<', api).group(1) - info['size'] = re.search(r'<size>(.+?)<', api).group(1) return info |