diff options
author | Stefano <l.stickell@yahoo.it> | 2013-07-08 20:54:40 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-07-08 20:54:40 +0200 |
commit | d9cce8bf855160515e9a05504a7f0fe7f53fc71b (patch) | |
tree | cd60454b0e5e72aadccba87b20bfa31b0de6b0ce /module/plugins/hoster/CloudzerNet.py | |
parent | EasybytezCom: version increased after 01af811fe357442d7ae734f5b1c56ffb95e81c71 (diff) | |
download | pyload-d9cce8bf855160515e9a05504a7f0fe7f53fc71b.tar.xz |
CloudzerNet: now uses API data. Fixed #185
Diffstat (limited to 'module/plugins/hoster/CloudzerNet.py')
-rw-r--r-- | module/plugins/hoster/CloudzerNet.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/module/plugins/hoster/CloudzerNet.py b/module/plugins/hoster/CloudzerNet.py index 7608b193d..2701752ce 100644 --- a/module/plugins/hoster/CloudzerNet.py +++ b/module/plugins/hoster/CloudzerNet.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- import re -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.plugins.internal.SimpleHoster import SimpleHoster from module.common.json_layer import json_loads from module.plugins.ReCaptcha import ReCaptcha from module.network.RequestFactory import getURL +from module.utils import parseFileSize def getInfo(urls): @@ -12,7 +13,13 @@ def getInfo(urls): if 'Location: http://cloudzer.net/404' in header: file_info = (url, 0, 1, url) else: - file_info = parseFileInfo(CloudzerNet, url, getURL(url, decode=True)) + if url.endswith('/'): + api_data = getURL(url + 'status') + else: + api_data = getURL(url + '/status') + name, size = api_data.splitlines() + size = parseFileSize(size) + file_info = (name, size, 2, url) yield file_info @@ -20,10 +27,10 @@ class CloudzerNet(SimpleHoster): __name__ = "CloudzerNet" __type__ = "hoster" __pattern__ = r"http://(www\.)?(cloudzer\.net/file/|clz\.to/(file/)?)(?P<ID>\w+).*" - __version__ = "0.02" + __version__ = "0.03" __description__ = """Cloudzer.net hoster plugin""" - __author_name__ = ("gs", "z00nx") - __author_mail__ = ("I-_-I-_-I@web.de", "z00nx0@gmail.com") + __author_name__ = ("gs", "z00nx", "stickell") + __author_mail__ = ("I-_-I-_-I@web.de", "z00nx0@gmail.com", "l.stickell@yahoo.it") FILE_SIZE_PATTERN = '<span class="size">(?P<S>[^<]+)</span>' WAIT_PATTERN = '<meta name="wait" content="(\d+)">' |