mirror of
https://github.com/imputnet/cobalt.git
synced 2026-01-02 13:01:14 +00:00
api: add DURATION_LIMIT env variable
duration limit is now in seconds and customizable across instances
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { maxVideoDuration } from "../../config.js";
|
||||
import { env } from "../../config.js";
|
||||
import { cleanString } from '../../sub/utils.js';
|
||||
|
||||
const resolutionMatch = {
|
||||
@@ -63,7 +63,7 @@ export default async function(obj) {
|
||||
}
|
||||
}
|
||||
|
||||
if (api.video.duration > maxVideoDuration / 1000) return { error: ['ErrorLengthLimit', maxVideoDuration / 60000] };
|
||||
if (api.video.duration > env.durationLimit) return { error: ['ErrorLengthLimit', env.durationLimit / 60] };
|
||||
|
||||
let masterJSONURL = api["request"]["files"]["dash"]["cdns"]["akfire_interconnect_quic"]["url"];
|
||||
let masterJSON = await fetch(masterJSONURL).then((r) => { return r.json() }).catch(() => { return false });
|
||||
|
||||
Reference in New Issue
Block a user