ppy / osu-api

Public API for accessing osu! related data.
320 stars 16 forks source link

scores from deleted users are downloadable with replay_id but not with beatmap + user id #332

Closed tybug closed 1 year ago

tybug commented 1 year ago

Retrieving the replay data of score 3741709904 succeeds via the s (i.e. replay_id) param:

GET https://osu.ppy.sh/api/get_replay?s=3741709904&k=KEY
{
    "content":  ...
}

But fails with b and u, for the identical score:

GET https://osu.ppy.sh/api/get_replay?b=1619555&u=9116955&k=KEY
{
    "error": "Replay not available."
}

I would expect them both to succeed. I ran into this by downloading scores using the beatmap and user id returned from get_scores, which can include the id of deleted users.

peppy commented 1 year ago

I don't quite understand. If the user is deleted, there's no way a user_id lookup can work.

tybug commented 1 year ago

hmm, that's a fair position. I thought because the api does return user_id for scores - even when the user is deleted - that it clearly understands the user id is tied to the score and should allow score lookups by user_id. But the whole point of a user being deleted is to disallow lookups by user_id, so...

It's just weird that the invariant of get_replay(replay_id) == get_replay(beatmap_id, user_id) doesn't hold because the user may be deleted. Indeed, I assumed they would be equivalent, and much of my code uses the latter. apiv2 improves this thought by only allowing id lookups, so I guess this won't be a problem for much longer.