TheNetsky / Microsoft-Rewards-Script

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

User agent issue #36

Closed saurabh9661180 closed 8 months ago

saurabh9661180 commented 9 months ago

Generating same user agent for most of the accounts like 99% of the time

`

[7/1/2024, 10:30:17 pm] [PID: 22676] [LOG] [MAIN] Bot started with 1 clusters
[7/1/2024, 10:30:17 pm] [PID: 22676] [LOG] [MAIN-WORKER] Started tasks for account XXXXXXXXXXXXXXX@gmail.com
[7/1/2024, 10:30:17 pm] [PID: 22676] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0"
[7/1/2024, 10:30:17 pm] [PID: 22676] [LOG] [MAIN] Starting DESKTOP browser
[7/1/2024, 10:30:35 pm] [PID: 22676] [LOG] [LOGIN] Already logged in
[7/1/2024, 10:30:35 pm] [PID: 22676] [LOG] [LOGIN-BING] Verifying Bing login
[7/1/2024, 10:30:38 pm] [PID: 22676] [LOG] [LOGIN-BING] Bing login verification passed!
[7/1/2024, 10:30:38 pm] [PID: 22676] [LOG] [LOGIN] Logged in successfully
[7/1/2024, 10:30:47 pm] [PID: 22676] [LOG] [GO-HOME] Visited homepage successfully
[7/1/2024, 10:30:48 pm] [PID: 22676] [LOG] [MAIN-POINTS] Current point count: 650
[7/1/2024, 10:30:49 pm] [PID: 22676] [LOG] [MAIN-POINTS] You can earn 0 points today
[7/1/2024, 10:30:49 pm] [PID: 22676] [LOG] [MAIN] No points to earn and "runOnZeroPoints" is set to "false", stopping!
[7/1/2024, 10:30:49 pm] [PID: 22676] [LOG] [MAIN-WORKER] Started tasks for account xxxxxxxxxxxxx@outlook.com
[7/1/2024, 10:30:49 pm] [PID: 22676] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0"
[7/1/2024, 10:30:49 pm] [PID: 22676] [LOG] [MAIN] Starting DESKTOP browser
[7/1/2024, 10:31:07 pm] [PID: 22676] [LOG] [LOGIN] Already logged in
[7/1/2024, 10:31:07 pm] [PID: 22676] [LOG] [LOGIN-BING] Verifying Bing login
[7/1/2024, 10:31:09 pm] [PID: 22676] [LOG] [LOGIN-BING] Bing login verification passed!
[7/1/2024, 10:31:09 pm] [PID: 22676] [LOG] [LOGIN] Logged in successfully
[7/1/2024, 10:31:16 pm] [PID: 22676] [LOG] [GO-HOME] Visited homepage successfully
[7/1/2024, 10:31:18 pm] [PID: 22676] [LOG] [MAIN-POINTS] Current point count: 3468
[7/1/2024, 10:31:19 pm] [PID: 22676] [LOG] [MAIN-POINTS] You can earn 0 points today
[7/1/2024, 10:31:19 pm] [PID: 22676] [LOG] [MAIN] No points to earn and "runOnZeroPoints" is set to "false", stopping!
[7/1/2024, 10:31:19 pm] [PID: 22676] [LOG] [MAIN-WORKER] Started tasks for account xxxxxxxxxxx@outlook.com
[7/1/2024, 10:31:19 pm] [PID: 22676] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0"
[7/1/2024, 10:31:19 pm] [PID: 22676] [LOG] [MAIN] Starting DESKTOP browser
[7/1/2024, 10:31:37 pm] [PID: 22676] [LOG] [LOGIN] Already logged in
[7/1/2024, 10:31:37 pm] [PID: 22676] [LOG] [LOGIN-BING] Verifying Bing login
[7/1/2024, 10:31:39 pm] [PID: 22676] [LOG] [LOGIN-BING] Bing login verification passed!
[7/1/2024, 10:31:39 pm] [PID: 22676] [LOG] [LOGIN] Logged in successfully
[7/1/2024, 10:31:46 pm] [PID: 22676] [LOG] [GO-HOME] Visited homepage successfully
[7/1/2024, 10:31:47 pm] [PID: 22676] [LOG] [MAIN-POINTS] Current point count: 353
[7/1/2024, 10:31:48 pm] [PID: 22676] [LOG] [MAIN-POINTS] You can earn 0 points today
[7/1/2024, 10:31:48 pm] [PID: 22676] [LOG] [MAIN] No points to earn and "runOnZeroPoints" is set to "false", stopping!
[7/1/2024, 10:31:48 pm] [PID: 22676] [LOG] [MAIN-WORKER] Started tasks for account xxxxxxxxx@outlook.com
[7/1/2024, 10:31:49 pm] [PID: 22676] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0"
[7/1/2024, 10:31:49 pm] [PID: 22676] [LOG] [MAIN] Starting DESKTOP browser

`

