1
0
mirror of https://github.com/snobu/destreamer.git synced 2026-01-17 05:22:18 +00:00
Files
destreamer-mirror/Thumbnail.ts
2020-04-08 12:06:26 +03:00

17 lines
532 B
TypeScript

import { terminal as term } from 'terminal-kit';
import { execSync } from 'child_process';
export function drawThumbnail(posterImage: string, accessToken: string): void {
let fetchCmd = `ffmpeg -hide_banner -loglevel warning \
-headers "Authorization: Bearer ${accessToken}" \
-i "${posterImage}" -y .thumbnail.png`;
execSync(fetchCmd, { stdio: 'inherit' });
try {
term.drawImage('.thumbnail.png', { shrink: { width: 50, height: 50 } });
}
catch (e) {
console.error(e);
}
}