Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video-based animation ("gifv") support #17

Open
9ary opened this issue Feb 26, 2023 · 6 comments
Open

Video-based animation ("gifv") support #17

9ary opened this issue Feb 26, 2023 · 6 comments

Comments

@9ary
Copy link

9ary commented Feb 26, 2023

We maintain some automatically generated Cubari sources over at https://github.com/catgirl-v/cubari. One of the sources (ADHDinos, scraped from reddit) contains an animated strip (chapter 70), and as far as I can tell, reddit will only serve video formats. Currently that just shows up as broken. Imgur does this too with its "gifv" (which is just mp4 with a different extension).

Video codecs have been replacing the aging animated GIF format over the past decade because they offer much better compression (higher quality at much lower file sizes). Because we run our scrapers on github actions, we can't really afford to transcode the files on our end.

I don't think Cubari would need to do much to support these besides detect the source format and use a <video> element instead of <img>.

@Algoinde
Copy link
Member

@funkyhippo I'm down to push a frontend fix for it (if I can remember how the hell the code works after 2 years), is there anything that needs to happen on the backend for this? In terms of CORS etc

@funkyhippo
Copy link
Collaborator

Hmm, good question; possibly!

How do you plan on implementing this? I don't think there's a surefire way for us to know if a media resource is a video without checking the headers, and for that we'll need proper CORS headers to sniff this out.

@Algoinde
Copy link
Member

Algoinde commented Feb 26, 2023

I was thinking a naive extension check, but yeah, headers is the way. Is the proxy able to forward them? It might require Django to append something to the resource url tho, I'm not sure how the reader is supposed to know that otherwise.

@funkyhippo
Copy link
Collaborator

Yep, they'll return the headers. You'll have to use /v1/cors/:url though since the image endpoint has a content-type allowlist.

We can maybe check for video headers on the first image load failure?

@Algoinde
Copy link
Member

Alright, I see the path to implement this, but in the true spirit of the comic I'll put it off until Wednesday, as there's multiple things that need to be done & tested for this.

@9ary
Copy link
Author

9ary commented Feb 26, 2023

Sounds good, thanks for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants