From 3ce380645da442187d033656bd75350bb9e4b548 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 25 Mar 2025 20:06:19 +0200 Subject: [PATCH] Update urls and asyncio calls --- sticker/lib/matrix.py | 4 ++-- sticker/pack.py | 2 +- sticker/stickerimport.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sticker/lib/matrix.py b/sticker/lib/matrix.py index f44ff7c..2216b04 100644 --- a/sticker/lib/matrix.py +++ b/sticker/lib/matrix.py @@ -59,7 +59,7 @@ async def load_config(path: str) -> None: print("Matrix config file not found. Please enter your homeserver and access token.") homeserver_url = input("Homeserver URL: ") access_token = input("Access token: ") - whoami_url = URL(homeserver_url) / "_matrix" / "client" / "r0" / "account" / "whoami" + whoami_url = URL(homeserver_url) / "_matrix" / "client" / "v3" / "account" / "whoami" if whoami_url.scheme not in ("https", "http"): whoami_url = whoami_url.with_scheme("https") user_id = await whoami(whoami_url, access_token) @@ -71,7 +71,7 @@ async def load_config(path: str) -> None: }, config_file) print(f"Wrote config to {path}") - upload_url = URL(homeserver_url) / "_matrix" / "media" / "r0" / "upload" + upload_url = URL(homeserver_url) / "_matrix" / "media" / "v3" / "upload" async def whoami(url: URL, access_token: str) -> str: diff --git a/sticker/pack.py b/sticker/pack.py index a4ca1f2..1a0bb41 100644 --- a/sticker/pack.py +++ b/sticker/pack.py @@ -143,7 +143,7 @@ parser.add_argument("path", help="Path to the sticker pack directory", type=str) def cmd(): - asyncio.get_event_loop().run_until_complete(main(parser.parse_args())) + asyncio.run(main(parser.parse_args())) if __name__ == "__main__": diff --git a/sticker/stickerimport.py b/sticker/stickerimport.py index 54cab76..2b9ff12 100644 --- a/sticker/stickerimport.py +++ b/sticker/stickerimport.py @@ -161,7 +161,7 @@ async def main(args: argparse.Namespace) -> None: def cmd() -> None: - asyncio.get_event_loop().run_until_complete(main(parser.parse_args())) + asyncio.run(main(parser.parse_args())) if __name__ == "__main__":