Fetching online data - abraker95/ultimate_osu_analyzer GitHub Wiki

In this tutorial we will fetch the latest ranked beatmaps, replays for those beatmaps, and load the beatmaps and replays to see them in the display. This tutorial is meant to show how something can be done, and as such, does not explain the what is available in the fetched data. The various things available in the fetched data is covered in the next tutorial, Exploring Online Data.

Prior to starting this tutorial, make sure you put in your username and password in osu/online/login.py as that is required to fetch replays.


First let's get a list of the latest ranked beatmapsets. These are the listing you would find here. For the purpose of this tutorial, we will fetch the latest ranked Standard maps, enumerated as 0.

beatmapsets = CmdOnline.get_latest_beatmapsets(0)

This gives us a list of the 50 latest ranked beatmapsets. We can see the names of the beatmapsets by entering the variable we just assigned back into the console:

Let's take a closer look at the "Kimi ga Shinu no o Nagamete Iru yo" beatmapset by pishifat. It's hard to know what number beatmapset is what in the list, but luckily there is a command that helps us see:

CmdUtils.print_numbered_list(beatmapsets)

Now we can see that it is beatmapset #25

Let's get the beatmaps, or difficulties, available for that beatmapset:

beatmaps = beatmapsets[25].get_beatmaps()

Let's see what we have

Let's load the Extra difficulty and display it:

load_beatmap(beatmaps[0].get_beatmap_data())

Now we can see the loaded beatmap in the display:

To get scores for the beatmap:

scores = beatmaps[0].get_scores()

Now to load and display a replay:

load_replay(scores[7].get_replay_data_web())

If we switch to the layers tab, we can see the replay layer is loaded. Upon moving the timeline marker, a green cursor representing the player's cursor movement becomes visible: