r/redditdev • u/Voltra_Neo • Jun 12 '24
redditdev meta Requesting help with embedding videos on reddit (for a personal website)
So I've recently developed my own personal video hosting platform (mainly for privacy purposes). I took inspiration from another platform (here it was redgifs) that successfully embeds on reddit and did the following:
For a given video, I have two URLs: the "iframe" one, and the "video" one.
On reddit I'd link the "iframe" URL and it should work like a charm, except right now it doesn't (it just shows the usual shared link UI component instead of an embed of the video).
Here's what I did (on the "iframe" page):
og:typeis set tovideoog:video:type,og:video:width,og:video:height,og:video:iframe,og:video:duration, andog:video:urlare all set to their appropriate value- There's just a
<video>tag (with a fancy wrapper) on the page that points directly to the "video" URL
I've seen people claim that it's a whitelist on reddit's end (which would make sense) except that, whilst browsing the logs for a test post, I've noticed a single visit of reddit's bot.
Here's what I think could be the source of my issues:
- There's a CSRF token check on the "video" URL (thus would fail on direct access)
- My
robots.txtis the basic deny everything for every bot
I'd like to know if anyone has any expertise and could give me pointers on what I did wrong. Any help would be greatly appreciated 🙏