Skip to content

aleph naught (aspire map) fails to parse #83

@Liam-DeVoe

Description

@Liam-DeVoe
from slider import *
library = Library(".")
beatmap = library.lookup_by_id(1680610, download=True)

fails with

Traceback (most recent call last):
  File "/Users/tybug/Desktop/coding/osu/slider/slider/library.py", line 256, in lookup_by_id
    return self._read_beatmap(self, beatmap_id=beatmap_id)
  File "/Users/tybug/Desktop/coding/osu/slider/slider/library.py", line 224, in _raw_read_beatmap
    raise KeyError(key)
KeyError: 1680610

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tybug/Desktop/coding/sandbox/__circleguard.py", line 11, in <module>
    beatmap = library.lookup_by_id(1680610, download=True)
  File "/Users/tybug/Desktop/coding/osu/slider/slider/library.py", line 260, in lookup_by_id
    return self.download(beatmap_id, save=save)
  File "/Users/tybug/Desktop/coding/osu/slider/slider/library.py", line 408, in download
    beatmap = Beatmap.parse(data.decode('utf-8-sig'))
  File "/Users/tybug/Desktop/coding/osu/slider/slider/beatmap.py", line 2102, in parse
    groups['HitObjects'],
  File "/Users/tybug/Desktop/coding/osu/slider/slider/beatmap.py", line 390, in parse
    return parse(Position(x, y), time, hitsound, rest)
  File "/Users/tybug/Desktop/coding/osu/slider/slider/beatmap.py", line 698, in _parse
    duration = timedelta(milliseconds=int(num_beats * ms_per_beat))
OverflowError: Python int too large to convert to C int

I'm sure this is a case of aspire beatmaps using non-sane values for various things. Not sure what the best way to handle this is, though I think we could cap the duration to MAX_INT for this particular case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions