RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.79k stars 10.72k forks source link

No preview generated for YouTube links #28526

Open paulchen opened 1 year ago

paulchen commented 1 year ago

Description:

For certain YouTube links, no preview is shown.

Steps to reproduce:

  1. Write a message that only contains the link https://www.youtube.com/watch?v=f4yXBIigZbg

Expected behavior:

The message is shown together with a preview for the given link.

Actual behavior:

No preview is shown:

image

(the second link is already the next message)

Server Setup Information:

Client Setup Information

This behaviour is client agnostic. It can be reproduced in a browser, in the Electron client, and in the Android app.

Additional context

Most YouTube links are not affected by this problem. However, there are some YouTube links in addition to the one above that show the same behaviour, e.g.:

I was unable to determine a pattern.

Discord shows a preview:

image

However, Slack does not:

image

I also checked the link using Facebook's Sharing Debugger to ensure the OpenGraph information is present and can be extracted:

image

Additionally, I also verified the page using https://www.opengraph.xyz/ which also worked:

image

albetros24 commented 1 year ago

Kindly allow me to work on this issue

hugocostadev commented 1 year ago

@albetros24 you don't need to ask to work in a issue, feel free to get it

CulturalProfessor commented 1 year ago

Hey @hugocostadev I tried to log the content of the provided url in the issue and the body of it was unauthorized,that may be the issue why preview is not visible.It doesn't happens with other urls.

Screenshot from 2023-04-07 10-47-52 Path:apps/meteor/app/oembed/server.ts/getUrlMeta Screenshot from 2023-04-07 10-50-40

singatias commented 8 months ago

This is still a problem, any plans on fixing it?