my code snippet as below:
const express = require('express');
const app = express();
const ytdl = require('ytdl-core');
const fs = require('fs')
var router = express.Router();
router.get('/', function (req, res, next) {
console.log('rputer calld')
let url = "https://youtu.be/nD_NDngrEl8";
ytdl(url).pipe(fs.createWriteStream('./presentation/video.webm'));
res.end();
})
app.use(router);
app.listen(2222, () => {
console.log('app listingin on 2222')
})
I have used express server and put a youtube URL, which I wanted to download in its high quality.