motzel / bsor2json

BS Open Replay to JSON converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BS Open Replay to JSON

Beat Saber Open Replay format to JSON converter

Disclaimer: This is my Go learning project, so expect bugs and ugly code

Usage

> bsor2json.exe -h

bsor2json v0.9.1

Options:

  -h, --help   display help information

Commands:

  help     display help information
  raw      Convert raw replay data to JSON
  events   Simplify replay (notes/walls/pauses events only) and export to JSON
  stats    Calculate stats and export to JSON

Calculate stats and export to JSON

> bsor2json.exe stats -h
Calculate stats and export to JSON

Options:

  -h, --help                    display help information
  -d, --dir                     directory containing bsor files to convert
  -f, --file                    bsor file to convert
  -o, --output                  output filename (with -f option) or directory (with -d option); defaults to stdout or bsor directory
      --force[=false]           force overwrite
  -p, --pretty[=false]          whether the output JSON should be pretty formatted; conversion time will be much longer and the file will be larger
  -b, --buffered[=true]         whether file read should be buffered; it's faster but increases memory usage
      --parallel[=0]            parallel processing of multiple replays at once; equal to the number of cpu cores if zero or not specified 
      --display-failed[=true]   display failed replays when using the -d option

For example:

> bsor2json.exe stats -f filename.bsor --pretty

Simplify replay and export to JSON

> bsor2json.exe events -h
Simplify replay (notes/walls/pauses events only) and export to JSON

Options:

  -h, --help                    display help information
  -d, --dir                     directory containing bsor files to convert
  -f, --file                    bsor file to convert
  -o, --output                  output filename (with -f option) or directory (with -d option); defaults to stdout or bsor directory
      --force[=false]           force overwrite
  -p, --pretty[=false]          whether the output JSON should be pretty formatted; conversion time will be much longer and the file will be larger
  -b, --buffered[=true]         whether file read should be buffered; it's faster but increases memory usage
      --parallel[=0]            parallel processing of multiple replays at once; equal to the number of cpu cores if zero or not specified
      --display-failed[=true]   display failed replays when using the -d option
  -s, --with-stats[=true]       whether to add stats

For example:

> bsor2json.exe events -d Replays --with-stats

Convert raw replay data to JSON

> bsor2json.exe raw -h
  
Convert raw replay data to JSON

Options:

  -h, --help                    display help information
  -d, --dir                     directory containing bsor files to convert
  -f, --file                    bsor file to convert
  -o, --output                  output filename (with -f option) or directory (with -d option); defaults to stdout or bsor directory
      --force[=false]           force overwrite
  -p, --pretty[=false]          whether the output JSON should be pretty formatted; conversion time will be much longer and the file will be larger
  -b, --buffered[=true]         whether file read should be buffered; it's faster but increases memory usage
      --parallel[=0]            parallel processing of multiple replays at once; equal to the number of cpu cores if zero or not specified 
      --display-failed[=true]   display failed replays when using the -d option

For example:

> bsor2json.exe raw -f filename.bsor -o filename.json --force

Build

Dev

Install cosmtrek/air, customize the args_bin in .air.toml and then:

air.exe

Release

go build -ldflags "-s -w"

Dependencies

go-bsor (BS Open Replay parser)

About

BS Open Replay to JSON converter

License:MIT License


Languages

Language:Go 100.0%