summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-01 18:57:18 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-01 18:57:18 +0200
commit4ebe6b095e66caa5764e08486aeac46b32df0866 (patch)
treed4687f7ebcc203d039708264d5058a11908e2ed8 /module/plugins
parentocr + db fix (diff)
downloadpyload-4ebe6b095e66caa5764e08486aeac46b32df0866.tar.xz
wait fix
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Plugin.py4
-rw-r--r--module/plugins/captcha/captcha.py7
-rw-r--r--module/plugins/hoster/NetloadIn.py7
3 files changed, 10 insertions, 8 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index e3b1b3299..de29dfc4e 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -146,8 +146,9 @@ class Plugin(object):
def wait(self):
""" waits the time previously set """
self.waiting = True
+ self.pyfile.setStatus("waiting")
- while self.pyfile.waitUntil < time():
+ while self.pyfile.waitUntil > time():
self.thread.m.reconnecting.wait(2)
if self.pyfile.abort: raise Abort
@@ -156,6 +157,7 @@ class Plugin(object):
raise Reconnect
self.waiting = False
+ self.pyfile.setStatus("starting")
def fail(self, reason):
""" fail and give reason """
diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py
index 501a57737..8b3b4ccbc 100644
--- a/module/plugins/captcha/captcha.py
+++ b/module/plugins/captcha/captcha.py
@@ -83,9 +83,9 @@ class OCR(object):
self.result_captcha = self.run(['gocr', tmp.name]).replace("\n", "")
def run_tesser(self, subset=False, digits=True, lowercase=True, uppercase=True):
- self.logger.debug("create tmp tif")
+ #self.logger.debug("create tmp tif")
tmp = tempfile.NamedTemporaryFile(suffix=".tif")
- self.logger.debug("create tmp txt")
+ #self.logger.debug("create tmp txt")
tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt")
self.logger.debug("save tiff")
self.image.save(tmp.name, 'TIFF')
@@ -93,7 +93,7 @@ class OCR(object):
tessparams = ['tesseract', tmp.name, tmpTxt.name.replace(".txt", "")]
if subset and (digits or lowercase or uppercase):
- self.logger.debug("create temp subset config")
+ #self.logger.debug("create temp subset config")
tmpSub = tempfile.NamedTemporaryFile(suffix=".subset")
tmpSub.write("tessedit_char_whitelist ")
if digits:
@@ -114,6 +114,7 @@ class OCR(object):
with open(tmpTxt.name, 'r') as f:
self.result_captcha = f.read().replace("\n", "")
+ self.logger.debug(self.result_captcha)
def get_captcha(self):
raise NotImplementedError
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index 04b9f81f7..219d69944 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -42,11 +42,10 @@ class NetloadIn(Hoster):
self.download_html()
self.setWait(self.get_wait_time())
- #self.wait()
- self.log.info("Netload: waiting %d seconds" % self.get_wait_time())
- self.pyfile.setStatus("waiting")
- sleep(self.get_wait_time())
+ self.log.debug("Netload: waiting %d seconds" % self.get_wait_time())
+
+ self.wait()
self.url = self.get_file_url()
return True