Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to configure User-Agent for URL previews #17873

Closed
alexgleason opened this issue Oct 28, 2024 · 1 comment · May be fixed by #17968
Closed

Ability to configure User-Agent for URL previews #17873

alexgleason opened this issue Oct 28, 2024 · 1 comment · May be fixed by #17968

Comments

@alexgleason
Copy link

Hello. I would like the ability to configure the user-agent used in link preview requests, with an option like: url_preview_user_agent

Why: because currently links to YouTube do not render a link preview on Synapse. This is YouTube's fault. However you can bypass it by pretending to be Facebook, by setting the user-agent to facebookexternalua. Then YouTube link previews will work properly again.

Exposing a configuration will let server admins work around the issue.

@MadLittleMods
Copy link
Contributor

Closing per this reasoning from the associated PR,

Discussed with the team and we're not keen on pretending to be someone else. If someone doesn't want to serve content to Synapse, that's their prerogative.

This might be a XY problem. The goal is make YouTube URL previews work. Do they have some API/flow that they prefer people to use? Should we be using OpenGraph/oEmbed instead of scraping, etc? We'd rather have PR's for that instead of this workaround.

-- @MadLittleMods, #17968 (comment)


@clokep also shared the canonical issue we're using to track YouTube URL previews not working -> #17462

@MadLittleMods MadLittleMods closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants