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

17 lines
542 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}\r\n" ` +
`-i "${posterImage}" -y .thumbnail.png`;
execSync(fetchCmd, { stdio: 'inherit' });
try {
term.drawImage('.thumbnail.png', { shrink: { width: 50, height: 50 } });
}
catch (e) {
console.error(e);
}
}