From 108a7a3a554806394b7fe055f4a9f40f47c230ef Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 4 Nov 2010 17:48:45 +0100 Subject: files.mail.ru improvement --- module/plugins/hoster/FilesMailRu.py | 44 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'module/plugins/hoster/FilesMailRu.py') diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py index cb180a858..ce939587d 100644 --- a/module/plugins/hoster/FilesMailRu.py +++ b/module/plugins/hoster/FilesMailRu.py @@ -4,28 +4,29 @@ import re from module.plugins.Hoster import Hoster from module.network.Request import getURL - +from module.plugins.Plugin import chunks def getInfo(urls): result = [] - for url in urls: - src = getURL(url) - if r'
' in src: - result.append(url, 0, 1, url) - elif r'Page cannot be displayed' in src: - result.append(url, 0, 1, url) - else: - try: - url_pattern = '(.+?)' - file_name = re.search(url_pattern, src).group(0).split(', event)">')[1].split('')[0] - result.append(file_name, 0, 2, url) - except: - result.append(url, 0, 1, url) - - - # status 1=OFFLINE, 2=OK, 3=UNKNOWN - # result.append(#name,#size,#status,#url) - yield result + for chunk in chunks(urls, 10): + for url in chunk: + src = getURL(url) + if r'
' in src: + result.append((url, 0, 1, url)) + elif r'Page cannot be displayed' in src: + result.append((url, 0, 1, url)) + else: + try: + url_pattern = '(.+?)' + file_name = re.search(url_pattern, src).group(0).split(', event)">')[1].split('')[0] + result.append((file_name, 0, 2, url)) + except: + pass + + + # status 1=OFFLINE, 2=OK, 3=UNKNOWN + # result.append((#name,#size,#status,#url)) + yield result class FilesMailRu(Hoster): __name__ = "FilesMailRu" @@ -84,7 +85,8 @@ class FilesMailRu(Hoster): # The maximum UploadSize allowed on files.mail.ru at the moment is 100MB # so i set it to check every download because sometimes there are downloads # that contain the HTML-Text and 60MB ZEROs after that in a xyzfile.part1.rar file - check = self.checkDownload({"empty": "