Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
How to concat more than one m3u8 files in s3 bucket using js?

export const liverecorddownload = async(req,res) => { try{

    const BUCKET = "***";
    const PREFIX = '***';
    var params = {
        Bucket: BUCKET, 
        Prefix:PREFIX,
        
    
       };
    s3.listObjectsV2(params,async(err,data)=>{
        if(err) console.log("bucket list object c",err)
        else {
           
    if(data &&  data.Contents   &&  data.Contents.length>0){
        var FILES = data &&  data.Contents  
        console.log('Get:', FILES);

const promises = [];

try {
  for (let ii = 0; ii < FILES.length; ii++) {
    const params = {
      Bucket: BUCKET,
      Key: `${FILES[ii].Key}`,
    };
    
    promises.push(s3.getObject(params).promise());
  }

  const results = await Promise.all(promises);
  const buffers = results.map(result => result.Body);
  const content = buffers.map(buffer => JSON.parse(zlib.unzipSync(buffer).toString()));
  console.log('Read OK', JSON.stringify(content));

  const merged = Object.assign({}, ...content);
  console.log('Merged content', JSON.stringify(merged));


} catch (err) {
  console.log(err, err.stack);
  throw err;
}

        
    }
    }
    })
}
catch(e){
    console.log("appconfig",e)

    return false
}

}

here above is my code and objects are .m3u8 When try to compile i got error like below

Error: incorrect header check at Zlib.zlibOnError [as onerror] (zlib.js:187:17) let me know whats i do wrong Thanks in Advance

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!