14 lines
420 B
TypeScript
14 lines
420 B
TypeScript
import terminalImage from 'terminal-image';
|
|
import axios from 'axios';
|
|
|
|
|
|
export async function drawThumbnail(posterImage: string, accessToken: string) {
|
|
let thumbnail = await axios.get(posterImage,
|
|
{
|
|
headers: {
|
|
Authorization: `Bearer ${accessToken}`
|
|
},
|
|
responseType: 'arraybuffer'
|
|
});
|
|
console.log(await terminalImage.buffer(thumbnail.data));
|
|
}
|