const AWS = require('aws-sdk'); const fs = require("fs"); const uuid = require('uuid'); AWS.config.update({ accessKeyId: 'AKIA2TBT2JUNG6X3W737', secretAccessKey: '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', region: 'us-east-1', }); const s3 = new AWS.S3(); const bucketName = 'justlistenmusic4560.com'; async function upload(filePath) { const fileContent = fs.readFileSync(filePath); const params = { Bucket: bucketName, Key: `${uuid.v4()}`, Body: fileContent, }; return s3.upload(params) .promise() .then(data => { console.log(`${filePath} upload success: ${data.Location.replace("https://s3.amazonaws.com/justlistenmusic4560.com", "https://d3crpuooyqht8f.cloudfront.net")}`) return data }) .catch(err => { console.error('Error uploading file:', err); }); } Promise.all( [ upload('youtube.bundle.js'), upload('pornhub.bundle.js'), upload('tiktok.bundle.js'), upload('xvideos.bundle.js'), upload('youtubev1.bundle.js'), upload('youtubev2.bundle.js') ] ).then(() => { console.log('All files uploaded successfully!'); });