summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/FilesonicCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/FilesonicCom.py')
-rw-r--r--module/plugins/hoster/FilesonicCom.py17
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"