LjMario007 / Microsoft-Rewards-Bot

Microsoft Rewards (Bing Rewards) Bot - automated selenium python bot
19 stars 9 forks source link

NEW BOT? #74

Open HQModz opened 3 years ago

HQModz commented 3 years ago

Can anyone share a new working bot please? Thanks 👍

AnthonyZJiang commented 3 years ago

Is this not working? But I am working on refactoring the code, adding support for automated 2FA and support for punch cards. You can track the dev branch

AnthonyZJiang commented 3 years ago

Fixed a few bugs, used for a 2 weeks, it seems stable enough for me. It is out on master branch

charettepa commented 3 years ago

@tmxkn1 using master branch as of today some quizes run but then fails, non gracefully and terminates instead of moving on to next quiz or other accounts

tried building my own container as well as the one built by mukowman today mukowman/microsoft-rewards-bot

if i alter the startup script to run only --headless --pc --mobile it works but as soon as i add --quiz it fails after a few can provide log if you wish

AnthonyZJiang commented 3 years ago

@tmxkn1 using master branch as of today some quizes run but then fails, non gracefully and terminates instead of moving on to next quiz or other accounts

tried building my own container as well as the one built by mukowman today mukowman/microsoft-rewards-bot

if i alter the startup script to run only --headless --pc --mobile it works but as soon as i add --quiz it fails after a few can provide log if you wish

By container, you mean the Docker stuff? Unfortunately, it is quite new to me and I need time to learn it. I'm currently busy with my day work and some other project. I'm not sure whether I would have time to look at it until September.

charettepa commented 3 years ago

@tmxkn1 using master branch as of today some quizes run but then fails, non gracefully and terminates instead of moving on to next quiz or other accounts tried building my own container as well as the one built by mukowman today mukowman/microsoft-rewards-bot if i alter the startup script to run only --headless --pc --mobile it works but as soon as i add --quiz it fails after a few can provide log if you wish

By container, you mean the Docker stuff? Unfortunately, it is quite new to me and I need time to learn it. I'm currently busy with my day work and some other project. I'm not sure whether I would have time to look at it until September.

yes i do mean a docker container, the container is debian based, being the official one put out for python 3.9 and expanded upon. i am in the process of making a VM and trying from there as i think i will have the same issue. as it always appears to crash on the same quiz/punch card. previous version would sometimes get errors but continue to the next item. in this version it quotes several lines then stops as if it finished and dosent even go on to the next person. once i have the full blown VM built with the components, ill report back.

AnthonyZJiang commented 3 years ago

yes i do mean a docker container, the container is debian based, being the official one put out for python 3.9 and expanded upon. i am in the process of making a VM and trying from there as i think i will have the same issue. as it always appears to crash on the same quiz/punch card. previous version would sometimes get errors but continue to the next item. in this version it quotes several lines then stops as if it finished and dosent even go on to the next person. once i have the full blown VM built with the components, ill report back.

Thanks a lot. I will look forward to your results.

charettepa commented 3 years ago

yes i do mean a docker container, the container is debian based, being the official one put out for python 3.9 and expanded upon. i am in the process of making a VM and trying from there as i think i will have the same issue. as it always appears to crash on the same quiz/punch card. previous version would sometimes get errors but continue to the next item. in this version it quotes several lines then stops as if it finished and dosent even go on to the next person. once i have the full blown VM built with the components, ill report back.

Thanks a lot. I will look forward to your results.

on a fresh install of Debian full VM installed all dependencies/requirements

get the exact same error as in the container

it gets an error on a click quiz, then quotes multiple lines, and instead of moving on to the next item like it used to it just drops to the end as if it finished succesfully and also skips other accounts

would you like to see the log? can i post it here?

coollbv commented 3 years ago

@tmxkn1 I have also started using your branch - the daily quizzes mostly work unless it is the the click.py. That one never goes through it doesn't seem to recognize it with the wk_circle...

AnthonyZJiang commented 3 years ago

@charettepa @coollbv Hi, please share your logs. It will certainly be useful.

N3CRO88 commented 3 years ago

Hi!Trying to use your bot,but itsn't working :( Bot logined succesfully,opened rewards page and then closing or freezing.Tried to run only --pc --mobile,same result. In past I used another bot (https://passivebot.medium.com/microsoft-bing-rewards-rewards-bot),and it is not working now too,from 1st September.It is stacking on rewards page,made searches and then closing. Maybe microsoft changed something on rewards page,maybe you have take a look and fix this?Thanks

AnthonyZJiang commented 3 years ago

@N3CRO88 It worked fine on my pc and in my region (UK). However, it is known that the layout of MSR webpage isn't necessarily the same across different countries and it may get updated to a newer version at different time. Unless you share the log, I won't be able to help you.

ashaji1 commented 3 years ago

@tmxkn1 hi region (UK) you guys have "click quiz" in punch card? but we have. i try to send self._dashboard_worker to self._dashboard_worker.do_punch_card like this

def do_punch_card(self, links):
        logging.info(msg=f'do_punch_card Total links: {len(links)} links: {links}')
        for link in links:
            try:
                self._dashboard_worker.do_punch_card(link, self._dashboard_worker)
                # self._dashboard_worker.do_punch_card(link)
                # self._browser.goto_main_window()
            except Exception as exc: logging.error(msg=f'do_punch_card Error msg: {exc}', exc_info=True)

and in class MSRPunchCard

def do_punch_card(self, link, _dashboard_worker, max_attempts=1):
        self._punchcard_worker = _dashboard_worker

