mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-31 17:59:33 +00:00
API: request embeds in US english preferred
Build docker images / build (cdn) (push) Failing after 1m17s
Build docker images / build (admin-api) (push) Failing after 4m16s
Style / build (24.x) (push) Failing after 1m22s
Build docker images / build (api) (push) Failing after 1m29s
Build docker images / build (default) (push) Failing after 54s
Build docker images / build (cdn-cs) (push) Failing after 1m17s
Build docker images / build (gateway) (push) Failing after 58s
Build docker images / build (gateway-offload) (push) Failing after 1m17s
Build / build (24.x) (push) Successful in 1m23s
Nix build / build-nix (push) Failing after 1m15s
Build docker images / build (cdn) (push) Failing after 1m17s
Build docker images / build (admin-api) (push) Failing after 4m16s
Style / build (24.x) (push) Failing after 1m22s
Build docker images / build (api) (push) Failing after 1m29s
Build docker images / build (default) (push) Failing after 54s
Build docker images / build (cdn-cs) (push) Failing after 1m17s
Build docker images / build (gateway) (push) Failing after 58s
Build docker images / build (gateway-offload) (push) Failing after 1m17s
Build / build (24.x) (push) Successful in 1m23s
Nix build / build-nix (push) Failing after 1m15s
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user