1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Get beatmap by hash
use osynic_osuapi::error::Result;
use osynic_osuapi::v1::client::request::client::OsynicOsuApiV1Client;
use osynic_osuapi::v1::interface::beatmap::IBeatmap;
use osynic_osuapi::v1::model::beatmap::GetBeatmapsParams;
#[tokio::main]
async fn main() -> Result<()> {
dotenvy::dotenv().ok();
let api_key = std::env::var("API_KEY").expect("API_KEY is not set");
let client = OsynicOsuApiV1Client::new(api_key.clone());
let params = GetBeatmapsParams::default().bid("1070639".to_string());
// .hash("69f77b0dfe67d288c1bf748f91ceb133".to_string());
let beatmaps = client.beatmap.get_beatmaps(params).await?;
println!("{:?}", beatmaps);
Ok(())
}
/*
ReqwestBeatmap get_beatmaps
[Beatmap {
approved: "1",
submit_date: "2010-01-16 04:36:21",
approved_date: "2010-01-18 17:26:31",
last_update: "2010-01-18 14:26:22",
artist: "fripSide",
beatmap_id: "46004",
beatmapset_id: "12216",
bpm: "139.5",
creator: "DJPop",
creator_id: "2363",
difficultyrating: "2.49815",
diff_aim: "1.14847",
diff_speed: "1.23241",
diff_size: "4",
diff_overall: "4",
diff_approach: "4",
diff_drain: "3",
hit_length: "81",
source: "To Aru Kagaku no Railgun",
genre_id: "3",
language_id: "3",
title: "LEVEL5 -judgelight- (TV Size)",
total_length: "89",
version: "Normal",
file_md5: "69f77b0dfe67d288c1bf748f91ceb133",
mode: "0",
tags: "とある科学の超電磁砲",
favourite_count: "1313",
rating: "9.23261",
playcount: "946634",
passcount: "424577",
count_normal: "75",
count_slider: "60",
count_spinner: "1",
max_combo: "335",
storyboard: "0",
video: "1",
download_unavailable: "0",
audio_unavailable: "0"
}]
*/