forked from Dniel97/artemis
maimai: fix usbdl endpoints
This commit is contained in:
parent
d4ea3bc12a
commit
37e2da2051
@ -235,6 +235,10 @@ class Mai2Servlet:
|
||||
if url_split[2] == "moviestart":
|
||||
return json.dumps({"moviestart":{"status":"OK"}}).encode()
|
||||
|
||||
else:
|
||||
request.setResponseCode(404)
|
||||
return b""
|
||||
|
||||
if url_split[0] == "old":
|
||||
if url_split[1] == "ping":
|
||||
self.logger.info(f"v{version} old server ping")
|
||||
@ -248,17 +252,34 @@ class Mai2Servlet:
|
||||
self.logger.info(f"v{version} old server friend inquire")
|
||||
return zlib.compress(b"{}")
|
||||
|
||||
else:
|
||||
request.setResponseCode(404)
|
||||
return b""
|
||||
|
||||
elif url_split[0] == "usbdl":
|
||||
if url_split[1] == "CONNECTIONTEST":
|
||||
self.logger.info(f"v{version} usbdl server test")
|
||||
return zlib.compress(b"ok")
|
||||
return b""
|
||||
|
||||
elif self.game_cfg.deliver.udbdl_enable and path.exists(f"{self.game_cfg.deliver.content_folder}/usb/{url_split[-1]}"):
|
||||
with open(f"{self.game_cfg.deliver.content_folder}/usb/{url_split[-1]}", 'rb') as f:
|
||||
return f.read()
|
||||
|
||||
else:
|
||||
request.setResponseCode(404)
|
||||
return b""
|
||||
|
||||
elif url_split[0] == "deliver":
|
||||
file = url_split[len(url_split) - 1]
|
||||
self.logger.info(f"v{version} {file} deliver inquire")
|
||||
|
||||
if not self.game_cfg.deliver.enable or not path.exists(f"{self.game_cfg.deliver.content_folder}/{file}"):
|
||||
return zlib.compress(b"")
|
||||
if self.game_cfg.deliver.enable and path.exists(f"{self.game_cfg.deliver.content_folder}/{file}"):
|
||||
with open(f"{self.game_cfg.deliver.content_folder}/deliver/{url_split[-1]}", 'rb') as f:
|
||||
return f.read()
|
||||
|
||||
else:
|
||||
request.setResponseCode(404)
|
||||
return b""
|
||||
|
||||
else:
|
||||
return zlib.compress(b"{}")
|
||||
|
Loading…
Reference in New Issue
Block a user