From 0c6d9a36cefa644ad00923f5d281f24f0ea312f8 Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Sun, 25 Jun 2023 18:43:00 -0400 Subject: [PATCH] mai2: add movie server endpoints --- titles/mai2/base.py | 2 +- titles/mai2/index.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/titles/mai2/base.py b/titles/mai2/base.py index 5a8b0c6..e77b2e1 100644 --- a/titles/mai2/base.py +++ b/titles/mai2/base.py @@ -36,7 +36,7 @@ class Mai2Base: "rebootEndTime": "2020-01-01 07:59:59.0", "movieUploadLimit": 100, "movieStatus": 1, - "movieServerUri": self.old_server + "movie/", + "movieServerUri": self.old_server + "movie", "deliverServerUri": self.old_server + "deliver/" if self.can_deliver and self.game_config.deliver.enable else "", "oldServerUri": self.old_server + "old", "usbDlServerUri": self.old_server + "usbdl/" if self.can_deliver and self.game_config.deliver.udbdl_enable else "", diff --git a/titles/mai2/index.py b/titles/mai2/index.py index c4d6874..1d9b8bf 100644 --- a/titles/mai2/index.py +++ b/titles/mai2/index.py @@ -112,6 +112,10 @@ class Mai2Servlet: def render_POST(self, request: Request, version: int, url_path: str) -> bytes: if url_path.lower() == "ping": return zlib.compress(b'{"returnCode": "1"}') + + elif url_path.startswith("movie/"): + self.logger.info(f"Movie data: {url_path} - {request.content.getvalue()}") + return b"" req_raw = request.content.getvalue() url = request.uri.decode() @@ -211,6 +215,10 @@ class Mai2Servlet: self.logger.info(f"v{version} GET {url_path}") url_split = url_path.split("/") + if url_split[0] == "movie": + if url_split[1] == "moviestart": + return json.dumps({"moviestart":{"status":"OK"}}).encode() + if url_split[0] == "old": if url_split[1] == "ping": self.logger.info(f"v{version} old server ping")