stream: move hls exceptions to servicesConfig (#527)

This commit is contained in:
wukko
2024-05-28 14:32:03 +06:00
committed by GitHub
parent 806ad14266
commit 64b5990d81
4 changed files with 6 additions and 6 deletions

View File

@@ -3,14 +3,12 @@ import { randomBytes } from "crypto";
import { nanoid } from "nanoid";
import { decryptStream, encryptStream, generateHmac } from "../sub/crypto.js";
import { env } from "../config.js";
import { env, hlsExceptions } from "../config.js";
import { strict as assert } from "assert";
// optional dependency
const freebind = env.freebindCIDR && await import('freebind').catch(() => {});
const M3U_SERVICES = ['dailymotion', 'vimeo', 'rutube'];
const streamCache = new NodeCache({
stdTTL: env.streamLifespan,
checkperiod: 10,
@@ -110,7 +108,7 @@ export function destroyInternalStream(url) {
function wrapStream(streamInfo) {
/* m3u8 links are currently not supported
* for internal streams, skip them */
if (M3U_SERVICES.includes(streamInfo.service)) {
if (hlsExceptions.includes(streamInfo.service)) {
return streamInfo;
}