GENERATING MOBILE USER AGENT FOR DESKTOP BROWSER

[7/1/2024, 10:48:29 pm] [PID: 22676] [LOG] [MAIN-WORKER] Started tasks for account XXXXXXXXXXX@outlook.com
[7/1/2024, 10:48:29 pm] [PID: 22676] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36 EdgA/120.0.0.0"
[7/1/2024, 10:48:30 pm] [PID: 22676] [LOG] [MAIN] Starting DESKTOP browser
[7/1/2024, 10:49:08 pm] [PID: 22676] [LOG] [LOGIN] Email entered successfully
[7/1/2024, 10:49:12 pm] [PID: 22676] [LOG] [LOGIN] Password entered successfully
[7/1/2024, 10:50:12 pm] [PID: 22676] [LOG] [LOGIN] Logged into Microsoft successfully
TheNetsky commented 9 months ago

Is it actually a mobile UA? Like is the screensize that of a mobile too?

TheNetsky commented 9 months ago

Also the desktop one being the same is normal, pretty sure it's always been that. It's managed by the fingerprint library which works fine, the rest of the fingerprint (audo/video/screensize) is all changing as expected.

TheNetsky commented 9 months ago

Also I cannot replicate it generating a mobile UA on desktop, so not sure about that one. Tried it a dozen times by now.

saurabh9661180 commented 9 months ago

Is it actually a mobile UA? Like is the screensize that of a mobile too?

yes

saurabh9661180 commented 9 months ago

Also the desktop one being the same is normal, pretty sure it's always been that. It's managed by the fingerprint library which works fine, the rest of the fingerprint (audo/video/screensize) is all changing as expected.

yep

saurabh9661180 commented 9 months ago

but on previous version i get new user agent everytime

saurabh9661180 commented 9 months ago

Is it actually a mobile UA? Like is the screensize that of a mobile too?

Screenshot (37)

saurabh9661180 commented 9 months ago
when it uses mobile useragent i get this error-----

[7/1/2024, 11:42:00 pm] [PID: 22492] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36 EdgA/118.0.2088.66"
[7/1/2024, 11:42:01 pm] [PID: 22492] [LOG] [MAIN] Starting DESKTOP browser
[7/1/2024, 11:42:51 pm] [PID: 22492] [LOG] [LOGIN] Email entered successfully
[7/1/2024, 11:42:53 pm] [PID: 22492] [LOG] [LOGIN] Password entered successfully
[7/1/2024, 11:43:05 pm] [PID: 22492] [LOG] [LOGIN] Logged into Microsoft successfully
[7/1/2024, 11:43:05 pm] [PID: 22492] [LOG] [LOGIN-BING] Verifying Bing login
[7/1/2024, 11:43:13 pm] [PID: 22492] [LOG] [LOGIN-BING] Bing login verification passed!
[7/1/2024, 11:43:13 pm] [PID: 22492] [LOG] [LOGIN] Logged in successfully
[7/1/2024, 11:43:27 pm] [PID: 22492] [LOG] [GO-HOME] Visited homepage successfully
[7/1/2024, 11:43:28 pm] [PID: 22492] [LOG] [MAIN-POINTS] Current point count: 125
[7/1/2024, 11:43:30 pm] [PID: 22492] [LOG] [MAIN-POINTS] You can earn 30 points today
[7/1/2024, 11:43:37 pm] [PID: 22492] [LOG] [GO-HOME] Visited homepage successfully
[7/1/2024, 11:43:37 pm] [PID: 22492] [LOG] [DAILY-SET] All Daily Set" items have already been completed
[7/1/2024, 11:43:38 pm] [PID: 22492] [LOG] [PUNCH-CARD] Started solving "Punch Card" items for punchcard: "A fresh start for the new year"
[7/1/2024, 11:44:09 pm] [PID: 22492] [LOG] [ACTIVITY] Found activity type: "UrlReward" title: "Healthy habits start here"
[7/1/2024, 11:44:09 pm] [PID: 22492] [LOG] [URL-REWARD] Trying to complete UrlReward
[7/1/2024, 11:44:09 pm] [PID: 22492] [LOG] [URL-REWARD] Completed the UrlReward successfully
[7/1/2024, 11:44:30 pm] [PID: 22492] [LOG] [ACTIVITY] Found activity type: "UrlReward" title: "Need home decor inspiration for the new year?"
[7/1/2024, 11:44:30 pm] [PID: 22492] [LOG] [URL-REWARD] Trying to complete UrlReward
[7/1/2024, 11:44:30 pm] [PID: 22492] [LOG] [URL-REWARD] Completed the UrlReward successfully
[7/1/2024, 11:44:33 pm] [PID: 22492] [ERROR] [GET-NEW-TAB] Unable to get latest tab
[7/1/2024, 11:44:33 pm] [PID: 22492] [ERROR] [GET-NEW-TAB] An error occurred:undefined
[7/1/2024, 11:44:33 pm] [PID: 22492] [ERROR] [ACTIVITY] An error occurred:undefined
[7/1/2024, 11:44:33 pm] [PID: 22492] [ERROR] [GET-NEW-TAB] Unable to get latest tab
[7/1/2024, 11:44:33 pm] [PID: 22492] [ERROR] [GET-NEW-TAB] An error occurred:undefined
[7/1/2024, 11:44:33 pm] [PID: 22492] [ERROR] [ACTIVITY] An error occurred:undefined
[7/1/2024, 11:44:34 pm] [PID: 22492] [ERROR] [GET-NEW-TAB] Unable to get latest tab
[7/1/2024, 11:44:34 pm] [PID: 22492] [ERROR] [GET-NEW-TAB] An error occurred:undefined
[7/1/2024, 11:44:34 pm] [PID: 22492] [ERROR] [ACTIVITY] An error occurred:undefined
[7/1/2024, 11:44:34 pm] [PID: 22492] [ERROR] [GET-NEW-TAB] Unable to get latest tab
[7/1/2024, 11:44:34 pm] [PID: 22492] [ERROR] [GET-NEW-TAB] An error occurred:undefined
node:internal/process/promises:288
            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'
}
saurabh9661180 commented 9 months ago

