Created
April 23, 2021 02:35
-
-
Save ppeeou/cd875d9ff1abc0082693d331c398cfcd to your computer and use it in GitHub Desktop.
nodejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require("node-fetch"); | |
const fs = require("fs"); | |
const url = "your url"; | |
(async () => { | |
const response = await fetch(url); | |
const buffer = await response.buffer(); | |
fs.writeFile(`./filename.mp4`, buffer, () => | |
console.log("downloading video!") | |
); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment