add method to directly generate link to replay

This commit is contained in:
Maximilian Keßler 2023-03-13 17:21:25 +01:00
parent ba8313b4bb
commit 91aa786ef9
Signed by: max
GPG Key ID: BCC5A619923C0BA5
1 changed files with 4 additions and 0 deletions

View File

@ -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)