summary refs log tree commit diff
path: root/src/api/util/utility
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-02-17 03:35:47 +0100
committerRory& <root@rory.gay>2026-02-17 03:35:47 +0100
commit961cb9a7e26e083af9c4e53a4982a76c4dc34e0d (patch)
treea0db3968e0d03b61c97c988407bc8218dacc20e5 /src/api/util/utility
parentAPI: fix youtube embed (diff)
downloadserver-ts-961cb9a7e26e083af9c4e53a4982a76c4dc34e0d.tar.xz
API: request embeds in US english preferred
Diffstat (limited to 'src/api/util/utility')
-rw-r--r--src/api/util/utility/EmbedHandlers.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/util/utility/EmbedHandlers.ts b/src/api/util/utility/EmbedHandlers.ts

index b82cdf97..77d0c8f0 100644 --- a/src/api/util/utility/EmbedHandlers.ts +++ b/src/api/util/utility/EmbedHandlers.ts
@@ -27,6 +27,7 @@ export const DEFAULT_FETCH_OPTIONS: RequestInit = { redirect: "follow", headers: { "user-agent": "Mozilla/5.0 (compatible; Spacebar/1.0; +https://github.com/spacebarchat/server)", + "accept-language": "en-US,en;q=0.9", }, // size: 1024 * 1024 * 5, // grabbed from config later method: "GET", @@ -450,7 +451,7 @@ export const EmbedHandlers: { "youtu.be": (url) => EmbedHandlers["www.youtube.com"](url), "youtube.com": (url) => EmbedHandlers["www.youtube.com"](url), "www.youtube.com": async (url: URL): Promise<Embed | null> => { - const response = await doFetch(url, { headers: { cookie: "CONSENT=PENDING+999" } }); + const response = await doFetch(url, { headers: { cookie: "CONSENT=PENDING+999; hl=en" } }); if (!response) return null; const metas = getMetaDescriptions(await response.text());