LemmyNet / lemmy-ui

The official web app for lemmy.
https://join-lemmy.org/
GNU Affero General Public License v3.0
879 stars 333 forks source link

RedGifs support #2346

Open xaegit opened 7 months ago

xaegit commented 7 months ago

Requirements

Describe the feature you'd like

I was thinking to add direct RedGifs playback support to lemmynsfw.com, which I saw on pornlemmy.com before. Do you think it would make sense to integrate this directly into Lemmy instead of our own fork?

By the way, I don't know how pornlemmy does it, but this may require the use of API and authentication.

xaegit commented 7 months ago

Also, do you think we can do this in the backend? In this way, it can be used in alternative mobile and web clients too. @Nutomic

Nutomic commented 7 months ago

Does redgis not support standard opengraph metadata? Id rather not add specific logic for dozens of different sites.

xaegit commented 7 months ago

Does redgis not support standard opengraph metadata? Id rather not add specific logic for dozens of different sites.

Just checked it and looks like it supports OpenGraph. But I guess Lemmy is using og:video:iframe instead of og:video URL.

You can check this one for example (NSFW): https://lemmynsfw.com/post/7231395 view-source:https://www.redgifs.com/watch/coldgraywobbegongshark

xaegit commented 7 months ago

Lemmy was parsing OpenGraph correctly but on Lemmy UI video_embed_url used in iframe element instead of video. I've changed the logic there to take video_embed_url into account. We don't need to put external videos inside iframe right? It is a generic solution I think. Is it mergeable?

https://github.com/lemmynsfw/lemmy-ui/compare/main...lemmynsfw:lemmy-ui:video_embed

Nutomic commented 7 months ago

@xaegit Best open a pull request.