Skip to content

Commit

Permalink
fix: Update ambr API url
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Sep 18, 2024
1 parent 9e49459 commit 65f05fc
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Introduction

ambr-py is an async API wrapper for [Project Ambr](https://gi.yatta.top/) written in Python.
ambr-py is an async API wrapper for [Project Ambr](https://gi.yatta.moe/) written in Python.
Project Ambr is a beautiful website that displays Genshin Impact game data.
Developing something for Hoyoverse games? You might be interested in [other API wrappers](https://github.com/seriaati#api-wrappers) written by me.

Expand Down
2 changes: 1 addition & 1 deletion ambr/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Language(Enum):


class AmbrAPI:
BASE_URL: Final[str] = "https://gi.yatta.top/api/v2"
BASE_URL: Final[str] = "https://gi.yatta.moe/api/v2"

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion ambr/models/abyss.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class AbyssEnemy(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI{'/monster' if 'MonsterIcon' in v else ''}/{v}.png"
return f"https://gi.yatta.moe/assets/UI{'/monster' if 'MonsterIcon' in v else ''}/{v}.png"

@field_validator("properties", mode="before")
def _convert_properties(cls, v: list[dict[str, Any]]) -> list[AbyssEnemyProperty]:
Expand Down
4 changes: 2 additions & 2 deletions ambr/models/achievement.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AchievementReward(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"


class AchievementDetail(BaseModel):
Expand Down Expand Up @@ -85,7 +85,7 @@ class AchievementCategory(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"

@field_validator("achievements", mode="before")
def _convert_achievements(cls, v: dict[str, dict[str, Any]]) -> list[Achievement]:
Expand Down
6 changes: 3 additions & 3 deletions ambr/models/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Artifact(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/reliquary/{v}.png"
return f"https://gi.yatta.moe/assets/UI/reliquary/{v}.png"


class ArtifactSetDetail(BaseModel):
Expand Down Expand Up @@ -74,7 +74,7 @@ def _convert_affix_list(cls, v: dict[str, str]) -> list[ArtifactAffix]:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/reliquary/{v}.png"
return f"https://gi.yatta.moe/assets/UI/reliquary/{v}.png"

@field_validator("artifacts", mode="before")
def _convert_artifacts(cls, v: dict[str, dict[str, Any]]) -> list[Artifact]:
Expand Down Expand Up @@ -105,7 +105,7 @@ class ArtifactSet(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/reliquary/{v}.png"
return f"https://gi.yatta.moe/assets/UI/reliquary/{v}.png"

@field_validator("affix_list", mode="before")
def _convert_affix_list(cls, v: dict[str, str]) -> list[ArtifactAffix]:
Expand Down
4 changes: 2 additions & 2 deletions ambr/models/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class BookDetail(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"


class Book(BaseModel):
Expand All @@ -74,4 +74,4 @@ class Book(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"
8 changes: 4 additions & 4 deletions ambr/models/character.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _convert_extra_level(cls, v: dict[str, dict[str, Any]] | None) -> TalentExtr

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"


class TalentType(IntEnum):
Expand Down Expand Up @@ -117,7 +117,7 @@ def _format_description(cls, v: str) -> str:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"

@field_validator("upgrades", mode="before")
def _convert_upgrades(cls, v: dict[str, dict[str, Any]]) -> list[TalentUpgrade]:
Expand Down Expand Up @@ -209,7 +209,7 @@ def _stringify_id(cls, v: int) -> str:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"

@field_validator("birthday", mode="before")
def _convert_birthday(cls, v: list[int]) -> Birthday:
Expand Down Expand Up @@ -286,7 +286,7 @@ def _stringify_id(cls, v: int | str) -> str:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"

@field_validator("birthday", mode="before")
def _convert_birthday(cls, v: list[int]) -> Birthday:
Expand Down
2 changes: 1 addition & 1 deletion ambr/models/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DomainReward(BaseModel):

@property
def icon(self) -> str:
return f"https://gi.yatta.top/assets/UI/UI_ItemIcon_{self.id}.png"
return f"https://gi.yatta.moe/assets/UI/UI_ItemIcon_{self.id}.png"


class Domain(BaseModel):
Expand Down
8 changes: 4 additions & 4 deletions ambr/models/food.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class FoodRecipe(BaseModel):

@field_validator("effect_icon", mode="before")
def _convert_effect_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"

@field_validator("effects", mode="before")
def _convert_effects(cls, v: dict[str, str]) -> list[FoodEffect]:
Expand All @@ -58,7 +58,7 @@ def _convert_recipe(cls, v: bool | dict[str, Any]) -> FoodRecipe | bool:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"


class Food(BaseModel):
Expand Down Expand Up @@ -100,8 +100,8 @@ def _convert_recipe(cls, v: bool | None) -> bool:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"

@field_validator("effect_icon", mode="before")
def _convert_effect_icon_url(cls, v: str | None) -> str | None:
return f"https://gi.yatta.top/assets/UI/{v}.png" if v else None
return f"https://gi.yatta.moe/assets/UI/{v}.png" if v else None
12 changes: 6 additions & 6 deletions ambr/models/furniture.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FurnitureRecipeInput(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"


class FurnitureRecipe(BaseModel):
Expand Down Expand Up @@ -50,7 +50,7 @@ class FurnitureDetail(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/furniture/{v}.png"
return f"https://gi.yatta.moe/assets/UI/furniture/{v}.png"

@field_validator("recipe", mode="before")
def _convert_recipe(cls, v: dict[str, Any] | None) -> FurnitureRecipe | None:
Expand Down Expand Up @@ -97,7 +97,7 @@ class Furniture(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/furniture/{v}.png"
return f"https://gi.yatta.moe/assets/UI/furniture/{v}.png"


class FurnitureSet(BaseModel):
Expand All @@ -110,7 +110,7 @@ class FurnitureSet(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/furnitureSuite/{v}.png"
return f"https://gi.yatta.moe/assets/UI/furnitureSuite/{v}.png"

@field_validator("categories", mode="before")
def _convert_categories(cls, v: list[str] | None) -> list[str]:
Expand All @@ -128,7 +128,7 @@ class FurnitureItem(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/furniture/{v}.png"
return f"https://gi.yatta.moe/assets/UI/furniture/{v}.png"


class FurnitureSetFavoriteNPC(BaseModel):
Expand All @@ -149,7 +149,7 @@ class FurnitureSetDetail(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/furnitureSuite/{v}.png"
return f"https://gi.yatta.moe/assets/UI/furnitureSuite/{v}.png"

@field_validator("categories", mode="before")
def _convert_categories(cls, v: list[str] | None) -> list[str]:
Expand Down
6 changes: 3 additions & 3 deletions ambr/models/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MaterialRecipe(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"


class MaterialSource(BaseModel):
Expand Down Expand Up @@ -61,7 +61,7 @@ def _convert_sources(cls, v: list[dict] | None) -> list[MaterialSource]:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"


class Material(BaseModel):
Expand Down Expand Up @@ -100,4 +100,4 @@ def _convert_recipe(cls, v: bool | None) -> bool:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"
8 changes: 4 additions & 4 deletions ambr/models/monster.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MonsterReward(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"


class MonsterEntry(BaseModel):
Expand All @@ -46,7 +46,7 @@ class MonsterDetail(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI{'/monster' if 'MonsterIcon' in v else ''}/{v}.png"
return f"https://gi.yatta.moe/assets/UI{'/monster' if 'MonsterIcon' in v else ''}/{v}.png"

@field_validator("entries", mode="before")
def _convert_entries(cls, v: dict[str, dict[str, Any]]) -> list[MonsterEntry]:
Expand Down Expand Up @@ -84,6 +84,6 @@ class Monster(BaseModel):
@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
if "MonsterIcon" in v:
return f"https://gi.yatta.top/assets/UI/monster/{v}.png"
return f"https://gi.yatta.moe/assets/UI/monster/{v}.png"
else:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"
4 changes: 2 additions & 2 deletions ambr/models/name_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _format_description(cls, v: str) -> str:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/namecard/{v}.png"
return f"https://gi.yatta.moe/assets/UI/namecard/{v}.png"

@property
def picture(self) -> str:
Expand Down Expand Up @@ -60,7 +60,7 @@ class Namecard(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/namecard/{v}.png"
return f"https://gi.yatta.moe/assets/UI/namecard/{v}.png"

@property
def picture(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion ambr/models/quest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ class Quest(BaseModel):

@field_validator("chapter_icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"
6 changes: 3 additions & 3 deletions ambr/models/tcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _convert_tags(cls, v: dict[str, str] | None) -> list[CardTag]:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"

@property
def small_icon(self) -> str:
Expand All @@ -101,7 +101,7 @@ def _convert_tags(cls, v: dict[str, str] | None) -> list[CardTag]:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/gcg/{v}.png"
return f"https://gi.yatta.moe/assets/UI/gcg/{v}.png"

@property
def small_icon(self) -> str:
Expand Down Expand Up @@ -159,7 +159,7 @@ def _convert_dice_cost(cls, v: dict[str, int] | None) -> list[DiceCost]:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/gcg/{v}.png"
return f"https://gi.yatta.moe/assets/UI/gcg/{v}.png"

@property
def small_icon(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion ambr/models/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Upgrade(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"

@field_validator("items", mode="before")
def _convert_items(cls, v: dict[str, int]) -> list[UpgradeItem]:
Expand Down
4 changes: 2 additions & 2 deletions ambr/models/weapon.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _flatten_story_id(cls, v: list[int] | None) -> int | None:

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"

@field_validator("affix", mode="before")
def _convert_affix(cls, v: dict[str, dict[str, Any]] | None) -> WeaponAffix | None:
Expand Down Expand Up @@ -141,4 +141,4 @@ class Weapon(BaseModel):

@field_validator("icon", mode="before")
def _convert_icon_url(cls, v: str) -> str:
return f"https://gi.yatta.top/assets/UI/{v}.png"
return f"https://gi.yatta.moe/assets/UI/{v}.png"

0 comments on commit 65f05fc

Please sign in to comment.