Merge branch 'master' into captcha-login
[DeezloaderRemix.git] / app / app.js
index 2987dff8b9407452ecbfc41a8b05728f03e945c8..e2cd1c408d7ed027f4d1d309edf6fac1307977de 100644 (file)
@@ -125,11 +125,16 @@ io.sockets.on('connection', function (s) {
        s.emit("getDefaultSettings", defaultSettings, defaultDownloadFolder)
        s.emit("populateDownloadQueue", downloadQueue)
 
+       const captcha = require('./public/js/captcha');
+       captcha.callbackResponse = function (data) {
+               s.emit("getCaptcha", data)
+       };
+
        // Function for logging in
-       s.on("login", async function (username, password, autologin) {
+       s.on("login", async function (username, password, captchaResponse, autologin) {
                try{
                        logger.info("Logging in");
-                       await s.Deezer.login(username, password)
+                       await s.Deezer.login(username, password, captchaResponse)
                        s.emit("login", {user: s.Deezer.user})
                        logger.info("Logged in successfully")
                        if (autologin){