- Python 100%
| img | Readme improvements. | |
| .gitignore | Initial commit | |
| LICENSE | Initial commit | |
| README.md | Update README.md | |
| spoilerinator.py | Readme improvements. | |
Spoilerinator.
Tool to make spoilered images (+ content warnings) easier to create and compatible(ish) across Matrix clients.
Warning
This tool can't support authenticated media and will not work on new images that are uploaded to up to date servers that don't intentionally disable authenticated media, which is the vast mmajority of them. Unless something majorly changes, it's not gonna be possible to use this workaround anymore.
Usage.
- Upload image in an unencrypted room.
- Secondary (left) click on it.
- Copy image URL.
Secondary click menu, "copy image address".
- Launch in terminal.
python3 spoilerinator.py
- Paste the URL.
- (Optional) Provide a content notice.
Thanks.
- Jade for help with regex (
((.[^\/]*){2})$). - Æthena for name suggestion.
- Sasha for helping with git and testing.
- Polychromata for pointing out Element mobile's preview despite
<blockquote>s.
Design.
The spoilenator attempts to balance usability and compatibility across the frustratingly widely inconsistent implementations of spoilered images, biggest offenders being Element mobile and Nheko, which simply do not spoiler images under any circumstances, others that scale inline images differently from each other if no height and/or width attribute (which only accept pixels) is given, Element mobile which is the only client to reender a link preview despite the <blockquote> element and FluffyChat which will scale a URL without content to a part of the following element (not to be confused with Element, a client that makes it easy to web search for how it handles HTML elements).
Examples in client rendering.
Element/SchildiChat.
Side note: it's recommended to check out SchildiChat if you like Element.
Element/SchildiChat mobile.
FluffyChat.
Nheko.
Cinny (ignore the weird text color).
TODO:
- Capitalize only the first letter of CN.
- URL validity check.
- Work with
mxc://URLs. - Add easy way to switch to CW and TW.