![]() |
||
---|---|---|
img | ||
.gitignore | ||
LICENSE | ||
README.md | ||
spoilerinator.py |
README.md
Spoilerinator.
Tool to make spoilered images (+ content warnings) easier to create and compatible(ish) across Matrix clients.
Usage.
- Upload image in an unencrypted room.
- Secondary (left) click on it.
- Copy image URL.
- 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.