HonkaiStarRailWikiDataParser/func/fetch_all.py

16 lines
431 B
Python
Raw Permalink Normal View History

2023-04-23 14:06:11 +00:00
from typing import List
from func.client import client
from func.url import list_url
from models.wiki import Children
2023-08-29 05:15:55 +00:00
async def get_list(channel_id: str = "17") -> List[Children]:
2023-04-23 14:06:11 +00:00
params = {
2023-08-29 05:15:55 +00:00
"app_sn": "sr_wiki",
"channel_id": channel_id,
2023-04-23 14:06:11 +00:00
}
resp = await client.get(list_url, params=params)
children = resp.json()["data"]["list"][0]["children"]
return [Children(**child) for child in children]