mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-12 20:25:06 +01:00
stream: move hls exceptions to servicesConfig (#527)
This commit is contained in:
parent
806ad14266
commit
64b5990d81
4 changed files with 6 additions and 6 deletions
|
@ -53,6 +53,7 @@ const
|
|||
|
||||
export const
|
||||
services = servicesConfigJson.config,
|
||||
hlsExceptions = servicesConfigJson.hlsExceptions,
|
||||
audioIgnore = servicesConfigJson.audioIgnore,
|
||||
version = packageJson.version,
|
||||
genericUserAgent = config.genericUserAgent,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"audioIgnore": ["vk", "ok"],
|
||||
"hlsExceptions": ["dailymotion", "vimeo", "rutube"],
|
||||
"config": {
|
||||
"bilibili": {
|
||||
"alias": "bilibili.com & bilibili.tv",
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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')
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue