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:21:09 +0100
committerRory& <root@rory.gay>2026-02-17 03:21:09 +0100
commit863f16f4f526f308e2a30d8b809d881d7be71f1c (patch)
treef8ae7d4c14697980d0af1dcecc2ac08743cbc4fd /src/api/util/utility
parentFix user self delete not removing settings protos (diff)
downloadserver-ts-863f16f4f526f308e2a30d8b809d881d7be71f1c.tar.xz
API: fix youtube embed
Diffstat (limited to 'src/api/util/utility')
-rw-r--r--src/api/util/utility/EmbedHandlers.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/api/util/utility/EmbedHandlers.ts b/src/api/util/utility/EmbedHandlers.ts

index 2e50c536..b82cdf97 100644 --- a/src/api/util/utility/EmbedHandlers.ts +++ b/src/api/util/utility/EmbedHandlers.ts
@@ -105,10 +105,11 @@ export const getMetaDescriptions = (text: string) => { }; }; -const doFetch = async (url: URL) => { +const doFetch = async (url: URL, opts?: RequestInit) => { try { const res = await fetch(url, { ...DEFAULT_FETCH_OPTIONS, + ...opts, }); if (res.headers.get("content-length")) { const contentLength = parseInt(res.headers.get("content-length")!); @@ -449,7 +450,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); + const response = await doFetch(url, { headers: { cookie: "CONSENT=PENDING+999" } }); if (!response) return null; const metas = getMetaDescriptions(await response.text());