vany-lib
v2.0.0
Published
A simple library for creating videos by vany.ai
Readme
vany-lib
A simple library for creating videos by vany.ai
Install
npm install vany-libuse
Connect with your Google account on the vany.ai website, and take the refresh_token from local storage.
const {default: craftVideo, downloadVideo } = require('vany-lib');
const fs = require('fs');
let refresh_token = 'your_refresh_token';
(async () => {
let {url, title, transcript} = await craftVideo('your prompt', refresh_token, {
mode: 'auto', //Optional, default: auto
ratio: 'desktop', //Optional, default: desktop
images: [{filename: 'example.png', file: fs.readFileSync('example.png')}] //optional. up to 5
});
let buffer = await downloadVideo(url); //optional (to get buffer)
fs.writeFileSync(title.replace(/[\\/:*?"<>|]/g, "_") + ".mp4", buffer);
console.log(title, transcript)
})();