diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-11-04 17:48:45 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-11-04 17:48:45 +0100 |
commit | 108a7a3a554806394b7fe055f4a9f40f47c230ef (patch) | |
tree | 19acf37dfbb1f8be0ae3c281a73a4bf0e1f1b604 /module/plugins/hoster | |
parent | share-online, try fix (diff) | |
download | pyload-108a7a3a554806394b7fe055f4a9f40f47c230ef.tar.xz |
files.mail.ru improvement
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/FilesMailRu.py | 44 |
1 files changed, 23 insertions, 21 deletions
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'<div class="errorMessage mb10">' 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 = '<a href="(.+?)" onclick="return Act\(this\, \'dlink\'\, event\)">(.+?)</a>' - file_name = re.search(url_pattern, src).group(0).split(', event)">')[1].split('</a>')[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'<div class="errorMessage mb10">' 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 = '<a href="(.+?)" onclick="return Act\(this\, \'dlink\'\, event\)">(.+?)</a>' + file_name = re.search(url_pattern, src).group(0).split(', event)">')[1].split('</a>')[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": "<meta name="}, max_size=110000000) - if check == "empty": + # (Loading 100MB in to ram is not an option) + check = self.checkDownload({"html": "<meta name="}, read_size=50000) + if check == "html": self.log.info(_("There was HTML Code in the Downloaded File("+ filename +")...redirect error? The Download will be restarted.")) self.retry() |