Skip to content

Commit

Permalink
Replace Kitsu Domain as it expires
Browse files Browse the repository at this point in the history
  • Loading branch information
nattadasu committed Aug 11, 2024
1 parent 52178e1 commit 454c969
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
"reportUnknownMemberType": "none"
},
"markdown.extension.toc.unorderedList.marker": "-",
"markdown.extension.toc.updateOnSave": true
"markdown.extension.toc.updateOnSave": true,
"python.analysis.autoImportCompletions": true
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
| [`interactions-py`](https://pypi.org/project/discord-py-interactions) | MIT | Base | Wrapper | The backend of this bot! |
| [Is It Down Right Now?](https://www.isitdownrightnow.com/) | - | Utility | API | Used for checking if a website is down |
| [Jikan](https://jikan.moe/) | MIT | Anime, Profile, Verify | 3rd Party MAL API | Used for showing anime information, verify user, and show user's profile |
| [Kitsu](https://kitsu.io/) | Apache-2.0 | Anime | Database | Used for adding additional information to anime information, mainly background and poster |
| [Kitsu](https://kitsu.app/) | Apache-2.0 | Anime | Database | Used for adding additional information to anime information, mainly background and poster |
| [Last.fm](https://www.last.fm/) | - | Profile | Database | Used for getting user's last.fm profile and scrobble summary |
| [MyAnimeList](https://myanimelist.net/) | - | Anime | Database | Search and show anime information |
| [nattadasu/animeApi](https://github.com/nattadasu/animeApi) | AGPL-3.0 | Random, Relation | Relation | Linking ID from a database to another database |
Expand Down
2 changes: 1 addition & 1 deletion classes/kitsu.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Kitsu:
def __init__(self):
"""Initialize the Kitsu API Wrapper"""
self.session = None
self.base_url = "https://kitsu.io/api/edge/"
self.base_url = "https://kitsu.app/api/edge/"
self.params = None

async def __aenter__(self):
Expand Down
6 changes: 3 additions & 3 deletions extensions/mediaautosend.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ async def kitsu_id_to_other_id(
) -> str | None:
"""Convert a Kitsu ID to another ID"""
if not kitsu_id.isdigit():
async with aiohttp.ClientSession() as session, session.get(f"https://kitsu.io/api/edge/{media_kind}?filter[slug]={kitsu_id}") as resp:
async with aiohttp.ClientSession() as session, session.get(f"https://kitsu.app/api/edge/{media_kind}?filter[slug]={kitsu_id}") as resp:
if resp.status != 200:
return None
data = await resp.json()
kitsu_id = data["data"][0]["id"]
async with aiohttp.ClientSession() as session, session.get(f"https://kitsu.io/api/edge/{media_kind}/{kitsu_id}/mappings") as resp:
async with aiohttp.ClientSession() as session, session.get(f"https://kitsu.app/api/edge/{media_kind}/{kitsu_id}/mappings") as resp:
if resp.status != 200:
return
data = await resp.json()
Expand Down Expand Up @@ -150,7 +150,7 @@ async def on_message_create(self, event: MessageCreate) -> None:
case r"(?:https?://)?(?:www\.)?kitsu\.io/anime/(?P<mediaid>[\w\-]+)" as ids:
media_id: str = ids["mediaid"]
if not media_id.isdigit():
async with aiohttp.ClientSession() as session, session.get(f"https://kitsu.io/api/edge/anime?filter[slug]={media_id}") as resp:
async with aiohttp.ClientSession() as session, session.get(f"https://kitsu.app/api/edge/anime?filter[slug]={media_id}") as resp:
if resp.status != 200:
return
data = await resp.json()
Expand Down
2 changes: 1 addition & 1 deletion extensions/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ async def relations_shows(
)
postsrc = "Notify.moe"
elif anime_api.kitsu is not None:
poster = f"https://media.kitsu.io/anime/poster_images/{anime_api.kitsu}/large.jpg"
poster = f"https://media.kitsu.app/anime/poster_images/{anime_api.kitsu}/large.jpg"
postsrc = "Kitsu"

postsrc = f" Poster from {postsrc}" if postsrc else ""
Expand Down
2 changes: 1 addition & 1 deletion modules/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def media_id_to_platform(
"emoid": "1073441859910774784",
},
"kitsu": {
"uid": f"https://kitsu.io/anime/{media_id}",
"uid": f"https://kitsu.app/anime/{media_id}",
"emoid": "1073439152462368950",
},
"myanimelist": {
Expand Down

0 comments on commit 454c969

Please sign in to comment.