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/plugins/hoster/UploadedTo.py | |
parent | new dirs (diff) | |
download | pyload-c1bad948e840243f4e1af1226d490043d3e01d78.tar.xz |
new icon, fixes
Diffstat (limited to 'module/plugins/hoster/UploadedTo.py')
-rw-r--r-- | module/plugins/hoster/UploadedTo.py | 23 |
1 files changed, 14 insertions, 9 deletions
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" |