From 91aa786ef9a3a3be8545fe66097c247a4308f57b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Mon, 13 Mar 2023 17:21:25 +0100 Subject: [PATCH] add method to directly generate link to replay --- compress.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compress.py b/compress.py index be070d0..f71ffc0 100644 --- a/compress.py +++ b/compress.py @@ -189,3 +189,7 @@ def decompressJSONGame(game_str: str)->dict: "variant": variant_name(int(variant_id)) } return game + +def link(game_json: dict) -> str: + compressed = compressJSONGame(game_json) + return "https://hanab.live/replay-json/{}".format(compressed)