api/url: return a diff error when youtube is disabled on main instance

This commit is contained in:
wukko 2024-12-12 23:00:49 +06:00
parent f1916cef6e
commit 112866096c
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -181,6 +181,11 @@ export function extract(url) {
}
if (!env.enabledServices.has(host)) {
// show a different message when youtube is disabled on official instances
// as it only happens when shit hits the fan
if (new URL(env.apiURL).hostname.endsWith(".imput.net") && host === "youtube") {
return { error: "youtube.temporary_disabled" };
}
return { error: "service.disabled" };
}