[Bug] Image plugin cant post images
Closed this issue ยท 3 comments
kaminascripts commented
Image plugin cant post any image with !post
Steps to reproduce the behavior:
Execute this command !post https://github.githubassets.com/images/modules/open_graph/github-octocat.png
Expected behavior
!post https://github.githubassets.com/images/modules/open_graph/github-octocat.png
should print the image in mumble client chat window.
Screenshots
[JJMumbleBot(4.1.0).Command]:Commands Received: [test_user -> !post <a href="https://github.githubassets.com/images/modules/open_graph/github-octocat.png">https://github.githubassets.com/images/modules/open_graph/github-octocat.png</a>]
Exception in thread Thread-11:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "JJMumbleBot/JJMumbleBot/plugins/extensions/images/images.py", line 35, in cmd_post
IH.download_image_stream(img_url)
File "JJMumbleBot/JJMumbleBot/lib/helpers/image_helper.py", line 116, in download_image_stream
img_ext = img_url.rsplit('.', 1)[1]
IndexError: list index out of range
Environment:
- OS: Ubuntu 20.04.1 LTS
- Version v4.1.0
- Python 3.8.2 (installed by default with Ubuntu 20.04)
It seems img_url received by the image plugin has html code, not only the image url.
DuckBoss commented
Oops, I'll take care of this in the next update.
DuckBoss commented
I've applied the fix to the audio-interface-updates branch.
Patch Notes - Images Plugin
- Fixed !post command.
- The !post command now displays an error message when a common http error occurs.
kaminascripts commented
Working right now, thank you!