Skip to content

Releases: kszlim/osu-replay-parser

v7.0.1

09 Oct 20:04
c27814f
Compare
Choose a tag to compare
  • correctly interpret replay ids as signed longs instead of unsigned longs. This fixes issues with parsing and writing lazer replays, which can have negative ids.

v7.0.0

10 May 23:26
Compare
Choose a tag to compare

Breaking Changes

This release applies a breaking change by removing the first two frames of osr lzma data. No api methods or signatures have been changed. If you do not rely on the specifics of replay frames, you may safely upgrade. Otherwise, read below.

The first two frames of an osr are unusual: the first frame always has a time of 0 and a position of (256, -500), while the second frame has a time value of first_break - 1 and a similar position of (256, -500). These are marker frames placed by stable. Previously, we left them in, but these two frames can cause issues for non-std gamemodes. For instance, an x value of 256 is treated as K9 in mania.

We now remove both of these frames. If you need access to the values contained in these frames for whatever reason, and can no longer access them due to this release, please open an issue.

See also #40 and #39.

v6.0.2

11 Dec 18:16
Compare
Choose a tag to compare
  • fix some lazer replays failing to parse

v6.0.1

07 Jul 04:18
Compare
Choose a tag to compare
  • fix mania keys being parsed incorrectly

v6.0.0

12 Jan 19:13
64e1c93
Compare
Choose a tag to compare

Parsing replays is now done through static methods on Replay:

  • Replay.from_path - parse from a path (most common)
  • Replay.from_file - parse from a live file object
  • Replay.from_string - from a string holding the contents of a replay

The concept of "pure lzma" and parsing only the replay data portion of a replay has been replaced with parse_replay_data, which takes optional parameters decoded and decompressed, as well as a new mode parameter. It now returns List[ReplayEvent] instead of a Replay with only play_data filled, as before.

Replay writing has been added, and is done through a matching set of methods:

  • Replay.write_path - write the replay back to a path
  • Replay.write_file - write the replay back to a live file object
  • Replay.pack - return the contents of the replay as a string, suitable for writing to an osr file

Also added replay.rng_seed, which will be set for replays which have the rng seed.

Several attributes have been renamed to bring osrparse closer to osu!'s internal naming of attributes:

  • number_{300, 100, 50}s -> count_{300, 100, 50}
  • {geki, katu, misses} -> {count_geki, count_katu, count_miss}
  • is_perfect_combo -> perfect
  • game_mode -> mode
  • player_name -> username
  • play_data -> replay_data
  • mod_combination -> mods

Finally, this release brings a readthedocs: https://kevin-lim.ca/osu-replay-parser/.

v5.0.0

30 May 05:39
Compare
Choose a tag to compare
  • add parsing for all gamemodes, not just osu!std
    • each gamemodes returns their own ReplayEvent subclasses with specific attributes. See the readme for documentation on each mode's ReplayEvent subclass
  • rename ReplayEvent.time_since_previous_action to ReplayEvent.time_delta
  • rename ReplayEvent.keys_pressed to ReplayEvent.keys
  • change ReplayEvent.keys_pressed (now ReplayEvent.keys) to a new Key enum instead of a raw int

v4.0.1

17 Apr 02:21
Compare
Choose a tag to compare
  • fall back to parsing replay_id as a short if parsing as a long fails
    • this can occur for some old replays

v4.0.0

27 Jan 02:46
40e8ec6
Compare
Choose a tag to compare
  • parse replay_id for replays
  • add scorev2 and mirror mods
  • mod_combination is now an IntFlag instead of a list of enums
  • add support for parsing "pure" lzma strings
    • this is useful for replays retrieved from the api, since the api only gives us the lzma replay data and nothing else, unlike osr files
  • remove the last frame, which contains the "rng seed", after a certain osu! version
  • add type annotations to public-facing members
  • rename GameMode members for consistency
  • implement __str__, __eq__, __hash__ for ReplayEvent
  • replace raising Exception with raising ValueError instead

v3.0.0

22 May 09:46
Compare
Choose a tag to compare

Updated timestamp to use python datetime.datetime object.

Thanks for the contribution @blimmo