From 72abfb455275546e110e4daf811480dd47ffceea Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 12 Aug 2010 22:44:41 +0200 Subject: improvements --- module/plugins/hoster/ShareCx.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'module/plugins/hoster/ShareCx.py') diff --git a/module/plugins/hoster/ShareCx.py b/module/plugins/hoster/ShareCx.py index feee30cd3..e64459754 100644 --- a/module/plugins/hoster/ShareCx.py +++ b/module/plugins/hoster/ShareCx.py @@ -3,8 +3,35 @@ import re from module.plugins.Hoster import Hoster +from module.plugins.Plugin import chunks +from module.network.Request import getURL #from module.BeautifulSoup import BeautifulSoup +def getInfo(urls): + api_url = "http://www.share.cx/uapi?do=check&links=" + + for chunk in chunks(urls, 90): + get = "" + for url in chunk: + get += ";"+url + + api = getURL(api_url+get[1:]) + result = [] + + for i, link in enumerate(api.split()): + url,name,size = link.split(";") + if name and size: + status = 2 + else: + status = 1 + + if not name: name = chunk[i] + if not size: size = 0 + + result.append( (name, size, status, chunk[i]) ) + + yield result + class ShareCx(Hoster): __name__ = "ShareCx" __type__ = "hoster" -- cgit v1.2.3