Compare commits

..

5 Commits

Author SHA1 Message Date
Sergio Álvarez d66c3a6075 remaining idexes 2021-05-14 00:47:03 +02:00
Sergio Álvarez acd9ae504b new apis, classic 2021-05-14 00:34:44 +02:00
Sergio Álvarez 14190bea74 updated codebase 2021-05-14 00:34:22 +02:00
Sergio Álvarez ab54e91bad new structure, better code 2021-05-14 00:33:52 +02:00
Sergio Álvarez 1bae11f389 rename 2021-05-14 00:33:20 +02:00
261 changed files with 349 additions and 72 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.credentials .credentials
/__pycache__/

13
blizzard.py Normal file
View File

@ -0,0 +1,13 @@
import os
from typing import Tuple
def get_api_host(region: str) -> str:
return f"https://{region}.api.blizzard.com" if region != 'cn' else 'https://gateway.battlenet.com.cn'
def get_bnet_host(region: str) -> str:
region = region if region not in ['tw', 'kr'] else 'apac'
return f"https://{region}.battle.net" if region != 'cn' else 'https://www.battlenet.com.cn'
def get_credentials(path: str) -> Tuple[str, str]:
return tuple(open(os.path.join(path, '.credentials')).read().strip().split(':'))

9
config.py Normal file
View File

@ -0,0 +1,9 @@
import os
# pwd
pwd = os.path.dirname(os.path.realpath(__file__))
# raw json files
raw = os.path.join(pwd, 'raw')
# crafted jsons
craft = os.path.join(pwd, 'craft')

Some files were not shown because too many files have changed in this diff Show More