diff options
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/captcha/LinksaveIn.py | 6 | ||||
-rw-r--r-- | module/plugins/captcha/captcha.py | 10 | ||||
-rw-r--r-- | module/plugins/hooks/CaptchaBrotherhood.py | 6 |
3 files changed, 15 insertions, 7 deletions
diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py index d915b7628..069c8090d 100644 --- a/module/plugins/captcha/LinksaveIn.py +++ b/module/plugins/captcha/LinksaveIn.py @@ -1,6 +1,10 @@ # -*- coding: utf-8 -*- -from PIL import Image +try: + from PIL import Image +except ImportError: + import Image + from glob import glob from os import sep from os.path import abspath, dirname diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index cc07f50cf..7d6ff264f 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -2,11 +2,11 @@ from __future__ import with_statement -import GifImagePlugin -import Image -import JpegImagePlugin -import PngImagePlugin -import TiffImagePlugin +try: + from PIL import Image, GifImagePlugin, JpegImagePlugin, PngImagePlugin, TiffImagePlugin +except ImportError: + import Image, GifImagePlugin, JpegImagePlugin, PngImagePlugin, TiffImagePlugin + import logging import os import subprocess diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index e4d24c366..217f0b89f 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -5,7 +5,11 @@ from __future__ import with_statement import StringIO import pycurl -from PIL import Image +try: + from PIL import Image +except ImportError: + import Image + from thread import start_new_thread from time import sleep from urllib import urlencode |