mirror of
https://github.com/PaiGramTeam/HonkaiStarRailWikiDataParser.git
synced 2024-11-16 06:25:25 +00:00
🐛 fix: new light_cone style
This commit is contained in:
parent
6aaf45985a
commit
e2db004ceb
@ -31,12 +31,16 @@ async def fetch_station() -> List[LightConeIcon]:
|
||||
print("开始获取光锥素材")
|
||||
html = await client.get(light_cone_url)
|
||||
soup = BeautifulSoup(html.text, "lxml")
|
||||
light_cones = soup.find_all("a", {"class": "a4041 ae026 a5abc"})
|
||||
light_cones = soup.find_all("a", {"class": "a4041"})
|
||||
tasks = []
|
||||
datas: List[LightConeIcon] = []
|
||||
for light_cone in light_cones:
|
||||
name = light_cone.find("span").get_text().strip()
|
||||
url = light_cone.get("href")
|
||||
if not url:
|
||||
continue
|
||||
if "lightcone/" not in url:
|
||||
continue
|
||||
nid = int(url.split("/")[-1])
|
||||
if light_cone_model := all_light_cones_name.get(name):
|
||||
light_cone_model.id = nid
|
||||
|
@ -17,7 +17,12 @@ async def fix_set_image():
|
||||
divs = soup.find_all("a", {"class": "aff5a"})
|
||||
data_map: Dict[int, Tuple[str, List[str]]] = {}
|
||||
for div in divs:
|
||||
sid = int(div.get("href").split("/")[-1])
|
||||
url = div.get("href")
|
||||
if not url:
|
||||
continue
|
||||
if "relics/" not in url:
|
||||
continue
|
||||
sid = int(url.split("/")[-1])
|
||||
images = div.find_all("img")
|
||||
images = [f"{base_station_url}{i.get('src')}" for i in images]
|
||||
if len(images) not in {3, 5}:
|
||||
|
Loading…
Reference in New Issue
Block a user