Skip to content

Instantly share code, notes, and snippets.

@ppeeou
Created April 23, 2021 02:35
Show Gist options
  • Save ppeeou/cd875d9ff1abc0082693d331c398cfcd to your computer and use it in GitHub Desktop.
Save ppeeou/cd875d9ff1abc0082693d331c398cfcd to your computer and use it in GitHub Desktop.
nodejs
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