-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add nerinyan mirror * Add ripple and gatari mirrors, shuffle mirrors before running * disable ripple * add names
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import logging | ||
|
||
from app.adapters.beatmap_mirrors import BeatmapMirror | ||
|
||
|
||
class GatariMirror(BeatmapMirror): | ||
name = "gatari" | ||
base_url = "https://osu.gatari.pw" | ||
|
||
async def fetch_beatmap_zip_data(self, beatmapset_id: int) -> bytes | None: | ||
try: | ||
logging.info(f"Fetching beatmapset osz2 from gatari: {beatmapset_id}") | ||
response = await self.http_client.get( | ||
f"{self.base_url}/d/{beatmapset_id}", | ||
) | ||
response.raise_for_status() | ||
return response.read() | ||
except Exception: | ||
logging.warning( | ||
"Failed to fetch beatmap from gatari.pw", | ||
exc_info=True, | ||
) | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import logging | ||
|
||
from app.adapters.beatmap_mirrors import BeatmapMirror | ||
|
||
|
||
class RippleMirror(BeatmapMirror): | ||
name = "ripple" | ||
base_url = "https://storage.ripple.moe" | ||
|
||
async def fetch_beatmap_zip_data(self, beatmapset_id: int) -> bytes | None: | ||
try: | ||
logging.info(f"Fetching beatmapset osz2 from ripple: {beatmapset_id}") | ||
response = await self.http_client.get( | ||
f"{self.base_url}/d/{beatmapset_id}", | ||
) | ||
response.raise_for_status() | ||
return response.read() | ||
except Exception: | ||
logging.warning( | ||
"Failed to fetch beatmap from ripple.moe", | ||
exc_info=True, | ||
) | ||
return None |