support: skill and eidolon icons

This commit is contained in:
xtaodada 2023-05-09 21:03:36 +08:00
parent 6529357598
commit a71e97f176
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
150 changed files with 56 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import asyncio
from res_func.avatar import fix_avatar_config, fetch_text_map
from res_func.light_cone import fix_light_cone_config
from res_func.relic import fetch_relic_config
from res_func.honkai_gg.avatar import get_all_avatars
async def main():
@ -10,6 +11,7 @@ async def main():
await fix_avatar_config(text_map_data)
await fix_light_cone_config()
await fetch_relic_config(text_map_data)
await get_all_avatars()
if __name__ == '__main__':

View File

@ -5,7 +5,7 @@ from pathlib import Path
src_dir = Path("src")
data_dir = Path("data")
pic_lists = ["avatar_gacha", "destiny", "element"]
pic_lists = ["avatar_gacha", "destiny", "element", "skill"]
async def move_files():

View File

View File

@ -0,0 +1,50 @@
import asyncio
import aiofiles
import re
from typing import List
import ujson
from bs4 import BeautifulSoup
from res_func.client import client
from res_func.url import avatar_honkai_url, avatar_icon_honkai_url
avatar_data = {}
async def get_all_avatar() -> List[str]:
req = await client.get(avatar_honkai_url)
html = req.text
pattern = re.compile(r'href="/characters/(.*?)">')
result = pattern.findall(html)
return [f"{avatar_honkai_url}/{i}" for i in result if i != ""]
async def get_single_avatar(url: str) -> None:
req = await client.get(url)
html = req.text
soup = BeautifulSoup(html, "lxml")
div = soup.find_all("div", {"class": "character_skills__FL3Dn"})[-1]
pattern = re.compile(r'skillicons/(.*?)/skillicon(.*?).webp')
result = pattern.findall(str(div))
if len(result) != 6:
print(f"{url} 获取星魂图片失败")
return
urls = [f"{avatar_icon_honkai_url}/{i[0]}/skillicon{i[1]}.webp" for i in result]
avatar_data[result[0][0]] = urls
async def dump_icons():
final_data = dict(sorted(avatar_data.items(), key=lambda x: x[0]))
async with aiofiles.open("data/avatar_eidolon_icons.json", "w", encoding="utf-8") as f:
await f.write(ujson.dumps(final_data, indent=4, ensure_ascii=False))
async def get_all_avatars() -> None:
print("开始获取星魂图片")
urls = await get_all_avatar()
tasks = []
for url in urls:
tasks.append(get_single_avatar(url))
await asyncio.gather(*tasks)
await dump_icons()
print("获取星魂图片成功")

View File

@ -12,3 +12,6 @@ relic_set_config = f"{base_data_url}ExcelOutput/RelicSetConfig.json"
base_station_url = "https://starrailstation.com"
avatar_url = f"{base_station_url}/cn/characters"
light_cone_url = f"{base_station_url}/cn/equipment"
base_honkai_url = "https://honkai.gg"
avatar_honkai_url = f"{base_honkai_url}/cn/characters"
avatar_icon_honkai_url = f"{base_honkai_url}/images/spriteoutput/skillicons"

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/skill/1001_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1001_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/skill/1001_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1002_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/skill/1002_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/skill/1002_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/skill/1003_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/skill/1003_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
src/skill/1003_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src/skill/1004_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src/skill/1004_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/skill/1004_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/skill/1005_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/skill/1005_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/skill/1005_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/skill/1006_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1006_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/skill/1006_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/skill/1008_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1008_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/skill/1008_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1009_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src/skill/1009_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/skill/1009_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/skill/1013_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/skill/1013_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/skill/1013_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/skill/1101_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src/skill/1101_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/skill/1101_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src/skill/1102_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
src/skill/1102_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/skill/1102_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1103_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/skill/1103_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1103_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1104_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1104_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/skill/1104_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/skill/1105_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
src/skill/1105_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/skill/1105_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/skill/1106_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1106_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/skill/1106_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
src/skill/1107_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1107_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src/skill/1107_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/skill/1108_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
src/skill/1108_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/skill/1108_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
src/skill/1109_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/skill/1109_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src/skill/1109_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/skill/1201_skill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/skill/1201_talent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
src/skill/1201_ultimate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Some files were not shown because too many files have changed in this diff Show More