File size: 568 Bytes
7948ff4
 
 
 
e5c2fd4
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(process.env."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()