Skip to content

Commit

Permalink
feat: change scopes for replay downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
NiceAesth committed Nov 16, 2024
1 parent 0b1f2d2 commit 02c5db9
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions aiosu/v2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1819,19 +1819,38 @@ async def get_score_lazer(
@prepare_token
@check_token
@requires_scope(Scopes.PUBLIC)
@requires_scope(Scopes.IDENTIFY | Scopes.DELEGATE, any_scope=True)
async def get_score_replay(
self,
score_id: int,
legacy_score_id: int,
mode: Gamemode,
) -> BytesIO:
r"""Gets the replay file for a score.
:param score_id: The ID of the score
:type score_id: int
:param legacy_score_id: The ID of the score
:type legacy_score_id: int
:param mode: The gamemode to search for
:type mode: aiosu.models.gamemode.Gamemode
:raises APIException: Contains status code and error message
:raises RefreshTokenExpiredError: If the client refresh token has expired
:return: Replay file
:rtype: io.BytesIO
"""
url = f"{self.base_url}/api/v2/scores/{mode}/{legacy_score_id}/download"
return await self._request("GET", url)

@prepare_token
@check_token
@requires_scope(Scopes.PUBLIC)
async def get_score_replay_lazer(
self,
score_id: int,
) -> BytesIO:
r"""Gets the replay file for a score.
:param score_id: The ID of the score
:type score_id: int
:raises APIException: Contains status code and error message
:raises RefreshTokenExpiredError: If the client refresh token has expired
:return: Replay file
Expand Down

0 comments on commit 02c5db9

Please sign in to comment.