Merge branch 'current' into undici

This commit is contained in:
dumbmoron 2023-08-20 17:03:22 +02:00 committed by GitHub
commit a09b062f9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 16 deletions

View file

@ -69,7 +69,6 @@
"enabled": true
},
"streamable": {
"alias": "streamable videos",
"patterns": [":id", "o/:id", "e/:id", "s/:id"],
"enabled": true
}

View file

@ -1,7 +1,7 @@
import { spawn } from "child_process";
import ffmpeg from "ffmpeg-static";
import { ffmpegArgs, genericUserAgent } from "../config.js";
import { getThreads, metadataManager, msToTime } from "../sub/utils.js";
import { getThreads, metadataManager } from "../sub/utils.js";
import { request } from 'undici';
function fail(res) {

View file

@ -49,20 +49,6 @@ export function metadataManager(obj) {
for (let i in keys) { if (tags.includes(keys[i])) commands.push('-metadata', `${keys[i]}=${obj[keys[i]]}`) }
return commands;
}
export function msToTime(d) {
let milliseconds = parseInt((d % 1000) / 100, 10),
seconds = parseInt((d / 1000) % 60, 10),
minutes = parseInt((d / (1000 * 60)) % 60, 10),
hours = parseInt((d / (1000 * 60 * 60)) % 24, 10),
r;
hours = (hours < 10) ? `0${hours}` : hours;
minutes = (minutes < 10) ? `0${minutes}` : minutes;
seconds = (seconds < 10) ? `0${seconds}` : seconds;
r = `${hours}:${minutes}:${seconds}`;
if (milliseconds) r += `.${milliseconds}`;
return r;
}
export function cleanURL(url, host) {
switch(host) {
case "vk":