1
0
mirror of https://github.com/snobu/destreamer.git synced 2026-02-13 01:59:42 +00:00

Moved things around

This commit is contained in:
snobu
2020-04-08 09:20:31 +03:00
parent 9eb7c0e5be
commit a48812cb58
3 changed files with 33 additions and 24 deletions

27
Thumbnail.ts Normal file
View File

@@ -0,0 +1,27 @@
import os from 'os';
import { terminal as term } from 'terminal-kit';
if (os.platform() !== "win32") {
term.brightWhite("Platform is not Windows, let's draw some thumbnails!\n");
let a = async () => {
response = await axios.get(posterImageUrl, {
headers: {
Authorization: `Bearer ${session.AccessToken}`
},
responseType: 'stream'
});
const writer = fs.createWriteStream('.thumbnail.png');
response.data.pipe(writer);
return new Promise((resolve, reject) => {
writer.on('finish', resolve);
writer.on('error', reject);
});
};
await a();
}
term.drawImage('.thumbnail.png', { shrink: { width: 50, height: 50 } });