api/service-config: replace static arrays with sets
This commit is contained in:
@@ -194,7 +194,7 @@ export default function({
|
||||
break;
|
||||
|
||||
case "audio":
|
||||
if (audioIgnore.includes(host) || (host === "reddit" && r.typeId === "redirect")) {
|
||||
if (audioIgnore.has(host) || (host === "reddit" && r.typeId === "redirect")) {
|
||||
return createResponse("error", {
|
||||
code: "error.api.service.audio_not_supported"
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import UrlPattern from "url-pattern";
|
||||
|
||||
export const audioIgnore = ["vk", "ok", "loom"];
|
||||
export const hlsExceptions = ["dailymotion", "vimeo", "rutube", "bsky", "youtube"];
|
||||
export const audioIgnore = new Set(["vk", "ok", "loom"]);
|
||||
export const hlsExceptions = new Set(["dailymotion", "vimeo", "rutube", "bsky", "youtube"]);
|
||||
|
||||
export const services = {
|
||||
bilibili: {
|
||||
|
||||
Reference in New Issue
Block a user