Spaces:
Paused
Paused
File size: 556 Bytes
7948ff4 8f24b44 7948ff4 e5c2fd4 7948ff4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
const { promises: fs } = require("node:fs")
const main = async () => {
console.log('generating shot..')
const response = await fetch("http://localhost:3000/api/shot", {
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
token: process.env.VC_SECRET_ACCESS_TOKEN,
shotPrompt: "video of a dancing cat"
})
});
console.log('response:', response)
const buffer = await response.buffer()
fs.writeFile(`./test-juju.mp4`, buffer)
}
main() |