diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-03 15:47:30 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-03 15:47:30 +0200 |
commit | e86be5d91ddc9836a9e641ff07a439bb33bbc801 (patch) | |
tree | 1ae3c56c526cc0e0779fdd9a14d0c2b916ca39f9 | |
parent | little fixes (diff) | |
download | pyload-e86be5d91ddc9836a9e641ff07a439bb33bbc801.tar.xz |
netload prefetching fix
-rw-r--r-- | module/plugins/Plugin.py | 2 | ||||
-rw-r--r-- | module/plugins/hoster/NetloadIn.py | 4 | ||||
-rwxr-xr-x | pyLoadCore.py | 15 |
3 files changed, 14 insertions, 7 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 7790a0801..9995da59a 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -208,7 +208,7 @@ class Plugin(object): Ocr = self.core.pluginManager.getCaptchaPlugin(self.__name__) - if Ocr and not forceUser: + if Ocr and not forceUser and self.core.captcha: sleep(randint(3000, 5000) / 1000.0) if self.pyfile.abort: raise Abort diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 9735a430d..07b072a4d 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -18,7 +18,7 @@ def getInfo(urls): apiurl = "http://api.netload.in/info.php?auth=Zf9SnQh9WiReEsb18akjvQGqT0I830e8&bz=1&md5=1&file_id=" id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") urls_per_query = 80 - + for chunk in chunks(urls, urls_per_query): ids = "" for url in chunk: @@ -37,7 +37,7 @@ def getInfo(urls): result = [] - for i, r in enumerate(api.split()): + for i, r in enumerate(api.splitlines()): try: tmp = r.split(";") try: diff --git a/pyLoadCore.py b/pyLoadCore.py index 359064ba2..5d28c534e 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -200,11 +200,13 @@ class Core(object): #@TODO refractor self.check_install("Crypto", _("pycrypto to decode container files")) - self.check_install("Image", _("Python Image Libary (PIL) for captcha reading")) + img = self.check_install("Image", _("Python Image Libary (PIL) for captcha reading")) self.check_install("pycurl", _("pycurl to download any files"), True, True) self.check_install("django", _("Django for webinterface")) self.check_file("tmp", _("folder for temporary files"), True) - #self.check_install("tesseract", _("tesseract for captcha reading"), False) + #tesser = self.check_install("tesseract", _("tesseract for captcha reading"), False) + + self.captcha = img self.check_file(self.config['general']['download_folder'], _("folder for downloads"), True) self.check_file("links.txt", _("file for links")) @@ -343,9 +345,14 @@ class Core(object): else: pipe = subprocess.PIPE subprocess.Popen(check_name, stdout=pipe, stderr=pipe) + + return True except: - self.log.info(_("Install %s") % legend) - if essential: exit() + if essential: + self.log.info(_("Install %s") % legend) + exit() + + return False def check_file(self, check_names, description="", folder=False, empty=True, essential=False, quiet=False): """check wether needed files exists""" |