Skip to content

Discarding original after upload conversion #440

Answered by sgsunder
studiomav asked this question in Q&A
Discussion options

You must be logged in to vote

If you want to do it natively:
Try editing update_post_content() in func.posts to include something like this:

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 …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@studiomav
Comment options

@studiomav
Comment options

Answer selected by studiomav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants