mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 01:18:27 +00:00
api/service-config: replace static arrays with sets
This commit is contained in:
parent
fcdf5da73e
commit
52695cbd0f
@ -194,7 +194,7 @@ export default function({
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "audio":
|
case "audio":
|
||||||
if (audioIgnore.includes(host) || (host === "reddit" && r.typeId === "redirect")) {
|
if (audioIgnore.has(host) || (host === "reddit" && r.typeId === "redirect")) {
|
||||||
return createResponse("error", {
|
return createResponse("error", {
|
||||||
code: "error.api.service.audio_not_supported"
|
code: "error.api.service.audio_not_supported"
|
||||||
})
|
})
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import UrlPattern from "url-pattern";
|
import UrlPattern from "url-pattern";
|
||||||
|
|
||||||
export const audioIgnore = ["vk", "ok", "loom"];
|
export const audioIgnore = new Set(["vk", "ok", "loom"]);
|
||||||
export const hlsExceptions = ["dailymotion", "vimeo", "rutube", "bsky", "youtube"];
|
export const hlsExceptions = new Set(["dailymotion", "vimeo", "rutube", "bsky", "youtube"]);
|
||||||
|
|
||||||
export const services = {
|
export const services = {
|
||||||
bilibili: {
|
bilibili: {
|
||||||
|
@ -136,7 +136,7 @@ const remux = async (streamInfo, res) => {
|
|||||||
args.push('-movflags', 'faststart+frag_keyframe+empty_moov');
|
args.push('-movflags', 'faststart+frag_keyframe+empty_moov');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (streamInfo.type !== 'mute' && streamInfo.isHLS && hlsExceptions.includes(streamInfo.service)) {
|
if (streamInfo.type !== 'mute' && streamInfo.isHLS && hlsExceptions.has(streamInfo.service)) {
|
||||||
if (streamInfo.service === 'youtube' && format === 'webm') {
|
if (streamInfo.service === 'youtube' && format === 'webm') {
|
||||||
args.push('-c:a', 'libopus');
|
args.push('-c:a', 'libopus');
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user