diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-22 20:38:45 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-22 20:38:45 +0100 |
commit | 3b0f78439f70ede5dd0c24af39d7eb1b79b1446c (patch) | |
tree | a5946290c13a3e85fc4e1e67493fd0f26ba9fff9 /module/plugins/hoster/FilesonicCom.py | |
parent | NCryptIn: Bug fixes (diff) | |
download | pyload-3b0f78439f70ede5dd0c24af39d7eb1b79b1446c.tar.xz |
filesonic info prefetching + premium fix
Diffstat (limited to 'module/plugins/hoster/FilesonicCom.py')
-rw-r--r-- | module/plugins/hoster/FilesonicCom.py | 17 |
1 files changed, 16 insertions, 1 deletions
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'<tr>\s+<td class="source"><span>([^<]+)</span></td>\s+<td class="fileName"><span>([^<]+)</span></td>\s+<td class="fileSize"><span>([0-9]+) MB</span></td>\s+<td class="availability"><span>\s+<strong style="font-weight: strong; color: green;">([^<]+)</strong><br />\s+</span>\s+</td>\s+</tr>', 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"
|