stefan2200 / TWB

Python based bot for Tribal Wars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Obtain Cookie automatically?

Legion-81 opened this issue · comments

I am wondering if I can obtain the cookie automatically once it expires. Will make a pull request when its done and implemented. This bot works very well.

I am wondering if I can obtain the cookie automatically once it expires. Will make a pull request when its done and implemented. This bot works very well.

I tried it out, but it doesn't work unfortunately.

yes it 100% possible in python and selenium to get it. Write a separate function and go....mine works but not sure i am going to share it here... :D even bot detection from the site can be bypassed or overcome....

yes it 100% possible in python and selenium to get it. Write a separate function and go....mine works but not sure i am going to share it here... :D even bot detection from the site can be bypassed or overcome....

Oh okay. But does it still enable playing simultaneously over the browser? Because AFAIK Selenium opens another session of the game with the driver and not the usual browser so that if you login on your browser, the session opened with Selenium automatically expires. That was at least the outcome of my effort to extract the cookie string with python.

you are correct that would mean you cannot use the bot in the browser because it void the current cookie. However i dont need really do anything while I sleep so I can let it do its thing. When I am awake I play the game and then reload the bot.

I've ran the bot in a different setup for while since selenium also allows a physical browser window (even one which you can control remotely). Not sure if that helps since many servers actively scan for features that headless browsers don't implement. You'll probably get a lot more captchas when using a headless browser unfortunately

hm yea i did think about that headless option but my way is to open a browser window with selenium no headless login via credentials and obtain cookie and just close browser again. Enter the cookie into bot variable and go. Of course this way you cannot use the game in the browser unless you copy over the bot cookie to your browser. I let this run on 4 proxy IP and AWS instance lmao works well no ban....modified some stuff here and there. @stefan2200 kudos to your effort. Thank you very much!!

May be able to run an android emulator and just play it that way. I am pretty sure the cookie used for mobile differs and does not clear the browser cookie on pc even if logged in on mobile. Or just play it on mobile lmao

@Legion-81 Would you mind sharing the code with me with which you achieved to extract the cookie with selenium etc.?

commented

Guys, I think you should use a fork of selenium, https://github.com/ultrafunkamsterdam/undetected-chromedriver just for safety

This feature was implemented in a different branch using the undetected-chromedriver Branch for undetected chromedriver