Blizzard / s2client-proto

StarCraft II Client - protocol definitions used to communicate with StarCraft II.
MIT License
3.76k stars 430 forks source link

The new developers portal #119

Open miguelgondu opened 5 years ago

miguelgondu commented 5 years ago

I tried to download replays using the replay API that's being offered but it seems that, because of recent changes in Blizzard's developer portal, it's broken.

More specifically, I got the following error while trying to download replays from version 4.2.1 of SC2:

Traceback (most recent call last):
  File "download_replays.py", line 124, in <module>
    main()
  File "download_replays.py", line 84, in main
    download_base_url = api.get_base_url()
  File "download_replays.py", line 46, in get_base_url
    return self.get(self.url("/data/sc2/archive_url/base_url"))["base_url"]
KeyError: 'base_url'
chauvinfish commented 5 years ago

i have the same problem `C:\Users\Administrator.PC-201809082344\AppData\Local\conda\conda\envs\tensorflow\python.exe C:/Users/Administrator.PC-201809082344/Desktop/s2client-proto-master/samples/replay-api/download_replays.py --key=26e573f7a49c46a1b1b9aa55976bbaf --secret=18MQJaxcMnzy8SaVK08BqGXrkU2y79RL --version=69232 --replays_dir=c:// Traceback (most recent call last): File "C:/Users/Administrator.PC-201809082344/Desktop/s2client-proto-master/samples/replay-api/download_replays.py", line 125, in main() File "C:/Users/Administrator.PC-201809082344/Desktop/s2client-proto-master/samples/replay-api/download_replays.py", line 85, in main download_base_url = api.get_base_url() File "C:/Users/Administrator.PC-201809082344/Desktop/s2client-proto-master/samples/replay-api/download_replays.py", line 46, in get_base_url return self.get(self.url("/data/sc2/archive_url/base_url"))["base_url"] KeyError: 'base_url'

Process finished with exit code 1 `

jonhoye commented 5 years ago

I changed: API_BASE_URL = 'https://us.api.battle.net' to: API_BASE_URL = 'https://us.api.blizzard.com'

And it seems to be working now.

Also, be careful about posting your secrets!

pedronahum commented 5 years ago

Hi, In addition to replacing the URL as mentioned by @BobOfAtlantis, please replace --version=69232 to --version="4.6.2". That worked for me.

Best,