ehForwarderBot / efb-telegram-master

EFB Telegram Master Channel, a channel for EH Forwarder Bot.
GNU Affero General Public License v3.0
223 stars 78 forks source link

[BUG] initialization fialed with Error '' #114

Closed kvneight closed 2 years ago

kvneight commented 2 years ago

Describe the bug
EFB initialize failed with exception "WebP support of Pillow is required" after upgrade. HERE is he log and version info:

2021-12-10 18:07:07,488 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:129)
     Initializing slave blueset.wechat...
2021-12-10 18:07:11,523 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:140)
     Slave channel WeChat Slave (blueset.wechat) # Default profile is initialized.
2021-12-10 18:07:11,523 [Level 99]: ehforwarderbot.__main__ (__main__.init; __main__.py:143)
     Initializing master blueset.telegram...
Traceback (most recent call last):
  File "/usr/local/bin/ehforwarderbot", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/ehforwarderbot/__main__.py", line 335, in main
    init(conf)
  File "/usr/local/lib/python3.6/dist-packages/ehforwarderbot/__main__.py", line 147, in init
    coordinator.add_channel(module(instance_id=instance_id))
  File "/usr/local/lib/python3.6/dist-packages/efb_telegram_master/__init__.py", line 103, in __init__
    raise EFBException(self._("WebP support of Pillow is required.\n"
ehforwarderbot.exceptions.EFBException: WebP support of Pillow is required.
Please refer to Pillow Documentation for instructions.
https://pillow.readthedocs.io/

# root @ wangpan in ~ [18:07:11] C:1
$ pip3 show ehforwarderbot
Name: ehforwarderbot
Version: 2.1.1
Summary: An extensible message tunneling chat bot framework.
Home-page: https://github.com/ehForwarderBot/ehForwarderBot
Author: Eana Hufwe
Author-email: ilove@1a23.com
License: AGPLv3+
Location: /usr/local/lib/python3.6/dist-packages
Requires: cjkwrap, ruamel.yaml, typing-extensions, bullet

# root @ wangpan in ~ [18:07:37]
$ pip3 show efb-telegram-matser

# root @ wangpan in ~ [18:07:49] C:1
$ pip3 show efb-telegram-master
Name: efb-telegram-master
Version: 2.2.4
Summary: Telegram Master Channel for EH Forwarder Bot, based on Telegram Bot API.
Home-page: https://etm.1a23.studio
Author: Eana Hufwe
Author-email: ilove@1a23.com
License: AGPLv3+
Location: /usr/local/lib/python3.6/dist-packages
Requires: peewee, pillow, ruamel.yaml, bullet, cjkwrap, retrying, requests, pydub, python-telegram-bot, python-magic, ehforwarderbot, language-tags, ffmpeg-python, humanize, typing-extensions

# root @ wangpan in ~ [18:07:58]
$ pip3 show Pillow
Name: Pillow
Version: 8.4.0
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.org
Author: Alex Clark (PIL Fork Author)
Author-email: aclark@python-pillow.org
License: HPND
Location: /usr/local/lib/python3.6/dist-packages
Requires:

# root @ wangpan in ~ [18:08:19]
$ pip3 show webp
Name: webp
Version: 0.1.3
Summary: Python bindings for WebP
Home-page: https://github.com/anibali/pywebp
Author: Aiden Nibali
Author-email: None
License: MIT
Location: /usr/local/lib/python3.6/dist-packages
Requires: numpy, cffi, Pillow

To Reproduce
Steps to reproduce the behavior: run ehforwarderbot

Expected behavior
start normally

Version information (please complete the following information):

EH Forwarder Bot
Version: 2.1.1
Python version:
3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0]
Running on profile "default".

Master channel:
    Telegram Master (blueset.telegram) 2.2.4 # Default instance

Slave channel:
    WeChat Slave (blueset.wechat) 2.0.5 # Default instance

Middlewares:
    No middleware is enabled.
kvneight commented 2 years ago

I just commented the following lines to escape the webp check.Efb started ,but not sure if it would have any side effect. Like 'cannot support webp photos'?

        #if 'WEBP' not in Image.ID or not getattr(WebPImagePlugin, "SUPPORTED", None):
        #    raise EFBException(self._("WebP support of Pillow is required.\n"
        #                              "Please refer to Pillow Documentation for instructions.\n"
        #                              "https://pillow.readthedocs.io/"))
blueset commented 2 years ago

WebP support of Pillow is used to convert Telegram stickers from WebP to PNG for other middlewares and slave channels to consume. If the support is not available, the bot may break when it receives a Telegram sticker.

Please consult the Pillow documentation to install WebP support, (most likely install a libwebp or equivalent on your OS). The PyPI package webp will not serve the purpose.