and use in def _click_through_punch_card

self._browser.goto_latest_window()
logging.info(msg='_click_through_punch_card.')
if not self._punchcard_worker.do_quiz():
    logging.info(msg='do_quiz.')
    self._punchcard_worker.do_link_quest()

now it does click quiz but at the end it give Error as selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id so my question is how can i pass self._dashboard_worker to class MSRPunchCard and have the same browser instance? Or mi doing it right since class MSRPunchCard is part of class MSRDashboardWorker? thanks for any help.

AnthonyZJiang commented 3 years ago

@tmxkn1 hi region (UK) you guys have "click quiz" in punch card? but we have. i try to send self._dashboard_worker to self._dashboard_worker.do_punch_card like this

def do_punch_card(self, links):
        logging.info(msg=f'do_punch_card Total links: {len(links)} links: {links}')
        for link in links:
            try:
                self._dashboard_worker.do_punch_card(link, self._dashboard_worker)
                # self._dashboard_worker.do_punch_card(link)
                # self._browser.goto_main_window()
            except Exception as exc: logging.error(msg=f'do_punch_card Error msg: {exc}', exc_info=True)

and in class MSRPunchCard

def do_punch_card(self, link, _dashboard_worker, max_attempts=1):
        self._punchcard_worker = _dashboard_worker

and use in def _click_through_punch_card

self._browser.goto_latest_window()
logging.info(msg='_click_through_punch_card.')
if not self._punchcard_worker.do_quiz():
    logging.info(msg='do_quiz.')
    self._punchcard_worker.do_link_quest()

now it does click quiz but at the end it give Error as selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id so my question is how can i pass self._dashboard_worker to class MSRPunchCard and have the same browser instance? Or mi doing it right since class MSRPunchCard is part of class MSRDashboardWorker? thanks for any help.

We don't have click quiz in punchcard in the UK unfortunately.

You are not supposed to pass MSRDashboardWorker to MSRPunchCard.do_punch_card, because MSRDashboardWorker inherits MSRPunchCard. The best way to do this is probably to add a function in MSRDashboardWorker then integrate quiz and punchcard functions.

I also just realised how many do_punch_card I have in the code. It is very confusing - clearly more refactorisation is needed hehe.

coollbv commented 3 years ago

Hopefully this helps to further improve the script - just tried 2.1.0

2021-09-22 16:19:47,480 :: INFO :: root :: ----------Work started----------- 2021-09-22 16:19:54,099 :: INFO :: root :: Number of open offers: 8 2021-09-22 16:19:59,566 :: INFO :: root :: Link Quest completed 2021-09-22 16:20:05,117 :: INFO :: root :: Lightning Quiz identified. 2021-09-22 16:20:18,317 :: INFO :: root :: Lightning Quiz completed. 2021-09-22 16:20:23,594 :: INFO :: root :: Lightning Quiz identified. 2021-09-22 16:20:32,210 :: INFO :: root :: Lightning Quiz completed. 2021-09-22 16:20:37,686 :: INFO :: root :: Link Quest completed 2021-09-22 16:20:43,015 :: INFO :: root :: Lightning Quiz identified. 2021-09-22 16:21:26,920 :: INFO :: root :: Lightning Quiz completed. 2021-09-22 16:21:32,156 :: INFO :: root :: Click Quiz identified. 2021-09-22 16:21:33,215 :: ERROR :: root :: An error has occurred. Traceback (most recent call last): File "C:\bing3\ms_rewards.py", line 113, in msr.work(flag_pc=parser.pc_mode, flag_mob=parser.mobile_mode, File "C:\bing3\msreward\msr.py", line 53, in work self._work(flag_pc, flag_mob, flag_quiz) File "C:\bing3\msreward\msr.py", line 60, in _work self.worker.do_dashboard(summary) File "C:\bing3\msreward\worker\worker.py", line 22, in do_dashboard self._dashboard.do_dashboard() File "C:\bing3\msreward\worker\dashboard\dashboard.py", line 35, in do_dashboard self._do_offer(link) File "C:\bing3\msreward\worker\dashboard\dashboard.py", line 53, in _do_offer if not self._dashboard_worker.do_quiz(): File "C:\bing3\msreward\worker\dashboard\quiz\quiz.py", line 22, in do_quiz if self.click_quiz.do(): File "C:\bing3\msreward\worker\dashboard\quiz\quizbase.py", line 17, in do self._do_quiz() File "C:\bing3\msreward\worker\dashboard\quiz\click.py", line 21, in _do_quiz random.choice(choices).click() File "C:\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click self._execute(Command.CLICK_ELEMENT) File "C:\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute return self._parent.execute(command, params) File "C:\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element ... is not clickable at point (145, 487). Other element would receive the click: Card Image (Session info: headless chrome=93.0.4577.82) (Driver info: chromedriver=93.0.4577.63 (ff5c0da2ec0adeaed5550e6c7e98417dac77d98a-refs/branch-heads/4577@{#1135}),platform=Windows NT 10.0.19043 x86_64)

HQModz commented 3 years ago

@tmxkn1 thank you for keeping this alive! Any chance on fixing the errors with the quizzes? It seems to get stuck and skip a lot of them.

AnthonyZJiang commented 3 years ago

@tmxkn1 thank you for keeping this alive! Any chance on fixing the errors with the quizzes? It seems to get stuck and skip a lot of them.

No problem. UK quizzes seem to be fine. You can try removing -headless argument and see if anything improves.