summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/WebshareCz.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/WebshareCz.py')
-rw-r--r--module/plugins/hoster/WebshareCz.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py
index eb91974d7..e4a6f53ff 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.20"
+ __version__ = "0.21"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(en\.)?webshare\.cz/(?:#/)?file/(?P<ID>\w+)'
@@ -24,19 +24,17 @@ class WebshareCz(SimpleHoster):
@classmethod
def api_info(cls, url):
- info = super(WebshareCz, cls).api_info(url)
+ info = {}
+ api = get_url("https://webshare.cz/api/file_info/",
+ post={'ident': re.match(cls.__pattern__, url).group('ID'),
+ 'wst' : ""})
- info['pattern'] = re.match(cls.__pattern__, url).groupdict()
-
- api_data = get_url("https://webshare.cz/api/file_info/",
- post={'ident': info['pattern']['ID'], 'wst': ""})
-
- if not re.search(r'<status>OK', api_data):
+ if not re.search(r'<status>OK', api):
info['status'] = 1
else:
info['status'] = 2
- info['name'] = re.search(r'<name>(.+?)<', api_data).group(1)
- info['size'] = re.search(r'<size>(.+?)<', api_data).group(1)
+ info['name'] = re.search(r'<name>(.+?)<', api).group(1)
+ info['size'] = re.search(r'<size>(.+?)<', api).group(1)
return info