Feature request-------------- please give an option in confing file if possible -----------

  1. skip locked accounts and continue
  2. skip suspended accounts and continue

3.(if possible) start the bot where we left off

TheNetsky commented 9 months ago

I have no have plans on adding those features, feel free to fork and add these.

Gigafrost commented 9 months ago

Can confirm that I've gotten the user agent error as well. Mine still seems to collect points on occasion.

[1/8/2024, 9:45:03 AM] [PID: 21828] [LOG] [MAIN] Unable to complete mobile searches, bad User-Agent? Retrying... [1/8/2024, 9:45:03 AM] [PID: 21828] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Linux; Android 11; M2012K10C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36 EdgA/108.0.1462.54" [1/8/2024, 9:45:03 AM] [PID: 21828] [LOG] [MAIN] Starting MOBILE browser [1/8/2024, 9:45:06 AM] [PID: 21828] [LOG] [LOGIN] Already logged in [1/8/2024, 9:45:06 AM] [PID: 21828] [LOG] [LOGIN-BING] Verifying Bing login [1/8/2024, 9:45:12 AM] [PID: 21828] [LOG] [LOGIN-BING] Bing login verification passed! [1/8/2024, 9:45:12 AM] [PID: 21828] [LOG] [LOGIN] Logged in successfully [1/8/2024, 9:45:20 AM] [PID: 21828] [LOG] [GO-HOME] Visited homepage successfully [1/8/2024, 9:45:28 AM] [PID: 21828] [LOG] [GO-HOME] Visited homepage successfully [1/8/2024, 9:45:28 AM] [PID: 21828] [LOG] [SEARCH-BING] Starting bing searches [1/8/2024, 9:45:30 AM] [PID: 21828] [LOG] [SEARCH-GOOGLE-TRENDS] Generating search queries, can take a while! | GeoLocale: US [1/8/2024, 9:45:32 AM] [PID: 21828] [LOG] [SEARCH-BING] 80 Points Remaining | Query: cleveland browns | Mobile: true [1/8/2024, 9:45:57 AM] [PID: 21828] [LOG] [SEARCH-BING] 80 Points Remaining | Query: halle bailey | Mobile: true [1/8/2024, 9:46:20 AM] [PID: 21828] [LOG] [SEARCH-BING] 80 Points Remaining | Query: night swim | Mobile: true [1/8/2024, 9:46:50 AM] [PID: 21828] [LOG] [SEARCH-BING] 80 Points Remaining | Query: harrison bader | Mobile: true [1/8/2024, 9:47:22 AM] [PID: 21828] [WARN] [SEARCH-BING-MOBILE] Search didn't gain point for 3 iterations, likely bad User-Agent [1/8/2024, 9:47:24 AM] [PID: 21828] [LOG] [MAIN] Unable to complete mobile searches, bad User-Agent? Retrying... [1/8/2024, 9:47:24 AM] [PID: 21828] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Mobile Safari/537.36 EdgA/115.0.1901.183" [1/8/2024, 9:47:24 AM] [PID: 21828] [LOG] [MAIN] Starting MOBILE browser [1/8/2024, 9:47:26 AM] [PID: 21828] [LOG] [LOGIN] Already logged in [1/8/2024, 9:47:26 AM] [PID: 21828] [LOG] [LOGIN-BING] Verifying Bing login [1/8/2024, 9:47:32 AM] [PID: 21828] [LOG] [LOGIN-BING] Bing login verification passed! [1/8/2024, 9:47:32 AM] [PID: 21828] [LOG] [LOGIN] Logged in successfully [1/8/2024, 9:47:40 AM] [PID: 21828] [LOG] [GO-HOME] Visited homepage successfully [1/8/2024, 9:47:49 AM] [PID: 21828] [LOG] [GO-HOME] Visited homepage successfully [1/8/2024, 9:47:49 AM] [PID: 21828] [LOG] [SEARCH-BING] Starting bing searches [1/8/2024, 9:47:51 AM] [PID: 21828] [LOG] [SEARCH-GOOGLE-TRENDS] Generating search queries, can take a while! | GeoLocale: US [1/8/2024, 9:47:52 AM] [PID: 21828] [LOG] [SEARCH-BING] 80 Points Remaining | Query: las vegas judge attacked | Mobile: true [1/8/2024, 9:48:25 AM] [PID: 21828] [LOG] [SEARCH-BING] 80 Points Remaining | Query: dalvin cook | Mobile: true [1/8/2024, 9:48:50 AM] [PID: 21828] [LOG] [SEARCH-BING] 80 Points Remaining | Query: aliens in miami | Mobile: true [1/8/2024, 9:49:17 AM] [PID: 21828] [LOG] [SEARCH-BING] 80 Points Remaining | Query: robbie ray | Mobile: true [1/8/2024, 9:49:46 AM] [PID: 21828] [WARN] [SEARCH-BING-MOBILE] Search didn't gain point for 3 iterations, likely bad User-Agent [1/8/2024, 9:49:47 AM] [PID: 21828] [LOG] [MAIN] Unable to complete mobile searches, bad User-Agent? Retrying... [1/8/2024, 9:49:48 AM] [PID: 21828] [LOG] [BROWSER] Created browser with User-Agent: "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36 EdgA/118.0.2088.66" [1/8/2024, 9:49:48 AM] [PID: 21828] [LOG] [MAIN] Starting MOBILE browser [1/8/2024, 9:49:50 AM] [PID: 21828] [LOG] [LOGIN] Already logged in [1/8/2024, 9:49:50 AM] [PID: 21828] [LOG] [LOGIN-BING] Verifying Bing login [1/8/2024, 9:49:56 AM] [PID: 21828] [LOG] [LOGIN-BING] Bing login verification passed! [1/8/2024, 9:49:56 AM] [PID: 21828] [LOG] [LOGIN] Logged in successfully [1/8/2024, 9:50:04 AM] [PID: 21828] [LOG] [GO-HOME] Visited homepage successfully [1/8/2024, 9:50:12 AM] [PID: 21828] [LOG] [GO-HOME] Visited homepage successfully [1/8/2024, 9:50:12 AM] [PID: 21828] [LOG] [SEARCH-BING] Starting bing searches [1/8/2024, 9:50:14 AM] [PID: 21828] [LOG] [SEARCH-GOOGLE-TRENDS] Generating search queries, can take a while! | GeoLocale: US

