summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-08-12 17:26:38 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-08-12 17:26:38 +0200
commitf5c3720a5cdfc93734733b4ac8aba79289197f8f (patch)
treefb39d1bdfec4999da9bc0b46dc731328d6fc54e8
parentpycurl interface, need some testing (diff)
downloadpyload-f5c3720a5cdfc93734733b4ac8aba79289197f8f.tar.xz
time-, plugin fix, debug output
-rw-r--r--Plugins/NetloadIn.py4
-rw-r--r--captcha/NetloadIn.py2
-rw-r--r--captcha/captcha.py7
-rw-r--r--pyLoadCore.py2
4 files changed, 9 insertions, 6 deletions
diff --git a/Plugins/NetloadIn.py b/Plugins/NetloadIn.py
index ac14a670c..9509796f4 100644
--- a/Plugins/NetloadIn.py
+++ b/Plugins/NetloadIn.py
@@ -109,10 +109,10 @@ class NetloadIn(Plugin):
self.want_reconnect = True
def get_file_name(self):
- if not self.want_reconnect:
+ try:
file_name_pattern = '\t\t\t(.+)<span style="color: #8d8d8d;">'
return re.search(file_name_pattern, self.html[0]).group(1)
- else:
+ except:
return self.parent.url
def file_exists(self):
diff --git a/captcha/NetloadIn.py b/captcha/NetloadIn.py
index df8809a6a..9799a6a2b 100644
--- a/captcha/NetloadIn.py
+++ b/captcha/NetloadIn.py
@@ -9,9 +9,7 @@ class NetloadIn(OCR):
self.to_greyscale()
self.clean(3)
self.clean(3)
- self.logger.debug("Start tesseract")
self.run_tesser()
- self.logger.debug("Finished tesseract")
self.correct({
("$", "g"): "5",
diff --git a/captcha/captcha.py b/captcha/captcha.py
index a21963c6b..ffb165dbf 100644
--- a/captcha/captcha.py
+++ b/captcha/captcha.py
@@ -82,12 +82,15 @@ class OCR(object):
self.result_captcha = self.run(['gocr', tmp.name]).replace("\n", "")
def run_tesser(self):
+ self.logger.debug("create tmp tif")
tmp = tempfile.NamedTemporaryFile(suffix=".tif")
+ self.logger.debug("create tmp txt")
tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt")
-
+ self.logger.debug("save tiff")
self.image.save(tmp.name, 'TIFF')
+ self.logger.debug("run tesseract")
self.run(['tesseract', tmp.name, tmpTxt.name.replace(".txt", "")])
-
+ self.logger.debug("run cat")
self.result_captcha = self.run(['cat', tmpTxt.name]).replace("\n", "")
def get_captcha(self):
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 8587aea5d..9577def74 100644
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -197,6 +197,8 @@ class Core(object):
if start < now and end > now:
return True
+ elif start > end and (now > start or now < end):
+ return True
elif start < now and end < now and start > end:
return True
else: