3 Commits
Author SHA1 Message Date
Jylpah d275914b32 Update .gitignore 2022-08-18 09:44:39 +03:00
Jylpah 9f8c82f434 Stream client support 2022-08-18 09:42:55 +03:00
Jylpah 3a8f065f35 Update 9.2 2022-08-18 09:42:32 +03:00
3 changed files with 157 additions and 9 deletions

No files matched your search

Executable
+15
View File
@@ -0,0 +1,15 @@
__pycache__/
BlitzApp
tmp/
ssl/
*.ini
*.swp
*.code-workspace
*.sqlite3
.vscode/
*.sqlite3-journal
.gitattributes
export*
*.csv
!/stats/*.csv
!*.py
+12 -6
View File
@@ -3,6 +3,7 @@
# Extract tankopedia data in WG API JSON format from Blitz app files (Android APK unzipped)
from os import path
import sys, argparse, json, os, inspect, aiohttp, asyncio, aiofiles, re, logging, time, xmltodict, collections, configparser
import blitzutils as bu
from blitzutils import WG
@@ -11,9 +12,11 @@ logging.getLogger("asyncio").setLevel(logging.DEBUG)
FILE_CONFIG = 'blitzstats.ini'
BLITZAPP_STRINGS='/assets/Data/Strings/en.yaml'
BLITZAPP_VEHICLES_DIR='/assets/Data/XML/item_defs/vehicles/'
BLITZAPP_VEHICLE_FILE='/list.xml'
# BLITZAPP_STRINGS='/assets/Data/Strings/en.yaml'
# BLITZAPP_VEHICLES_DIR='/assets/Data/XML/item_defs/vehicles/'
BLITZAPP_STRINGS='Data/Strings/en.yaml'
BLITZAPP_VEHICLES_DIR='Data/XML/item_defs/vehicles/'
BLITZAPP_VEHICLE_FILE='list.xml'
wg = None
@@ -104,8 +107,11 @@ async def main(argv):
async def extract_tanks(blitz_app_base : str, nation: str):
tanks = []
list_xml_file = blitz_app_base + BLITZAPP_VEHICLES_DIR + nation + BLITZAPP_VEHICLE_FILE
if not os.path.isfile(list_xml_file):
# WG has changed the location of Data directory - at least in steam client
if path.isdir(path.join(blitz_app_base, 'assets')):
blitz_app_base = path.join(blitz_app_base, 'assets')
list_xml_file = path.join(blitz_app_base, BLITZAPP_VEHICLES_DIR ,nation ,BLITZAPP_VEHICLE_FILE)
if not path.isfile(list_xml_file):
print('ERROR: cannot open ' + list_xml_file)
return None
bu.debug('Opening file: ' + list_xml_file + ' (Nation: ' + nation + ')')
@@ -132,7 +138,7 @@ async def read_user_strs(blitz_app_base : str) -> dict:
"""Read user strings to convert map and tank names"""
tank_strs = {}
map_strs = {}
filename = blitz_app_base + BLITZAPP_STRINGS
filename = path.join(blitz_app_base, BLITZAPP_STRINGS)
bu.debug('Opening file: ' + filename + ' for reading UserStrings')
try:
async with aiofiles.open(filename, 'r', encoding="utf8") as f:
+130 -3
View File
@@ -1,7 +1,7 @@
{
"status": "ok",
"meta": {
"count": 550
"count": 559
},
"data": {
"1": {
@@ -2188,6 +2188,14 @@
"tier": 6,
"type": "AT-SPG"
},
"9841": {
"is_premium": true,
"name": "Rover",
"nation": "other",
"tank_id": 9841,
"tier": 6,
"type": "lightTank"
},
"9857": {
"is_premium": true,
"name": "Škoda T 45",
@@ -2268,6 +2276,14 @@
"tier": 4,
"type": "AT-SPG"
},
"10369": {
"is_premium": true,
"name": "Controcarro 3 Minotauro",
"nation": "european",
"tank_id": 10369,
"tier": 10,
"type": "AT-SPG"
},
"10497": {
"is_premium": false,
"name": "KV-2",
@@ -2436,6 +2452,14 @@
"tier": 7,
"type": "mediumTank"
},
"11905": {
"is_premium": true,
"name": "Shadowhunter",
"nation": "european",
"tank_id": 11905,
"tier": 6,
"type": "mediumTank"
},
"12033": {
"is_premium": false,
"name": "SU-122-54",
@@ -3404,6 +3428,14 @@
"tier": 6,
"type": "heavyTank"
},
"22097": {
"is_premium": true,
"name": "Churchill VIII",
"nation": "uk",
"tank_id": 22097,
"tier": 6,
"type": "heavyTank"
},
"22273": {
"is_premium": true,
"name": "Object 260",
@@ -3676,6 +3708,14 @@
"tier": 8,
"type": "mediumTank"
},
"25361": {
"is_premium": true,
"name": "Waffenträger Camelot",
"nation": "germany",
"tank_id": 25361,
"tier": 9,
"type": "AT-SPG"
},
"25377": {
"is_premium": true,
"name": "T77",
@@ -3684,6 +3724,22 @@
"tier": 8,
"type": "heavyTank"
},
"25601": {
"is_premium": true,
"name": "IS-2 shielded",
"nation": "ussr",
"tank_id": 25601,
"tier": 7,
"type": "heavyTank"
},
"25633": {
"is_premium": true,
"name": "M-IV-Y",
"nation": "usa",
"tank_id": 25633,
"tier": 8,
"type": "heavyTank"
},
"25889": {
"is_premium": true,
"name": "Ranger",
@@ -3700,6 +3756,22 @@
"tier": 5,
"type": "mediumTank"
},
"26401": {
"is_premium": true,
"name": "Enforcer",
"nation": "usa",
"tank_id": 26401,
"tier": 6,
"type": "AT-SPG"
},
"26657": {
"is_premium": true,
"name": "ASTRON Rex 105 mm",
"nation": "usa",
"tank_id": 26657,
"tier": 8,
"type": "mediumTank"
},
"51201": {
"is_premium": true,
"name": "KV-220 Beta-Test",
@@ -4470,6 +4542,12 @@
"A132_T77_Custom": "T77 Cannonball",
"A132_T77_Custom_short": "T77 Cannonball",
"A132_T77_short": "T77",
"A140_ASTRON_REX_105": "ASTRON Rex 105 mm",
"A140_ASTRON_REX_105_short": "ASTRON Rex",
"A141_M-4-Y": "M-IV-Y",
"A141_M-4-Y_Custom": "M-IV-Y Stalker",
"A141_M-4-Y_Custom_short": "M-IV-Y Stalker",
"A141_M-4-Y_short": "M-IV-Y",
"A68_T28D": "T28 Defender",
"A68_T28D_short": "T28 Defender",
"A77_T6M": "T6E1 Grizzly",
@@ -4602,6 +4680,8 @@
"Bison_I_short": "Bison",
"Buick_series_60": "Buick Series 60",
"CH38_WZ113G-FT": "WZ-113G FT",
"CH38_WZ113G-FT_Custom_short_v2": "WZ-113G FT Cute Baby",
"CH38_WZ113G-FT_Custom_v2": "WZ-113G FT Cute Baby",
"CH38_WZ113G-FT_short": "WZ-113G FT",
"CH38_WZ113G_FT_Custom": "WZ-113G FT Lucky",
"CH38_WZ113G_FT_Custom_short": "WZ-113G FT Lucky",
@@ -4696,6 +4776,10 @@
"Ch_WZ-112v2_short": "WZ-112-2",
"Ch_WZ_112v2_Custom": "WZ-112-2 Celestial",
"Ch_WZ_112v2_Custom_short": "WZ-112-2 Celestial",
"Chassis1_A140_ASTRON_REX_105": "Rex",
"Chassis1_A140_ASTRON_REX_105_short": "Rex",
"Chassis1_It10_P43_bis_BP": "Shadowhunter",
"Chassis1_It10_P43_bis_BP_short": "Shadowhunter",
"Chi_Ha": "Type 97 Chi-Ha",
"Chi_Ha_short": "Chi-Ha",
"Chi_He": "Type 1 Chi-He",
@@ -4725,17 +4809,20 @@
"Continental_AOI-628-1": "Continental AOI-628-1",
"Continental_AOI-628-1_short": "Continental\\nAOI-628-1",
"Continental_AOI-628-2": "Continental AOI-628-2",
"Continental_AOI-628-2A": "Continental AOI-628-2A",
"Continental_AOI-628-2_short": "Continental\\nAOI-628-2",
"Continental_AOI_1490_1": "Continental AOI-1490-1",
"Continental_AOS-895-1": "Continental AOS-895-1",
"Continental_AOS-895-1_short": "Continental\\nAOS-895-1",
"Continental_AOS-895-3": "AN/GRC-8",
"Continental_AOS-895-3V2": "Continental AOS-895-3-2",
"Continental_AOS-895-3_short": "AN/GRC-8",
"Continental_AOSI-1195-1": "Continental AOSI 1195-1",
"Continental_AOSI-1195-1A": "Continental AOSI-1195-1A",
"Continental_AOSI-1195-5": "Continental AOSI-1195-5",
"Continental_AOSI-895-5": "Continental AOSI-895-5",
"Continental_AOSI-895-5_short": "Continental\\nAOSI-895-5",
"Continental_AOSI_1195_5A": "Continental AOSI-1195-5 Y IV",
"Continental_AOSI_895_5_Prem": "Continental AOSI-895-5",
"Continental_AV-1790-1": "Continental AV-1790-1",
"Continental_AV-1790-1A": "Continental AV-1790-1",
@@ -4811,6 +4898,8 @@
"Cz14_Skoda_T-56_Custom_short": "Škoda T 56 Golem",
"Cz14_Skoda_T-56_short": "Škoda T 56",
"Cz15_Skoda_T-45": "Škoda T 45",
"Cz15_Skoda_T-45_Custom": "Škoda T 45 Skvělý",
"Cz15_Skoda_T-45_Custom_short": "Škoda T 45 Skvělý",
"Cz15_Skoda_T-45_short": "Škoda T 45",
"D-744": "D-744",
"D1": "D1",
@@ -5037,10 +5126,14 @@
"GB08_Churchill_I_short": "Churchill I",
"GB09_Churchill_VII": "Churchill VII",
"GB109_GSOR_1008": "GSOR 1008",
"GB109_GSOR_1008_Custom": "GSOR 1008 Excalibur",
"GB109_GSOR_1008_Custom_short": "GSOR 1008 Excalibur",
"GB109_GSOR_1008_short": "GSOR 1008",
"GB10_Black_Prince": "Black Prince",
"GB10_Black_Prince_short": "Black Prince",
"GB112_Caliban": "Caliban",
"GB112_Caliban_Custom": "Caliban Hugo",
"GB112_Caliban_Custom_short": "Caliban Hugo",
"GB112_Caliban_short": "Caliban",
"GB11_Caernarvon": "Caernarvon",
"GB11_Caernarvon_short": "Caernarvon",
@@ -5163,6 +5256,8 @@
"GB_Centurion_MkDF": "Defender Mk. 1",
"GB_Centurion_MkDF_short": "Defender Mk. 1",
"GB_Churchill_MkVI": "Churchill Mk. VI",
"GB_Churchill_MkVIII": "Churchill VIII",
"GB_Churchill_MkVIII_short": "Churchill VIII",
"GB_Churchill_MkVI_short": "Churchill Mk. VI",
"GB_FV301": "FV301",
"GB_FV301_short": "FV301",
@@ -5182,6 +5277,7 @@
"GMC_6004": "GMC 6004T",
"GMC_6046": "GMC 6046",
"GMC_6046A": "GMC 6046A",
"GMC_6046_BP": "GMC 6046B",
"GMC_Allison_V1710-E32": "GMC Allison V1710-E32",
"GMC_Allison_V1710-E32_short": "GMC Allison\\nV1710-E32",
"GMS-6046B": "GMS 6046B",
@@ -5307,6 +5403,10 @@
"It10_P43_BD": "P.43/06 anniversario",
"It10_P43_BD_short": "P.43/06 ann.",
"It10_P43_bis": "P.43 bis",
"It10_P43_bis_BP": "Shadowhunter",
"It10_P43_bis_BP_Custom": "Shadowhunter Enchanted",
"It10_P43_bis_BP_Custom_short": "Shadowhunter Enchanted",
"It10_P43_bis_BP_short": "Shadowhunter",
"It10_P43_bis_short": "P.43 bis",
"It12_Prototipo_Standard_B": "Prototipo Standard B",
"It12_Prototipo_Standard_B_short": "Standard B",
@@ -5319,7 +5419,11 @@
"It14_P44_Pantera_Custom_short": "P.44 Pantera Furious",
"It14_P44_Pantera_short": "P.44 Pantera",
"It20_Car_Comb_45t": "Carro da Combattimento 45t",
"It20_Car_Comb_45t_Custom": "Carro 45t Glitch",
"It20_Car_Comb_45t_Custom_short": "Carro 45t Glitch",
"It20_Car_Comb_45t_short": "Carro 45t",
"It21_Controcarro3_Minotauro": "Controcarro 3 Minotauro",
"It21_Controcarro3_Minotauro_short": "Minotauro",
"J12_Shinobi": "Shinobi",
"J12_Shinobi_short": "Shinobi",
"J20_Ho_Ri_type3": "Ho-Ri Type III",
@@ -5333,8 +5437,8 @@
"J23_Chi_To_SPG": "Chi-To SPG",
"J23_Chi_To_SPG_short": "Chi-To SPG",
"J24_Type_57": "Type 57",
"J24_Type_57_Custom": "Type 57 Mechacamo",
"J24_Type_57_Custom_short": "Type 57 Mechacamo",
"J24_Type_57_Custom": "Type 57 Mecha",
"J24_Type_57_Custom_short": "Type 57 Mecha",
"J24_Type_57_short": "Type 57",
"J25_Type71": "Type 71",
"J25_Type71_Custom": "Type 71 Sankai",
@@ -5487,6 +5591,8 @@
"M18E2BP": "BLTZ9000",
"M18E2BP_short": "BLTZ9000",
"M18_Hellcat": "M18 Hellcat",
"M18_Hellcat_Custom": "Hellcat Arracourt",
"M18_Hellcat_Custom_short": "Hellcat Arracourt",
"M18_Hellcat_short": "Hellcat",
"M22_Locust": "M22 Locust",
"M22_Locust_short": "Locust",
@@ -5501,6 +5607,10 @@
"M2_lt_short": "M2 Light",
"M2_med": "M2 Medium Tank",
"M2_med_short": "M2 Medium",
"M36_BP": "Enforcer",
"M36_BP_Custom": "Vandal",
"M36_BP_Custom_short": "Vandal",
"M36_BP_short": "Enforcer",
"M36_Slagger": "M36 Jackson",
"M36_Slagger_short": "Jackson",
"M36_Slagger_skin_volar": "M36 Valor",
@@ -5588,6 +5698,7 @@
"MTLS-1G14": "MTLS-1G14",
"MTLS_D1": "MTLS D1",
"MTLS_T1": "MTLS T1",
"MTU_MB-838_Ca_M-500": "MTU MB 838 CaM 500B",
"MT_50_T": "MT-50T",
"M_40": "M-40",
"MarderII": "Marder II",
@@ -5605,6 +5716,7 @@
"Mausketten": "Maus",
"Mausturm": "Maus",
"Maybach_HL100": "Maybach HL 100",
"Maybach_HL100V2": "Maybach HL 100 B",
"Maybach_HL45P": "Maybach HL 45 P",
"Maybach_HL57TR": "Maybach HL 57 TR",
"Maybach_HL62TR": "Maybach HL 62 TR",
@@ -5823,6 +5935,10 @@
"Oth31_T150BP_Custom": "Titan-150 Trailblazer",
"Oth31_T150BP_Custom_short": "Titan-150 Trailblazer",
"Oth31_T150BP_short": "Titan-150",
"Oth33_Blizzard_BP": "Rover",
"Oth33_Blizzard_BP_Custom": "Rover LunarX",
"Oth33_Blizzard_BP_Custom_short": "Rover LunarX",
"Oth33_Blizzard_BP_short": "Rover",
"PLInz_RWA": "PLInz R.W.A.",
"PLT_27": "PLT-27",
"Paccar_120_325HT": "Gas Boiler",
@@ -5999,6 +6115,10 @@
"PzVI_AusfBP_short": "Icebreaker",
"PzVI_AusfTU": "Tiger I",
"PzVI_AusfTU_short": "Tiger I",
"PzVI_Custom_short_v2": "Tiger I Fox",
"PzVI_Custom_short_v3": "Tiger I Baron",
"PzVI_Custom_v2": "Tiger I Fox",
"PzVI_Custom_v3": "Tiger I Baron",
"PzVI_GuP": "Tiger Kuromorimine SP",
"PzVI_GuP_short": "Tiger Kuromorimine SP",
"PzVI_Porsche_Turm": "Pz.Kpfw. Tiger Ausf. E",
@@ -6109,6 +6229,8 @@
"R172_Object_752_Custom": "Object 752 Stargazer",
"R172_Object_752_Custom_short": "Obj. 752 Stargazer",
"R172_Object_752_short": "Object 752",
"R175_IS_2E": "IS-2 shielded",
"R175_IS_2E_short": "IS-2 shielded",
"R180_Object_274A": "Object 274a",
"R180_Object_274A_Custom": "Object 274a Leshy",
"R180_Object_274A_Custom_short": "Object 274a Leshy",
@@ -6569,6 +6691,7 @@
"V-2-54IS_GuP": "V-2-54 GuP",
"V-2IS": "V-2IS",
"V-2IS_B": "V-2IS",
"V-2IS_B_2": "V-2IS-2",
"V-2IS_R": "V-2-10",
"V-2IS_R1": "V-2-10",
"V-2K": "V-2K",
@@ -6680,6 +6803,7 @@
"V_2_34": "V-2-34",
"V_2_34M": "V-2-34M",
"V_2_34_modificato": "V-2-34 modificato",
"V_2_34_modificato_BP": "V-2-34 modificato B",
"V_2_54SCG": "V-2-54SCG",
"V_46_5": "V-46-5",
"V_54": "V-54",
@@ -6692,6 +6816,7 @@
"Van_Helsing_short": "Helsing",
"Vauxhall_Bedford_Twin_Six": "Bedford Twin-Six",
"Vauxhall_Bedford_Twin_Six_B": "Bedford Twin-Six B",
"Vauxhall_Bedford_Twin_Six_BP": "Bedford Twin-Six II",
"Verbesserteturm": "L.K.A. 2",
"Vickers-Armstrong": "Armstrong Siddeley V8",
"Vickers-Armstrong_MkII": "Armstrong Siddeley V8 SC",
@@ -6707,6 +6832,8 @@
"W_12_5_B": "W12-5B",
"W_12_5_P": "W12-5P",
"Waffentrager_IV": "Waffenträger auf Pz. IV",
"Waffentrager_IV_CL": "Waffenträger Camelot",
"Waffentrager_IV_CL_short": "WT Camelot",
"Waffentrager_IV_short": "WT auf Pz. IV",
"Waterspit_1": "Waterspit",
"Wespe": "Wespe",