summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/ShareCx.py
diff options
context:
space:
mode:
authorGravatar Jeix <devnull@localhost> 2010-08-13 11:03:44 +0200
committerGravatar Jeix <devnull@localhost> 2010-08-13 11:03:44 +0200
commitb1cc10a0f5ea6c9cb8231c67dd016fe4a2414170 (patch)
treeaf31f7d3c6efb49a2afe905d4971001417299c03 /module/plugins/hoster/ShareCx.py
parentirchook-xmlrpc fix (diff)
parentimprovements (diff)
downloadpyload-b1cc10a0f5ea6c9cb8231c67dd016fe4a2414170.tar.xz
Merge
Diffstat (limited to 'module/plugins/hoster/ShareCx.py')
-rw-r--r--module/plugins/hoster/ShareCx.py27
1 files changed, 27 insertions, 0 deletions
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"