TheNetsky / Microsoft-Rewards-Script

Automated Microsoft Rewards script, using TypeScript, Cheerio and Playwright.
133 stars 33 forks source link

Error when searching for a mobile phone #123

Closed rosmander closed 2 weeks ago

rosmander commented 1 month ago

Sin título So far everything has been working perfectly, but since two days ago the script does not perform mobile searches, giving me the bad-user agent error, I have updated playwright and I have even installed all its modes "npm init playwright@latest" but the error persists, do you know what could be the cause of the error?

rosmander commented 1 month ago

hi?

TheNetsky commented 1 month ago

I cannot replicate this.

rosmander commented 1 month ago

Ok, thanks

lscheub commented 1 month ago

This also happens for me on one of the accounts. That specific account has a warning at the top of the rewards site "Unusual search activity might be influencing your ability to earn points" (translated from german). This is at least for me why it does not gain any mobile search points and consequently retries the mobile searches endlessly.

rosmander commented 1 month ago

I have not looked at this warning the truth, I will do it soon, what is true is that if the script gives me error and I use my mobile phone, the error disappears, hence I thought it was some problem of the user agent generated by the script and I asked here.

xunilalala commented 1 month ago

I have encountered this issue before, and my solution is as follows.

Initially, everything worked normally, but over time, the mobile search stopped working properly while the desktop search continued to function. I preliminarily deduced that it was a session issue.

Over the following month, by using my solution, the issue did not reoccur.

My solution: Clear the session every day at midnight and run this script three times daily.

xunilalala commented 1 month ago

This also happens for me on one of the accounts. That specific account has a warning at the top of the rewards site "Unusual search activity might be influencing your ability to earn points" (translated from german). This is at least for me why it does not gain any mobile search points and consequently retries the mobile searches endlessly.

Please search the previous issue records. I remember there was one mentioning that certain regions have time restrictions on search, possibly requiring a minimum of 15 minutes between every three searches. Please try to find it.

rosmander commented 1 month ago

I have encountered this issue before, and my solution is as follows.

Initially, everything worked normally, but over time, the mobile search stopped working properly while the desktop search continued to function. I preliminarily deduced that it was a session issue.

Over the following month, by using my solution, the issue did not reoccur.

My solution: Clear the session every day at midnight and run this script three times daily.

Well I will have to do what you tell me to solve it, because it happens to me exactly the same, it makes me perfectly the searches of pc and not those of mobile by bad user agent.

As for deleting the session data how do you do it? because I do it through cmd and without seeing any window. I want to imagine that you make the browser display while the script is running.

Thank you very much for your help. I will try all this starting tomorrow.

rosmander commented 1 month ago

Please search the previous issue records. I remember there was one mentioning that certain regions have time restrictions on search, possibly requiring a minimum of 15 minutes between every three searches. Please try to find it.

Yes, this is a problem that microsoft randomly assigns to some accounts for a while and then disappears. That happens to me in one of my accounts, and what I did was to ask a programmer friend to add to the script a 15 minute counter every 4 searches and that's it, it still gives me the error, but because I did not know what you have indicated above to delete the data.

Thank you very much for your attention and answers.

xunilalala commented 1 month ago

@rosmander Bro,

First, it's a pity that you had to ask a programmer friend to help you with the code because the main repository fully supports this feature. You just need to adjust the values in the config file. image

Second, if you only see the cmd window, it might be because "headless" is set to true in the config or you are using Docker.

Third, the session files are located in ./browser/sessions. Try deleting the sessions folder.

rosmander commented 1 month ago

./browser/sessions

Good again, thank you very much for telling me the command that would have to be put to pause between searches, however, after several days, yesterday microsoft removed the limitation of 3 searches every 15 minutes of that account.

My friend also had to modify the login file, because I use Authenticator not using a password and if I did it as the script said it would give me problems, now it does not.

If I have the headless option on and do not use docker, with the modification that she made me I get in the cmd the code that I have to enter in the phone and still no problems, the truth is that this is very hard work.

Thank you very much for helping me, I have deleted today the session file and I am trying to see if it eliminates the errors as you say that gave me lately the script. At the moment it is working great, thank you very much for your help from the bottom of my heart.