diff --git a/analyze_wotb_replays.py b/analyze_wotb_replays.py index 2459c72..f711eca 100755 --- a/analyze_wotb_replays.py +++ b/analyze_wotb_replays.py @@ -2326,9 +2326,12 @@ async def mk_readerQ_item(replay_json, filename : str = None) -> list: global REPLAY_N REPLAY_N +=1 try: - if not '_id' in replay_json: - id = wi.read_replay_id(replay_json) - replay_json['_id'] = id + if wi.chk_JSON_replay(replay_json): + if not '_id' in replay_json: + id = wi.read_replay_id(replay_json) + replay_json['_id'] = id + else: + replay_json = None # mark error except Exception as err: bu.error(exception=err) if filename == None: diff --git a/blitzutils.py b/blitzutils.py index 0d0835c..46a5d79 100755 --- a/blitzutils.py +++ b/blitzutils.py @@ -311,7 +311,7 @@ def verbose_std(msg="", id=None) -> bool: def warning(msg="", id=None, force: bool = False) -> bool: """Print a warning message""" - return _print_log_msg('Warning', msg, None, id, print_msg=(force or (_log_level >= NORMAL))) + return _print_log_msg('', 'Warning: ' + msg, None, id, print_msg=(force or (_log_level >= NORMAL))) def debug(msg="", id=None, exception=None, force: bool = False) -> bool: @@ -1852,7 +1852,7 @@ class WoTinspector: # FIX The replay can have allies/enemies i.e. be useful for # team composition analysis, but does not have player contribution if ('status' in json_resp) and json_resp['status'] == 'ok' and \ - (get_JSON_value(json_resp, key='data.summary.allies') != None) : + (get_JSON_value(json_resp, key='data.summary.winner_team') != None) : debug("JSON check OK") return True except KeyError as err: