title: How to get mp3 file from hls(m3u8) using Javascript?
body: <p>I want to get the mp3 file from hls using Javascript.</p>
  
  <p>This is my code</p>
  
  <pre><code>const https = require('https');
  const downloader = require('m3u8_multi_downloader');
  
  var url ="https://cf-hls-media.sndcdn.com/playlist/m40r0aTezpQY.128.mp3/playlist.m3u8?{MAYBE_TOKENS_HERE}"
  
      https.get(url, (res, extra) =&gt; {
          res.on('data', function (chunk) {
              let hls = JSON.parse(chunk).url;
              console.log(hls);
  
              downloader.download({ url: hls, processNum: 15, filePath: 'tst' });
          });
      }).on("error", (err) =&gt; {
          console.log("Error: " + err.message);
      });
  
  </code></pre>
  
  <p><br></p>
  
  <p>After running this, I got many <strong>".ts" segments</strong> that I actually work but I can't  combine them in one file.</p>