From fe7292a588b9ef9212396d3163893bb808a45f56 Mon Sep 17 00:00:00 2001 From: Jylpah Date: Thu, 26 Nov 2020 21:28:29 +0200 Subject: [PATCH] read_replay_id(): read _id from replay JSON --- blitzutils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/blitzutils.py b/blitzutils.py index 97157ab..119cb58 100755 --- a/blitzutils.py +++ b/blitzutils.py @@ -1747,6 +1747,16 @@ class WoTinspector: return url.rsplit('/', 1)[-1] + @classmethod + def read_replay_id(cls, json_replay): + """Read replay_id from replay JSON file""" + try: + url = json_replay['data']['view_url'] + return cls.get_replay_id(url) + except Exception as err: + error(exception=err) + return None + @classmethod def chk_JSON_replay(cls, json_resp): """"Check String for being a valid JSON file"""