.
This commit is contained in:
@ -35,7 +35,7 @@ export default async bot => {
|
||||
e.reply(`${tmp.length}, ${rows.length}, ${dir.length}`);
|
||||
break;
|
||||
default:
|
||||
return e.reply("lul");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}]
|
||||
|
@ -1,5 +1,6 @@
|
||||
import cfg from "../../../config.json";
|
||||
import sql from "../sql.mjs";
|
||||
import lib from "../lib.mjs";
|
||||
|
||||
import fs from "fs";
|
||||
import { exec as _exec } from "child_process";
|
||||
@ -8,6 +9,10 @@ const exec = promisify(_exec);
|
||||
|
||||
const regex = /https?:\/\/[\w\S(\.|:|/)]+/gi;
|
||||
|
||||
console.log(
|
||||
lib.calcSpeed(123456, 56432)
|
||||
);
|
||||
|
||||
export default async bot => {
|
||||
|
||||
return [{
|
||||
@ -40,9 +45,11 @@ export default async bot => {
|
||||
const filename = `${uuid}.${meta.ext}`;
|
||||
|
||||
// download data
|
||||
const source = (await exec(`youtube-dl "${link}" --max-filesize 100m -o ./tmp/${filename}`)).stdout.trim();
|
||||
const start = new Date();
|
||||
const source = (await exec(`youtube-dl "${link}" --max-filesize 10000m -o ./tmp/${filename}`)).stdout.trim();
|
||||
if(source.match(/larger than/))
|
||||
return e.reply("too large lol");
|
||||
const end = ~~((new Date() - start) / 1e3);
|
||||
|
||||
// generate checksum
|
||||
const checksum = (await exec(`sha256sum ./tmp/${filename}`)).stdout.trim().split(" ")[0];
|
||||
@ -81,8 +88,8 @@ export default async bot => {
|
||||
|
||||
e.reply([
|
||||
`title: ${meta.fulltitle}`,
|
||||
`name: ${filename}`,
|
||||
`size: ${size}`,
|
||||
`size: ${lib.formatSize(size)}`,
|
||||
`speed: ${lib.calcSpeed(size, end)}`,
|
||||
`link: ${cfg.main.url}/${insertq.insertId}`
|
||||
]);
|
||||
|
||||
|
Reference in New Issue
Block a user