File size: 556 Bytes
4f64da5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()