npm i osu-api-extended
You can get your api key here
const { v1, auth } = require('osu-api-extended')
const main = async () => {
auth.set_v1(api_key)
const data = await v2.beatmap.diff(1256136)
console.log(data)
}
main()
You can create your client here
const { v2, auth } = require('osu-api-extended')
const main = async () => {
// Auth via client
await auth.login('CLIENT_ID', 'CLIENT_SECRET')
// Auth via lazer credentials
await auth.login_lazer('YOUR_LOGIN', 'YOUR_PASSWORD')
// Auth via oauth2
await auth.authorize('CLIENT_ID', 'CLIENT_SECRET', 'CALLBACK_URL')
const data = await v2.beatmap.diff(1256136)
console.log(data)
}
main()
const { tools } = require('osu-api-extended')
const main = async () => {
// Accuracy from hits
const accuracy = tools.accuracy(300, 5, 10, 0, 0, 0, 'osu')
// Country name from country code
const country_name = tools.country('RU')
// Download difficulty file
const diff_file = tools.download.difficulty(2379651, './', '2379651')
// Calucalute pp for a difficulty
const pp_calc = tools.pp_calc(2379651)
// Rank letter form hits
const rank = tools.rank(
{
geki: 236,
katu: 43,
300: 640,
100: 54,
50: 5,
0: 15
},
'osu'
)
console.log({ accuracy, country_name, diff_file, pp_calc, rank })
}
main()
const { mods } = require('osu-api-extended')
const main = async () => {
// Mods name from mods id
const name = mods.name(64) // DT
// Mods id from mods name
const id = mods.id('HDDT') // 72
console.log({ name, id })
}
main()
- lzma-native: decompress data from replay
- node-osr: Working with replay file
request.ts
by AqilCont- open: open links in browser