add jubeat_czeave

This commit is contained in:
Pinapelz
2025-05-09 00:43:23 -07:00
parent e3af47e2d9
commit edc45b33b6
2 changed files with 84 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
# CZEAve Asphyxia Jubeat to Batch Manual
**MUSIC_BAR IS NOT SAVED, SOME CASES MAY BE INCORRECT, USE WITH CAUTION**
[Plugin Repo](github.com/yuanqiuye/asphyxia-jubeat-CZEAve-plugins)
The official Asphyxia Plugin (up to Festo) also stores data in the same format so it will work.
Pass in your `jubeat@asphyxia.db` as `-f` or `--file`
+76
View File
@@ -0,0 +1,76 @@
import argparse
import json
import os
LAMP_MAP = {
1: "FAILED",
3: "CLEARED"
}
SEQUENCE_MAP = {
0: "BSC",
1: "ADV",
2: "EXT"
}
def convert_from_czeave_json_to_tachi_json(file: str, output_path: str, service: str):
with open(file, "r", encoding="utf-8") as infile:
batch_manual = {
"meta": {"game": "jubeat", "playtype": "Single", "service": service},
}
scores = []
data = [json.loads(line) for line in infile if '"collection":"score"' in line]
for score in data:
difficulty = SEQUENCE_MAP[score["seq"]]
if score["isHardMode"]:
difficulty = "HARD " + difficulty
lamp = "FAILED"
if score["clearCount"] >= 1:
lamp = "CLEAR"
if score["fullcomboCount"] >= 1:
lamp = "FULL COMBO"
if score["excellentCount"] >= 1:
lamp = "EXCELLENT"
timestamp = score["updatedAt"]["$$date"]
music_rate = score["musicRate"] / 10
curr_score = {
"matchType": "inGameID",
"identifier": str(score["musicId"]),
"difficulty": difficulty,
"score": score["score"],
"lamp": lamp,
"timeAchieved": timestamp,
"musicRate": music_rate,
}
scores.append(curr_score)
batch_manual["scores"] = scores
with open(output_path, "w", encoding="utf-8") as outfile:
json.dump(batch_manual, outfile, indent=4, ensure_ascii=False)
print(f"Output saved to {output_path}")
if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog="czeave_to_tachi.py",
description="Converts czeave Asphyxia Jubeat save data to Tachi compatible JSON",
)
parser.add_argument(
"-s",
"--service",
help="Service description to be shown on Tachi (Note for where this score came from)",
default="jubeat Asphyxia czeave",
)
parser.add_argument("-f", "--file", help="AsphyxiaCORE jubeat .db file czeave", required=True)
parser.add_argument(
"-o", "--output", help="Output filename", default="czeave_asphyxia_batch_manual.json"
)
args = parser.parse_args()
if args.file is None:
print("ERROR: Please specify Asphyxia DB file (from savedata folder)")
exit(1)
if not os.path.exists(args.file):
print(f"ERROR: The file {args.file} does not exist.")
exit(1)
convert_from_czeave_json_to_tachi_json(args.file, args.output, args.service)