mirror of
https://github.com/PaiGramTeam/HonkaiStarRailWikiDataParser.git
synced 2025-01-30 18:38:36 +00:00
fix: station image cdn
This commit is contained in:
parent
47a0a1c6db
commit
48b5b754b1
@ -44,18 +44,12 @@ async def parse_station(datas, name: str, tag: Tag, cid: int):
|
||||
def get_third_pic():
|
||||
_tag = tag.find("div", {"class": "a69d1"})
|
||||
style = _tag.get("style")
|
||||
return f'{base_station_url}/{style[style.find("(") + 2:style.find(")")]}'
|
||||
return f'{style[style.find("(") + 1:style.find(")")]}'
|
||||
|
||||
third_pic = get_third_pic()
|
||||
text = soup.find("div", {"class": "a6678 a4af5"}).get("style")
|
||||
four_pic = (
|
||||
f'{base_station_url}{text[text.find("(") + 2:text.find(")") - 1]}'
|
||||
if text
|
||||
else ""
|
||||
)
|
||||
first_pic = (
|
||||
f'{base_station_url}{soup.find("img", {"class": "ac39b a6602"}).get("src")}'
|
||||
)
|
||||
four_pic = f'{text[text.find("(") + 2:text.find(")") - 1]}' if text else ""
|
||||
first_pic = f'{soup.find("img", {"class": "ac39b a6602"}).get("src")}'
|
||||
datas.append(
|
||||
AvatarIcon(
|
||||
id=cid,
|
||||
|
@ -15,8 +15,10 @@ from .url import base_station_url, light_cone_url
|
||||
async def parse_station(icon: LightConeIcon, tag: Tag):
|
||||
html = await client.get(f'{base_station_url}{tag.get("href")}')
|
||||
soup = BeautifulSoup(html.text, "lxml")
|
||||
first_pic = f'{base_station_url}{soup.find("img", {"class": "standard-icon a6602"}).get("src")}'
|
||||
second_pic = f'{base_station_url}{soup.find("img", {"class": "a2b16 mobile-only-elem ab8c3"}).get("src")}'
|
||||
first_pic = f'{soup.find("img", {"class": "standard-icon a6602"}).get("src")}'
|
||||
second_pic = (
|
||||
f'{soup.find("img", {"class": "a2b16 mobile-only-elem ab8c3"}).get("src")}'
|
||||
)
|
||||
icon.icon = [first_pic, second_pic]
|
||||
if light_cone_model := all_light_cones_map.get(icon.id):
|
||||
icon.name = light_cone_model.name
|
||||
|
Loading…
Reference in New Issue
Block a user