Thursday 27 June 2019

What's the best/correct way to download a video from a URL?

I've tried downloading a video using the request module, but it's not working correctly. Every time I open the downloaded video, it's corrupt. What can I do?var request = require('request'); var fs = require('fs');var videoOutput = fs.createWriteStream('video.mp4'); request({ url: VIDEO_URL_HERE }, (error, response, body) => { response.pipe(videoOutput); });Any help would be appreciated, thanks!

Submitted June 28, 2019 at 02:33AM by Ravenbtw

No comments:

Post a Comment