Skip to content
Discussion options

You must be logged in to vote
app.get("/download/video", async (req, res) => {
   const videoUrl = req.query.url
   let stream = got.stream(videoUrl)
   stream.pipe(res)
    res.json({ url: "video.mp4" })
})

This should work in my opinion. OR

app.get("/download/video", async (req, res) => {
   const videoUrl = req.query.url
   await pipeline(
      got.stream(videoUrl),
      res
    );
    res.json({ url: "video.mp4" })
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sindresorhus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1845 on August 18, 2021 18:12.