Advertisement
Guest User

Untitled

a guest
Aug 6th, 2016
2,375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.76 KB | None | 0 0
  1. diff --git a/pogom/search.py b/pogom/search.py
  2. index ceb63c8..dd71126 100644
  3. --- a/pogom/search.py
  4. +++ b/pogom/search.py
  5. @@ -28,6 +28,7 @@ from queue import Queue, Empty
  6.  from pgoapi import PGoApi
  7.  from pgoapi.utilities import f2i
  8.  from pgoapi import utilities as util
  9. +from pgoapi.exceptions import AuthException
  10.  
  11.  from . import config
  12.  from .models import parse_map
  13. @@ -254,14 +255,20 @@ def check_login(args, account, api, position):
  14.  
  15.      # Try to login (a few times, but don't get stuck here)
  16.      i = 0
  17. -    while not api.login(account['auth_service'], account['username'], account['password'], position[0], position[1], position[2], False):
  18. -        if i >= args.login_retries:
  19. -            raise TooManyLoginAttempts('Exceeded login attempts')
  20. -        else:
  21. -            i += 1
  22. -            log.error('Failed to login to Pokemon Go with account %s. Trying again in %g seconds', account['username'], args.login_delay)
  23. -            time.sleep(args.login_delay)
  24. -
  25. +    api.set_position(position[0], position[1], position[2])
  26. +    while i < args.login_retries:
  27. +        try:
  28. +            api.set_authentication(provider = account['auth_service'], username = account['username'], password = account['password'])
  29. +            break
  30. +        except AuthException:
  31. +            if i >= args.login_retries:
  32. +                raise TooManyLoginAttempts('Exceeded login attempts')
  33. +            else:
  34. +                i += 1
  35. +                log.error('Failed to login to Pokemon Go with account %s. Trying again in %g seconds', account['username'], args.login_delay)
  36. +                time.sleep(args.login_delay)
  37. +
  38. +    api.activate_signature("encrypt.dll")
  39.      log.debug('Login for account %s successful', account['username'])
  40.  
  41.  def map_request(api, position):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement