diff --git a/fs2dd.py b/fs2dd.py index 1835d456..490f1245 100644 --- a/fs2dd.py +++ b/fs2dd.py @@ -152,6 +152,7 @@ def create_dd_tracks_from_fs(fs_map_dir: str) -> DDBeatMapInfoFile: create_ticks = yyyymmdd_to_ticks(datetime.now().strftime('%Y%m%d')) dd_beat_map_info = DDBeatMapInfoFile( + OstId=random_9_digit_int(), CreateTicks=create_ticks, CreateTime=str(create_ticks), BeatMapId=random_9_digit_int(), diff --git a/resources/drs/README.md b/resources/drs/README.md index 22bda97f..7d1e5acd 100644 --- a/resources/drs/README.md +++ b/resources/drs/README.md @@ -29,11 +29,54 @@ find . -type f -name "song.json" -exec rm -f {} \; ``` ```bash -# Find all M4A audio files in the current directory and its subdirectories, and convert them to ogg format using ffmpeg. -find . -type f -name "*.m4a" -exec sh -c 'ffmpeg -y -i "$1" "${1%.m4a}.ogg"' sh {} \; +# remove 10 seconds from all m4as and convert to ogg files +find . -type f -name "*.m4a" -exec sh -c 'DURATION=$(ffprobe -i "$0" -show_entries format=duration -v quiet -of csv="p=0"); TRIM_TIME=$(awk "BEGIN {print $DURATION - 10}"); ffmpeg -y -ss 0 -t $TRIM_TIME -i "$0" "${0%.m4a}.ogg"' {} \; ``` ```bash -# remove 10 seconds from all ogg files -find . -type f -name "*.m4a" -exec sh -c 'DURATION=$(ffprobe -i "$0" -show_entries format=duration -v quiet -of csv="p=0"); TRIM_TIME=$(awk "BEGIN {print $DURATION - 10}"); ffmpeg -ss 0 -t $TRIM_TIME -i "$0" "${0%.m4a}.ogg"' {} \; +#!/bin/bash +find . -type f -name "*.2dx" -exec sh -c ' + dir=$(dirname "$0") + filename=$(basename "$0") + file_without_extension="${filename%.*}" + + if echo "$filename" | grep -qE "clip|pre"; then + echo "Skipping $filename" + exit 0 + fi + + cd "$dir" || exit 1 + 2dxdump "$filename" + ffmpeg -y -i "0.wav" "${file_without_extension}clip1.ogg" +' {} \; ``` + +```bash +find . -type f -name "1.wav" -exec rm -f {} \; +``` + +```bash +#!/bin/bash +find . -type f -name "*.s3p" -exec sh -c ' + dir=$(dirname "$0") + filename=$(basename "$0") + file_without_extension="${filename%.*}" + + output_file="${file_without_extension}clip1.ogg" + + if echo "$filename" | grep -qE "clip|pre"; then + echo "Skipping $filename" + exit 0 + fi + + cd "$dir" || exit 1 + if [ -f "$output_file" ]; then + echo "Skipping as $output_file already exists." + exit 0 + fi + + # uhh yea deal with it lol + ../../../../../.venv/Scripts/python ../../../../../s3p_unpack.py --input "$filename" + ffmpeg -y -i "0.wma" "$output_file" +' {} \; +``` \ No newline at end of file diff --git a/resources/drs/datax/music/00298/songs.json b/resources/drs/datax/music/00298/songs.json index 293899dc..2e54bca8 100644 --- a/resources/drs/datax/music/00298/songs.json +++ b/resources/drs/datax/music/00298/songs.json @@ -1,4 +1,4 @@ -{ + { "song_id": 298, "difficulties": { "difficulty_1a": { diff --git a/s3p_unpack.py b/s3p_unpack.py new file mode 100644 index 00000000..32999f8a --- /dev/null +++ b/s3p_unpack.py @@ -0,0 +1,44 @@ +from __future__ import annotations + +import argparse +import os +import struct + + +def get_s3v0_header(file): + header = {} + magic = file.read(4) + if magic != b'S3V0': + raise ValueError('Invalid S3V0 magic') + + header['size'], header['original_size'], header['data_hash'] = struct.unpack( + '