collapsed two lines

This commit is contained in:
wukko 2023-08-20 15:42:57 +06:00
parent b0bed82167
commit 36622fc7ac

View file

@ -5,10 +5,7 @@ import { ffmpegArgs, genericUserAgent } from "../config.js";
import { getThreads, metadataManager, msToTime } from "../sub/utils.js"; import { getThreads, metadataManager, msToTime } from "../sub/utils.js";
function fail(res) { function fail(res) {
if (!res.headersSent) { if (!res.headersSent) res.sendStatus(500);
res.sendStatus(500);
}
return res.destroy(); return res.destroy();
} }
@ -32,9 +29,7 @@ export function streamDefault(streamInfo, res) {
} }
export function streamLiveRender(streamInfo, res) { export function streamLiveRender(streamInfo, res) {
try { try {
if (streamInfo.urls.length !== 2) { if (streamInfo.urls.length !== 2) return fail(res);
return fail(res);
}
let audio = got.get(streamInfo.urls[1], { isStream: true }); let audio = got.get(streamInfo.urls[1], { isStream: true });
let format = streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1], args = [ let format = streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1], args = [