best way to save what you love
Svelte collaborationdownloaderinstagramjavascriptmusicredditsocial-mediasoundcloudsveltetiktoktwittertypescriptvideovimeovkwebappyoutubeyoutube-downloader
stream: move hls exceptions to servicesConfig (#527)
wukko64b5990d8155
diff --git a/src/modules/config.js b/src/modules/config.jsindex 67114b56..530c5f0b 100644--- a/src/modules/config.js+++ b/src/modules/config.js@@ -53,6 +53,7 @@ constexport constservices = servicesConfigJson.config,+ hlsExceptions = servicesConfigJson.hlsExceptions,audioIgnore = servicesConfigJson.audioIgnore,version = packageJson.version,genericUserAgent = config.genericUserAgent,diff --git a/src/modules/processing/servicesConfig.json b/src/modules/processing/servicesConfig.jsonindex 9e8e8b66..2daa7b63 100644--- a/src/modules/processing/servicesConfig.json+++ b/src/modules/processing/servicesConfig.json@@ -1,5 +1,6 @@{"audioIgnore": ["vk", "ok"],+ "hlsExceptions": ["dailymotion", "vimeo", "rutube"],"config": {"bilibili": {"alias": "bilibili.com & bilibili.tv",diff --git a/src/modules/stream/manage.js b/src/modules/stream/manage.jsindex bccf5c80..05008077 100644--- a/src/modules/stream/manage.js+++ b/src/modules/stream/manage.js@@ -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 dependencyconst 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;}diff --git a/src/modules/stream/types.js b/src/modules/stream/types.jsindex a1db0c60..2036b360 100644--- a/src/modules/stream/types.js+++ b/src/modules/stream/types.js@@ -5,7 +5,7 @@ import { create as contentDisposition } from "content-disposition-header";import { metadataManager } from "../sub/utils.js";import { destroyInternalStream } from "./manage.js";-import { env, ffmpegArgs } from "../config.js";+import { env, ffmpegArgs, hlsExceptions } from "../config.js";import { getHeaders, closeResponse } from "./shared.js";function toRawHeaders(headers) {@@ -215,7 +215,7 @@ export function streamVideoOnly(streamInfo, res) {args.push('-an')}- if (["vimeo", "rutube", "dailymotion"].includes(streamInfo.service)) {+ if (hlsExceptions.includes(streamInfo.service)) {args.push('-bsf:a', 'aac_adtstoasc')}