Is there a way to switch user agents or have multiple user agents for it to try? Sorry if this solution exists, I did some digging on the topic but haven't found a way to do it.

TheNetsky commented 9 months ago

What? Your error is not the same as the user mentioned, it seems to be generating Mobile user agents as it should? Also are you on 1.4.0?

TheNetsky commented 9 months ago

If you don't have the same issue as the person, make your own GH issue.

Gigafrost commented 9 months ago

If you don't have the same issue as the person, make your own GH issue.

Yup I'm on 1.4.0

Okay perfect. I didn't know if it was worth making a new issue or not but if everything is running as it should I'll leave it at that! Thanks

saurabh9661180 commented 9 months ago

Is it actually a mobile UA? Like is the screensize that of a mobile too?

i think it only happening with level 1 account and i have only 1 lvl 2 account so i cant confirm but lvl 2 account always launch with big size actual desktop browser.

TheNetsky commented 9 months ago

Level cannot be related to this. It has nothing to do with it.

Try reinstalling, I cannot replicate the issue.

saurabh9661180 commented 9 months ago

is my session working fine ? only 120kb sometime some account again ask for password and after manually entering password bot didnt do anything i have to restart

saurabh9661180 commented 9 months ago

Level cannot be related to this. It has nothing to do with it.

Try reinstalling, I cannot replicate the issue.

ok sir