svartalf / python-wargaming

Pure-pythonic client library for Wargaming API
https://wargaming.net/developers/
MIT License
27 stars 14 forks source link

Invalid API endpoint for NA region #12

Closed reven86 closed 8 years ago

reven86 commented 8 years ago

Choosing NA region leads to calls to https://api.worldoftanks.na instead of https://api.worldoftanks.com

wot = wargaming.WoT('demo', region='na', language='ru')
redirect_to = wot.auth.login(nofollow=1, redirect_uri='...')['location']
ConnectionError: DNS lookup failed for URL: https://api.worldoftanks.na/wot/auth/login/?redirect_uri=

EDIT: A quick fix would be to patch region_url function and make a special case for NA region. I can open a pull request if it's an appropriate solution.

monester commented 8 years ago

Hi, yeah. Such substitution works for all regions except na. Fixed and published update on pypi.