added env variables

This commit is contained in:
2023-05-09 18:24:10 +02:00
parent b5772e476b
commit a3cbe956d7
4 changed files with 24 additions and 4 deletions

14
main.js
View File

@@ -1,9 +1,19 @@
import fs from 'fs';
import https from 'https';
import chalk from 'chalk';
import load from 'dotenv';
load()
let songCount = 1;
const AUTHTOKEN = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiJGYmd3dndBT1JCTjlibVJmRUxLcHciLCJleHAiOjE2ODE5ODg5MTUuMzU2LCJpYXQiOjE2ODE5ODgwMTV9.hCs0U5Iv5bgaU9oYi9kmSl0A_gt3V9svL0NiCEvtZFr4DXiNQwkt30fUtwOofMmHUnoEKiRt8ER-K8n5vsXKc23gvvcKaYEzY1kipwlAkK_JiYslE1FXDGXBBN1VrunACWLY5sWyRt1og6WP20BaoD0gIvBr0iazN323mlpU_Ls4yOrid2J_veXAwmCkW_26Q2NbhJeEV2rlwnV95CtxmogYHkoDrDz65UncU5AUvl4ae96il9IN7MSI0DvFl3NutVnD3B2wPaNHNAIoMC1_nLwWl5Q5GMbgC2AW3B1U0pozg78ePFVWq-mKYY8IbgjESNKWg1gRF5oknsFq8shxjw";
const AUTHTOKEN = process.env.AUTHTOKEN;
const TOKEN = process.env.TOKEN;
const USERID = process.env.USERID;
if(!AUTHTOKEN || !TOKEN || !USERID) {
console.error('Please enter all the required information');
process.exit(1);
}
@@ -100,7 +110,7 @@ for(const genre of genres) {
let folder = `./songs/${genre}/${mentalState}/${activity}/${hasMultipleNELs ? "mixed" : level}`
let filename = `${song.name.replace(' ', '_')}`;
let downloadLink = `https://audio.brain.fm/${song.url}?userId=FbgwvwAORBN9bmRfELKpw&token=1Uah43y3X33F7ERFwx-_P`
let downloadLink = `https://audio.brain.fm/${song.url}?userId=${USERID}&token=${TOKEN}`;
downloadQueue.enqueue(downloadLink, folder, filename);
}