TheNetsky / Microsoft-Rewards-Script

Automated Microsoft Rewards script, using TypeScript, Cheerio and Playwright.
189 stars 44 forks source link

Script can't manage to login on my account #71

Closed serzak51 closed 7 months ago

serzak51 commented 7 months ago

I currently have 2 accounts, one that is pretty old, the other that i created a few weeks ago, and started bing rewards a few days ago. My old account is doing fine, i have no problem with it, but every time it get to the new account it output this error:

[28/02/2024, 12:37:51] [PID: 14052] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0" [28/02/2024, 12:37:51] [PID: 14052] [LOG] [MAIN] Starting DESKTOP browser [28/02/2024, 12:38:22] [PID: 14052] [ERROR] [LOGIN] An error occurred:TimeoutError: page.waitForSelector: Timeout 10000ms exceeded. Call log:

(node:14052) UnhandledPromiseRejectionWarning: undefined (Use node --trace-warnings ... to show where the warning was created) (node:14052) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

The browser is on the log in page, i tried to manually log in, but then because of the error of course it doesn't continue the automation. I also tried to put the new account in first position, but it doesn't change anything. I'm not sure it's related to the issue, but i will put it here since it's different: the bing rewards interface is also kinda weird. When i get on my old account, i have a ton of widget with things like quiz, daily offer etc, while on the new account it seems really empty, there is only the daily activity. The first day there wasn't even search rewards (though it seemed to worked, because in the end of the day i had 59 points). Though i think it's probably just microsoft shenanigans

deepak993635 commented 7 months ago

also happen this with me

serzak51 commented 7 months ago

Did a few experiment. Sometimes when i log in manually it's just ignoring it and spit out the same error, sometime for god knows what reason it's getting a bit further, but end up spitting up another error:

[28/02/2024, 16:49:56] [PID: 14280] [LOG] [GO-HOME] Visited homepage successfully [28/02/2024, 16:49:58] [PID: 14280] [LOG] [MAIN-POINTS] Current point count: 89 [28/02/2024, 16:50:00] [PID: 14280] [ERROR] [GET-EARNABLE-POINTS] An error occurred:TypeError: Cannot read property 'forEach' of undefined (node:14280) UnhandledPromiseRejectionWarning: undefined (Use node --trace-warnings ... to show where the warning was created)

I wouldn't be surprised if this one is because a big part of the reward page is missing. I also checked with this one, and in a normal browser it's working as intended, but not in the script browser. And in the script browser it's working on my old account, but not on my new account, and also another account that i have created today (both are working fine a normal browser). Another information on my new accounts: it's not keeping the login cookies. On my main account he doesn't try to log in anymore, but not on my alt. It could be another way of fixing it, making it log cookies on another part, because i'm pretty sure that the first i launched the script with my old account, i manually put the credential. Then i think it automatically filled it up once, and then the cookie got saved. I don't really see a reason that saving cookies every time the program detect a successful login, whether it be manual or automatic could hurt.

serzak51 commented 7 months ago

I found out the issue. I think it has to do with region. I am in france, not in the US/UK, and i noticed that in the script browser, the activities were in english. So i went to check on my normal browser where it's working, and yup, it's in french. Check my old account in the script browser, and it's in french. It's probably some localisation spaghetti code from microsoft, where he is trying to get activities in english for france. On all the other microsoft websites, it's in french, its only on the bing reward page that he decided to go with english (and not evne consistenly, as rewards name are still in french)

serzak51 commented 7 months ago

Got the confirmation from my theory: I managed to recreate the issue on my normal browser. When you do a normal search, on the left of your profile, there is a button to switch between french and english. And when i click on it, my browser got in english, and all the activities disappeared. I tried to use my vpn on the US, and the activities were normal (though it asked 10000 more verification in the login for some reason). But the login still failed, so these 2 issues aren't related

TheNetsky commented 7 months ago

Fixed 1.4.5 hopefully

royaltongue commented 7 months ago

Getting this error with the new version

TheNetsky commented 7 months ago

Getting this error with the new version

Give more information + logs

royaltongue commented 7 months ago

Sorry, it looked like the same exact error so I didn't know if posting mine would help. I deleted my sessions before updating to the new release and this started happening right after updating.

> microsoft-rewards-script@1.4.5 start
> node ./dist/index.js

[3/1/2024, 7:50:49 PM] [PID: 145988] [LOG] [MAIN] Bot started with 1 clusters
[3/1/2024, 7:50:49 PM] [PID: 145988] [LOG] [MAIN-WORKER] Started tasks for account [redacted]
[3/1/2024, 7:50:50 PM] [PID: 145988] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0"
[3/1/2024, 7:50:50 PM] [PID: 145988] [LOG] [MAIN] Starting DESKTOP browser
[3/1/2024, 7:51:23 PM] [PID: 145988] [ERROR] [LOGIN] An error occurred:TimeoutError: page.waitForSelector: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('#loginHeader') to be visible

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v21.6.1
TheNetsky commented 7 months ago

I don't think you have the latest version of the script installed. Reinstall it properly. Since there's no mention of "#loginHeader" in 1.4.5 anymore.

royaltongue commented 7 months ago

After reinstalling it, it works normally. Thanks!

basalisco commented 7 months ago

Getting this error with the new version

Give more information + logs

with the new version it does not give any errors, but it does not find points from for searches "earn 0 point" then if disabled "run zero point" ile searches are not performed, moreover some quizzes are not solved. In the next few days I would like to try to debug to understand what happens, I think the problem is related to the account I believe that these problems are related in some way to the account,Because it doesn't happen with everyone but especially with new accounts it seems that the page has something different. Excuse my bad English. Thanks for your work

TheNetsky commented 7 months ago

Getting this error with the new version

Give more information + logs

with the new version it does not give any errors, but it does not find points from for searches "earn 0 point" then if disabled "run zero point" ile searches are not performed, moreover some quizzes are not solved. In the next few days I would like to try to debug to understand what happens, I think the problem is related to the account I believe that these problems are related in some way to the account,Because it doesn't happen with everyone but especially with new accounts it seems that the page has something different. Excuse my bad English. Thanks for your work

Your issue is unrelated to this issue, open or re-open your own issue.