· 4 years ago · Apr 03, 2021, 06:48 AM
1 public bool populateSongByHash()
2 {
3 // Setup the client's HTTP User Agent
4 HttpOptions options = new HttpOptions(name: appName, version: new Version(1, 0, 0));
5
6 // Use this to interact with the API
7 BeatSaver beatsaver = new BeatSaver(options);
8
9 Beatmap map = new Beatmap(beatsaver, null, hash);
10 map.Populate();
11 map.Populate().Wait();
12 try
13 {
14 //if (map.DownloadURL != null)
15 //{
16 hash = map.Hash;
17 key = map.Key;
18 songName = map.Name;
19 downloadURL = map.DownloadURL;
20 uploader = map.Uploader.Username;
21 //}
22 }
23 catch (BeatSaverSharp.Exceptions.RateLimitExceededException)
24 {
25 return false;
26 }
27 return true;
28
29 }
30