summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-08-25 16:39:54 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-08-25 16:39:54 +0200
commit9e1a4572a58a52d75c52de5fe04045981fcea88e (patch)
tree46eba3f59ebe0e2c5051d58876eadaf94387fa66 /module/plugins
parentmore cleanup (diff)
downloadpyload-9e1a4572a58a52d75c52de5fe04045981fcea88e.tar.xz
ul.to fetching, so.biz expire
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/accounts/ShareonlineBiz.py13
-rw-r--r--module/plugins/hoster/UploadedTo.py12
2 files changed, 22 insertions, 3 deletions
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py
index 3d213557a..611fa759d 100644
--- a/module/plugins/accounts/ShareonlineBiz.py
+++ b/module/plugins/accounts/ShareonlineBiz.py
@@ -18,19 +18,26 @@
"""
from module.plugins.Account import Account
+from time import strptime, mktime
+import re
class ShareonlineBiz(Account):
__name__ = "ShareonlineBiz"
- __version__ = "0.1"
+ __version__ = "0.2"
__type__ = "account"
__description__ = """share-online.biz account plugin"""
__author_name__ = ("mkaay")
__author_mail__ = ("mkaay@mkaay.de")
- #@TODO: account info
def getAccountInfo(self, user):
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ src = req.load("https://www.share-online.biz/alpha/user/profile")
+
+ validuntil = re.search(r"Account gültig bis:.*?<span class='.*?'>(.*?)</span>", src).group(1)
+ validuntil = int(mktime(strptime(validuntil, "%m/%d/%Y, %I:%M:%S %p")))
+
out = Account.getAccountInfo(self, user)
- tmp = {"validuntil":None, "trafficleft":-1}
+ tmp = {"validuntil":validuntil, "trafficleft":-1}
out.update(tmp)
return out
diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index 2226f2943..b6bd872f1 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -3,8 +3,20 @@
import re
from time import time
from module.plugins.Hoster import Hoster
+from module.network.Request import getURL
import hashlib
+def getInfo(urls):
+ for url in urls:
+ match = re.compile(UploadedTo.__pattern__).search(url)
+ if match:
+ src = getURL("http://uploaded.to/api/file", get={"id": match.group(1).split("/")[0]})
+ if src.find("404 Not Found") >= 0:
+ result.append((url, 0, 1, url))
+ continue
+ lines = src.splitlines()
+ result.append((lines[0], int(lines[1]), 2, url))
+
class UploadedTo(Hoster):
__name__ = "UploadedTo"
__type__ = "hoster"