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