invidious
invidious copied to clipboard
[Enhancement] Discord Embeds containing videos
Is your enhancement request related to a problem? Please describe. Discord Users often get annoyed when I post Invidious links because there is no quick and easy way to watch/preview the video without having to open the link in browser.
Describe the solution you'd like
Videos in discord embeds so people can watch the video more conveniently.
(found this image showing this is possible on another repo)
Describe alternatives you've considered None
I think this is an added "feature" of discord, because we already generate all the HTML meta tags required for "cards" on various websites:
https://www.opengraph.xyz/url/https%3A%2F%2Fstore.steampowered.com%2Fapp%2F667530%2FDrunken_Wrestlers_2
https://www.opengraph.xyz/url/https%3A%2F%2Ftest.invidious.io%2Fwatch%3Fv%3DYBUqBk17tAI
(We should probably limit the description's length, though)
It seems like it's possible to do it ourselves, a man that run vxtwitter.com was able to do it. We will have to see how he does it.
https://vxtwitter.com/addictionlipa/status/1544662998777823234

link to the vxtwitter repo for reference https://github.com/dylanpdx/BetterTwitFix
Good to know it is possible. Also on the opengraph link, I didn't actually see any meta tags containg the googlevideo url for discord to display.
https://github.com/dylanpdx/BetterTwitFix/blob/a51876a82943567107ef9c777cfa5ffd9c89f060/twitfix.py#L106 The code seems to grab the direct mp4 url, then simply return the content.
@openssl-rand yep, indeed: https://github.com/dylanpdx/BetterTwitFix/blob/a51876a82943567107ef9c777cfa5ffd9c89f060/templates/video.html#L11
Which is not possible on youtube, because URLs expire after 6 hours.
@openssl-rand yep, indeed: https://github.com/dylanpdx/BetterTwitFix/blob/a51876a82943567107ef9c777cfa5ffd9c89f060/templates/video.html#L11
Which is not possible on youtube, because URLs expire after 6 hours.
We can proxy the video though.
Or make it point to a page that always redirect to a fresh URL from yt servers that hasn't expired.
Both options seem good. Proxying code already exists, we just need to modify it a bit. Redrecting urls might be faster and simpler though.