modrzew / pokeminer

Pokemon location scraper
MIT License
220 stars 62 forks source link

Check banned accounts #244

Closed fxbt closed 8 years ago

fxbt commented 8 years ago

Raise an exception if the account is banned.

Credits: @amistad18

fxbt commented 8 years ago

@amistad18 If you want to make this pull request yourself, please let me know.

amistad18 commented 8 years ago

@fxbt don't bother yourself, I don't need to be credited for that, I just shared some code that helped me to figure out which accounts were banned, and I'm glad if community will benefit on that. Anyway, not sure if this is the right way to implement it, but it works for now :)

subzerofun commented 8 years ago

@fxbt @amistad18 since the worker.py code for the the coroutines branch differs a lot from the master, would it be hard to adapt? could you maybe (when you have time) also write the code for new coroutines worker.py script?

crhbetz commented 8 years ago

So let's say I have 10 accounts in my config.py, but only use 5 workers at a time. Would it be possible to implement that a worker that encounters a banned account goes down the account list to find an unbanned one?

Aiyubi commented 8 years ago

did try and test this: This disables workers for me that do work fine (random status 3 inbetween) Sadly none of my 300 accounts got banned so far (mining since day 1 basically) so I can not test.

amistad18 commented 8 years ago

@Aiyubi I've got ~100 accounts banned, and only one of them had false status 3 response - once, but I still have those credentials and will check in few days if those were permabans for sure. But anyway, maybe we should add investigate tag to this before merge, or set sleep time to few-several minutes, and only after few restarts with the same response, set self.running = False

modrzew commented 8 years ago

After seeing what @Aiyubi wrote above, I think sleeping for some time (1 minute?) should be enough. If status 3 was intermittent, it will sleep for a bit and restart later. And if it's permanent, then it won't attack server that much. So self.restart() should be used instead of return.

modrzew commented 8 years ago

Thanks!