mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
Add support to upload custom file
This commit is contained in:
@@ -11,6 +11,34 @@ export async function check_ffmpeg_binary(p: string) {
|
||||
return o.code === 0;
|
||||
}
|
||||
|
||||
export async function fb_get_size(i: string) {
|
||||
const cmd = new Deno.Command("ffprobe", {
|
||||
stdout: "piped",
|
||||
stderr: "piped",
|
||||
args: [
|
||||
"-v",
|
||||
"error",
|
||||
"-select_streams",
|
||||
"v:0",
|
||||
"-show_entries",
|
||||
"stream=width,height",
|
||||
"-of",
|
||||
"csv=s=x:p=0",
|
||||
i,
|
||||
],
|
||||
});
|
||||
const c = cmd.spawn();
|
||||
const o = await c.output();
|
||||
if (o.code !== 0) {
|
||||
return null;
|
||||
}
|
||||
const s = (new TextDecoder()).decode(o.stdout).trim().split("x");
|
||||
return {
|
||||
width: parseInt(s[0]),
|
||||
height: parseInt(s[1]),
|
||||
};
|
||||
}
|
||||
|
||||
export async function fb_generate_thumbnail(
|
||||
p: string,
|
||||
i: string,
|
||||
|
||||
Reference in New Issue
Block a user