Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for increased mino ratelimit via confidential key #13

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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},
cmyui marked this conversation as resolved.
Show resolved Hide resolved
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"]