diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-12 22:44:41 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-12 22:44:41 +0200 |
commit | 72abfb455275546e110e4daf811480dd47ffceea (patch) | |
tree | 4f6955a97af4600c31dffc5941a57640d81da0a3 /module/plugins/hoster/ShareonlineBiz.py | |
parent | encoding fix try (diff) | |
download | pyload-72abfb455275546e110e4daf811480dd47ffceea.tar.xz |
improvements
Diffstat (limited to 'module/plugins/hoster/ShareonlineBiz.py')
-rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 8646fcc88..42a2bc560 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -13,19 +13,30 @@ from time import sleep from module.plugins.Hoster import Hoster from module.network.Request import getURL +from module.plugins.Plugin import chunks + def getInfo(urls): api_url_base = "http://www.share-online.biz/linkcheck/linkcheck.php" - api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","") for x in urls)} #api only supports old style links - src = getURL(api_url_base, post=api_param_file) - result = [] - for i, res in enumerate(src.split("\n")): - if not res: - continue - fields = res.split(";") - status = 2 if fields[1] == "OK" else 3 - result.append((fields[2], int(fields[3]), status, urls[i])) - yield result + + for chunk in chunks(urls, 90): + api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","") for x in chunk)} #api only supports old style links + src = getURL(api_url_base, post=api_param_file) + result = [] + for i, res in enumerate(src.split("\n")): + if not res: + continue + fields = res.split(";") + + if fields[1] == "OK": + status = 2 + elif fields[1] in ("DELETED", "NOT FOUND"): + status = 1 + else: + status = 3 + + result.append((fields[2], int(fields[3]), status, chunk[i])) + yield result class ShareonlineBiz(Hoster): __name__ = "ShareonlineBiz" |