diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-25 18:58:39 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-25 18:58:39 +0200 |
commit | c1bad948e840243f4e1af1226d490043d3e01d78 (patch) | |
tree | 8614063aaf89de0788dd820353385420e76be8df /module | |
parent | new dirs (diff) | |
download | pyload-c1bad948e840243f4e1af1226d490043d3e01d78.tar.xz |
new icon, fixes
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/accounts/ShareonlineBiz.py | 23 | ||||
-rw-r--r-- | module/plugins/hoster/UploadedTo.py | 23 |
2 files changed, 27 insertions, 19 deletions
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 611fa759d..15802c8e2 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -30,17 +30,20 @@ class ShareonlineBiz(Account): __author_mail__ = ("mkaay@mkaay.de") 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"))) + try: + 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":validuntil, "trafficleft":-1} + out.update(tmp) + return out + except: + return Account.getAccountInfo(self, user) - out = Account.getAccountInfo(self, user) - tmp = {"validuntil":validuntil, "trafficleft":-1} - out.update(tmp) - return out - def login(self, user, data): req = self.core.requestFactory.getRequest(self.__name__, user) post_vars = {"user": user, diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index b6bd872f1..2b7f4e7e9 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -4,18 +4,23 @@ import re from time import time from module.plugins.Hoster import Hoster from module.network.Request import getURL +from module.plugins.Plugin import chunks 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)) + pattern = re.compile(UploadedTo.__pattern__) + for chunk in chunks(urls, 10): + result = [] + for url in chunk: + match = 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)) + yield result class UploadedTo(Hoster): __name__ = "UploadedTo" |