-
I modified the generate_alternate_formats() function so I could automatically convert formats besides GIF, in my case webm -> mp4 for broader mobile device support. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If you want to do it natively: if post.mime_type == "video/webm":
content = images.Image(content).to_mp4() which I think should do the trick. An alternate, more robust way of doing this is to use the webhooks feature. I do something similar for cleaning up tags on my personal instance. You can create a lightweight flask (or whatever framework you prefer) container in Docker that's hosted in parallel to the main szurubooru instance. When a new post is made, a webhook call will be made to this server, which can then perform the webm to mp4 conversion, which can then make a PUT request and update the content of the post. |
Beta Was this translation helpful? Give feedback.
If you want to do it natively:
Try editing
update_post_content()
infunc.posts
to include something like this:which I think should do the trick.
An alternate, more robust way of doing this is to use the webhooks feature. I do something similar for cleaning up tags on my personal instance. You can create a lightweight flask (or whatever framework you prefer) container in Docker that's hosted in parallel to the main szurubooru instance.
When a new post is made, a webhook call will be made to this server, which can then perform the webm to mp4 conversion, which can then make a PUT request and update the content …