Skip to content

Commit

Permalink
Add support for increased mino ratelimit via confidential key (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui authored Jul 1, 2024
1 parent 54f040f commit 84ad926
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/adapters/osu_mirrors/backends/mino.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import httpx
from typing_extensions import override

from app import settings
from app.adapters.osu_mirrors.backends import AbstractBeatmapMirror
from app.adapters.osu_mirrors.backends import BeatmapMirrorResponse
from app.repositories.beatmap_mirror_requests import MirrorResource
Expand All @@ -22,6 +23,7 @@ async def fetch_beatmap_zip_data(
try:
response = await self.http_client.get(
f"{self.base_url}/d/{beatmapset_id}",
headers={"x-ratelimit-key": settings.MINO_INCREASED_RATELIMIT_KEY},
timeout=httpx.Timeout(None, connect=2),
)
if response.status_code == 404:
Expand Down
2 changes: 2 additions & 0 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ def read_bool(s: str) -> bool:
AWS_S3_SECRET_ACCESS_KEY = os.environ["AWS_S3_SECRET_ACCESS_KEY"]

DISCORD_BEATMAP_UPDATES_WEBHOOK_URL = os.environ["DISCORD_BEATMAP_UPDATES_WEBHOOK_URL"]

MINO_INCREASED_RATELIMIT_KEY = os.environ["MINO_INCREASED_RATELIMIT_KEY"]

0 comments on commit 84ad926

Please sign in to comment.