ehForwarderBot / efb-qq-slave

EFB QQ Slave, a channel for EH Forwarder Bot. EFB QQ从端
GNU General Public License v3.0
447 stars 48 forks source link

[Feature Request]希望增加对于接受闪照的支持 #106

Closed arrio464 closed 2 years ago

arrio464 commented 2 years ago

希望增加对于接受闪照的支持

版本: go-cqhttp v1.0.0-rc1 efb-qq-slave v2.0.1

接受闪照后,在go-cqhttp的日志中有如下内容

[INFO]:收到好友xxx(xxx)的消息:[CQ:image,file=xxx.image,type=flash] [DEBUG]:上报Event数据{xxx}到http://127.0.0.1:5701

在ehForwarderBot日志中,有如下内容

Exception on / [POST] Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2073, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1518, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(*req.view_args) File "/usr/local/lib/python3.9/dist-packages/cqhttp/init.py", line 101, in _handle response = handler(event) File "/usr/local/lib/python3.9/dist-packages/cqhttp/init.py", line 37, in wrapper return func(args, *kwargs) File "/usr/local/lib/python3.9/dist-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 178, in handle_msg main_text, messages, at_dict = message_elements_wrapper(context, msg_elements, chat) File "/usr/local/lib/python3.9/dist-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 133, in message_elements_wrapper sub_main_text, sub_messages, sub_at_list = message_element_wrapper(context, msg_element, chat) File "/usr/local/lib/python3.9/dist-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 124, in message_element_wrapper messages.extend(self.call_msg_decorator(msg_type, msg_data, chat)) File "/usr/local/lib/python3.9/dist-packages/efb_qq_plugin_go_cqhttp/GoCQHttp.py", line 568, in call_msg_decorator return func(args) File "/usr/local/lib/python3.9/dist-packages/efb_qq_plugin_go_cqhttp/MsgDecorator.py", line 30, in qq_image_wrapper efb_msg.file = cq_get_image(data['url']) File "/usr/local/lib/python3.9/dist-packages/efb_qq_plugin_go_cqhttp/Utils.py", line 649, in cq_get_image urllib.request.urlretrieve(image_link, file.name) File "/usr/lib/python3.9/urllib/request.py", line 239, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.9/urllib/request.py", line 501, in open req = Request(fullurl, data) File "/usr/lib/python3.9/urllib/request.py", line 320, in init self.full_url = url File "/usr/lib/python3.9/urllib/request.py", line 346, in full_url self._parse() File "/usr/lib/python3.9/urllib/request.py", line 375, in _parse raise ValueError("unknown url type: %r" % self.full_url) ValueError: unknown url type: ''

milkice233 commented 2 years ago

@XYenon

XYenon commented 2 years ago

go-cqhttp 上报的闪照 url 是空的,获取不到图片 image

XYenon commented 2 years ago

调用获取图片 API 也获取不到闪照 (上方为普通图片,下方为闪照) image

arrio464 commented 2 years ago

调用获取图片 API 也获取不到闪照 (上方为普通图片,下方为闪照) image

经检查,确实如您所述,无法查看。 在此表示对大佬帮助的感谢。

XYenon commented 2 years ago

有一个 pr 添加了一种获取闪照的方式,可以试一下 https://github.com/ehForwarderBot/efb-qq-plugin-go-cqhttp/pull/26

arrio464 commented 2 years ago

有一个 pr 添加了一种获取闪照的方式,可以试一下 ehForwarderBot/efb-qq-plugin-go-cqhttp#26

经过测试,已经可以收到闪照。感谢大佬们的付出!