invidious icon indicating copy to clipboard operation
invidious copied to clipboard

[Enhancement] Discord Embeds containing videos

Open openssl-rand opened this issue 2 years ago • 8 comments

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. image (found this image showing this is possible on another repo)

Describe alternatives you've considered None

openssl-rand avatar Aug 06 '22 20:08 openssl-rand

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)

SamantazFox avatar Aug 08 '22 22:08 SamantazFox

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

image

unixfox avatar Aug 09 '22 09:08 unixfox

link to the vxtwitter repo for reference https://github.com/dylanpdx/BetterTwitFix

anyone00 avatar Aug 09 '22 20:08 anyone00

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.

ghost avatar Aug 10 '22 22:08 ghost

https://github.com/dylanpdx/BetterTwitFix/blob/a51876a82943567107ef9c777cfa5ffd9c89f060/twitfix.py#L106 The code seems to grab the direct mp4 url, then simply return the content.

ghost avatar Aug 10 '22 22:08 ghost

@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.

SamantazFox avatar Aug 16 '22 20:08 SamantazFox

@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.

unixfox avatar Aug 16 '22 21:08 unixfox

Both options seem good. Proxying code already exists, we just need to modify it a bit. Redrecting urls might be faster and simpler though.

ghost avatar Aug 17 '22 01:08 ghost