🐛 修复爬虫图片类型错误的问题

This commit is contained in:
Karako 2022-09-01 12:20:00 +08:00
parent 595762b060
commit e0cd40d41a
No known key found for this signature in database
GPG Key ID: 5920831B0095D4A0
4 changed files with 10 additions and 10 deletions

View File

@ -170,8 +170,8 @@ class Character(WikiModel):
@property
def icon(self) -> CharacterIcon:
return CharacterIcon(
icon=str(SCRAPE_HOST.join(f'/img/{self.id}_icon.png')),
side=str(SCRAPE_HOST.join(f'/img/{self.id}_side_icon.png')),
gacha=str(SCRAPE_HOST.join(f'/img/{self.id}_gacha_card.png')),
splash=str(SCRAPE_HOST.join(f'/img/{self.id}_gacha_splash.png'))
icon=str(SCRAPE_HOST.join(f'/img/{self.id}_icon.webp')),
side=str(SCRAPE_HOST.join(f'/img/{self.id}_side_icon.webp')),
gacha=str(SCRAPE_HOST.join(f'/img/{self.id}_gacha_card.webp')),
splash=str(SCRAPE_HOST.join(f'/img/{self.id}_gacha_splash.webp'))
)

View File

@ -54,4 +54,4 @@ class Material(WikiModel):
@property
def icon(self) -> str:
return str(SCRAPE_HOST.join(f'/img/{self.id}.png'))
return str(SCRAPE_HOST.join(f'/img/{self.id}.webp'))

View File

@ -137,7 +137,7 @@ class Weapon(WikiModel):
@property
def icon(self) -> WeaponIcon:
return WeaponIcon(
icon=str(SCRAPE_HOST.join(f'/img/{self.id}.png')),
awakened=str(SCRAPE_HOST.join(f'/img/{self.id}_awaken_icon.png')),
gacha=str(SCRAPE_HOST.join(f'/img/{self.id}_gacha_icon.png')),
icon=str(SCRAPE_HOST.join(f'/img/{self.id}.webp')),
awakened=str(SCRAPE_HOST.join(f'/img/{self.id}_awaken_icon.webp')),
gacha=str(SCRAPE_HOST.join(f'/img/{self.id}_gacha_icon.webp')),
)

View File

@ -85,7 +85,7 @@ class WeaponPlugin(BasePlugins):
"weapon_info_max_level": _weapon_data.stats[-1].level,
"progression_base_atk": round(_weapon_data.stats[-1].ATK),
"weapon_info_source_list": [
await url_to_file(str(SCRAPE_HOST.join(f'/img/{mid}.png')))
await url_to_file(str(SCRAPE_HOST.join(f'/img/{mid}.webp')))
for mid in _weapon_data.ascension[-3:]
],
"special_ability_name": _weapon_data.affix.name,
@ -101,7 +101,7 @@ class WeaponPlugin(BasePlugins):
"weapon_info_max_level": _weapon_data.stats[-1].level,
"progression_base_atk": round(_weapon_data.stats[-1].ATK),
"weapon_info_source_list": [
await url_to_file(str(SCRAPE_HOST.join(f'/img/{mid}.png')))
await url_to_file(str(SCRAPE_HOST.join(f'/img/{mid}.webp')))
for mid in _weapon_data.ascension[-3:]
],
"special_ability_name": '',