Skip to content

hburn7/omc-api

Repository files navigation

omc-api

The osu! Mappool Compliance API (omc-api) serves as a source of truth for the OMCC and Tournament Committee website's mappool compliance features. For now, this API is restricted to these tools only. Requests will not be authorized unless the correct value is passed to the X-Api-Key header. This secret is stored under the API_KEY_SECRET environment variable.

Rules

The tool relies on hardcoded and file-based rules to function. Rules are checked in order of priority, so if the condition is met, the flow stops immediately. This means that a ranked beatmap with a DMCA flag will always be disallowed. At a high level, the rules are (in order):

  1. All beatmapsets which are not downloadable or have a content notice (typically a DMCA notice) are flagged as disallowed due to DMCA.
  2. Beatmapsets which match with an override are handled.
  3. All beatmapsets with a positive track_id value are flagged as allowed due to being licensed under the Featured Artist program.
  4. All ranked/approved/loved beatmapsets are allowed.
  5. The beatmapset's tags are checked against the banned sources list.
  6. The beatmapset's content is checked against a list of tracks which are prohibited by the rightsholder. Matching prior to parentheses is also checked in case the uploader does not use the exact title (i.e. uploaded under Flying Castle instead of the tracked Flying Castle (Extended Mix) track).
  7. The beatmapset's content is checked against the list of artists who have restricted use of their content.

Spec

Root URL: https://api.omc.stagec.xyz

Endpoints

/validate

The /validate endpoint accepts an array of osu! beatmap IDs as input and returns an object as follows, where failures is a list of osu! beatmap IDs that failed processing (likely due to deletion):

{
    "results": ValidationResult[],
    "failures": number[]
}

Types

ValidationResult: Information about the beatmapset which was processed, including all osu! beatmap IDs from the POST body which belong to the set.

Usage

Copy the .env.example file and replace the OSU_CLIENT_ID and OSU_CLIENT_SECRET values with your osu! api v2 client. You can create a client under your osu! account's settings page.

Install bun.

  • bun install - Installs packages
  • bun run start - Runs the server (listens on localhost:8080)
  • bun run test - Starts tests using vitest

Logging

Structured JSON logs are emitted at DEBUG, INFO, WARN, and ERROR levels. Configure the minimum level with the LOG_LEVEL environment variable in your .env file (defaults to DEBUG).

About

osu! Mappool Compliance API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •