summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-21 14:36:22 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-09-21 14:36:22 +0200
commitf9fc367427e30b7a3ca2ccad6144cb76b21f0257 (patch)
treed35656dd6253edcfdd4d19efe1756c0fddacaf27 /module/plugins/internal
parentFix pyfile.name processing (diff)
downloadpyload-f9fc367427e30b7a3ca2ccad6144cb76b21f0257.tar.xz
Spare code cosmetics
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/Hoster.py2
-rw-r--r--module/plugins/internal/OCR.py2
-rw-r--r--module/plugins/internal/Plugin.py1
-rw-r--r--module/plugins/internal/SimpleCrypter.py1
-rw-r--r--module/plugins/internal/SimpleHoster.py10
5 files changed, 13 insertions, 3 deletions
diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py
index 8457420c1..6ac1e95f6 100644
--- a/module/plugins/internal/Hoster.py
+++ b/module/plugins/internal/Hoster.py
@@ -416,6 +416,7 @@ class Hoster(Plugin):
if not exists(download_location):
try:
os.makedirs(download_location)
+
except Exception, e:
self.fail(e)
@@ -632,6 +633,7 @@ class Hoster(Plugin):
else:
try:
self.log_error(_("Too many redirects"))
+
except Exception:
pass
diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py
index b24b3058b..5913e604d 100644
--- a/module/plugins/internal/OCR.py
+++ b/module/plugins/internal/OCR.py
@@ -128,6 +128,7 @@ class OCR(Plugin):
try:
with open(tmpTxt.name, 'r') as f:
self.result_captcha = f.read().replace("\n", "")
+
except Exception:
self.result_captcha = ""
@@ -194,6 +195,7 @@ class OCR(Plugin):
count += 1
if pixels[x, y - 1] != 255:
count += 1
+
except Exception:
pass
diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py
index 9494d34a6..bbccaa48d 100644
--- a/module/plugins/internal/Plugin.py
+++ b/module/plugins/internal/Plugin.py
@@ -410,6 +410,7 @@ class Plugin(object):
"""
try:
self.req.close()
+
except Exception:
pass
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
index 3771956bc..d5a5ce2d7 100644
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -136,6 +136,7 @@ class SimpleCrypter(Crypter, SimpleHoster):
def handle_pages(self, pyfile):
try:
pages = int(re.search(self.PAGES_PATTERN, self.html).group(1))
+
except Exception:
pages = 1
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 7c47d3620..2a83389b6 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -323,6 +323,7 @@ class SimpleHoster(Hoster):
try:
errmsg += " | " + self.last_check.group(1).strip()
+
except Exception:
pass
@@ -359,7 +360,8 @@ class SimpleHoster(Hoster):
m = re.search(self.DL_LIMIT_PATTERN, self.html)
try:
errmsg = m.group(1).strip()
- except Exception:
+
+ except AttributeError:
errmsg = m.group(0).strip()
self.info['error'] = re.sub(r'<.*?>', " ", errmsg)
@@ -382,7 +384,8 @@ class SimpleHoster(Hoster):
if m:
try:
errmsg = m.group(1).strip()
- except Exception:
+
+ except AttributeError:
errmsg = m.group(0).strip()
self.info['error'] = re.sub(r'<.*?>', " ", errmsg)
@@ -432,7 +435,8 @@ class SimpleHoster(Hoster):
if m:
try:
waitmsg = m.group(1).strip()
- except Exception:
+
+ except AttributeError:
waitmsg = m.group(0).strip()
wait_time = sum(int(v) * {'hr': 3600, 'hour': 3600, 'min': 60, 'sec': 1, "": 1}[u.lower()] for v, u in