title: unable to download videos from fb in node js
body: <p>I am creating a web application using node js that can download videos from facebook, i am getting the url and quality using express using the code below but how can i download it</p>
  <pre><code>const express = require('express');
  const app = express();
  const path = require('path');
  const bodyParser = require('body-parser');
  var http = require('http');
  var fs = require('fs');
  
  app.get('/', (req,res)=&gt;{
      res.sendFile(path.join(__dirname,'templates','index.html'));  
  });
  
  app.use(bodyParser.urlencoded({ extended: true })); 
  
  //app.use(express.bodyParser());
  
  app.post('/send_data', function(req, res) {
    res.send('You sent the name &quot;' + req.body.fbUrl + ' in '+req.body.quality+' Quality&quot;.');
    if(req.body.quality == &quot;HD&quot;)
    {
      download_video(&quot;HD&quot;);
    }
    else if(req.body.quality == &quot;SD&quot;)
    {
      download_video(&quot;SD&quot;);
    }
    else if(req.body.quality == &quot;MP3&quot;)
    {
      download_video(&quot;MP3&quot;);
    }
    else
    {
      app.get('/', (req,res)=&gt;{
          res.sendFile(path.join(__dirname,'templates','index.html'));  
      });
    }
    function download_video(quality)
    {
        console.log('video is downloading in &quot;'+req.body.quality+'&quot; Quality');
    }
  </code></pre>