Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aleph naught (aspire map) fails to parse #83

Open
tybug opened this issue Dec 23, 2020 · 1 comment
Open

aleph naught (aspire map) fails to parse #83

tybug opened this issue Dec 23, 2020 · 1 comment

Comments

@tybug
Copy link
Collaborator

tybug commented Dec 23, 2020

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.

@llllllllll
Copy link
Owner

Wow, this map is crazy. I don't think we should just truncate, because the map definitely doesn't take forever to run so we shouldn't model it that way. I don't have time to look into the actual error right now, but I would see what actual slider it dies on and try to see what osu! does on this slider. Off the top of my head, I would look to see if any timing points give a negative bpm, our code might not handle this correctly since that doesn't really make sense normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants