From 3b0f78439f70ede5dd0c24af39d7eb1b79b1446c Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 22 Feb 2011 20:38:45 +0100 Subject: filesonic info prefetching + premium fix --- module/plugins/hoster/FilesonicCom.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilesonicCom.py') diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py index 5bd38655a..1d5a5ceef 100644 --- a/module/plugins/hoster/FilesonicCom.py +++ b/module/plugins/hoster/FilesonicCom.py @@ -5,7 +5,22 @@ import re from module.plugins.Hoster import Hoster from module.plugins.ReCaptcha import ReCaptcha - +from module.plugins.Plugin import chunks + +from module.network.RequestFactory import getURL + +def getInfo(urls): + for chunk in chunks(urls, 15): + page = getURL("http://www.filesonic.com/link-checker", post={"links": "\n".join(chunk)}).decode("utf8", "ignore") + + found = re.findall(r'\s+([^<]+)\s+([^<]+)\s+([0-9]+) MB\s+\s+([^<]+)
\s+
\s+\s+', page, re.MULTILINE) + result = [] + for src, name, size, status in found: + print src, name, size, status + result.append((name, int(size)*1024*1024, 2 if status == "Available" else 1, src)) + + + yield result class FilesonicCom(Hoster): __name__ = "FilesonicCom" -- cgit v1.2.3