remove replay stuff
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 40s
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 40s
This commit is contained in:
@ -1,27 +0,0 @@
|
||||
import ky from "ky";
|
||||
import { NotFoundError } from "../error/not-found-error";
|
||||
|
||||
const SCORESABER_REPLAY_ENDPOINT = "https://scoresaber.com/api/game/telemetry/downloadReplay";
|
||||
|
||||
export class ReplayService {
|
||||
/**
|
||||
* Gets the app statistics.
|
||||
*/
|
||||
public static async getReplay(playerId: string, leaderboardId: string) {
|
||||
const response = await ky.get(SCORESABER_REPLAY_ENDPOINT, {
|
||||
searchParams: {
|
||||
playerId,
|
||||
leaderboardId,
|
||||
},
|
||||
headers: {
|
||||
"User-Agent": "ScoreSaber-PC/3.3.13",
|
||||
},
|
||||
});
|
||||
const replayData = await response.arrayBuffer();
|
||||
if (replayData === undefined) {
|
||||
throw new NotFoundError(`Replay for player "${playerId}" and leaderboard "${leaderboardId}" not found`);
|
||||
}
|
||||
|
||||
return replayData;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user