mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-06 04:10:02 +08:00
update
This commit is contained in:
@@ -125,11 +125,17 @@ async def retrieve_char_data(char: bs4.element.Tag, game_name: str, data: dict,
|
||||
if game_name == 'azur':
|
||||
char = char.find('td').find('div')
|
||||
avatar_img = char.find('a').find('img')
|
||||
try:
|
||||
member_dict['名称'] = remove_prohibited_str(str(avatar_img['alt'])[: str(avatar_img['alt']).find('头像')])
|
||||
except TypeError:
|
||||
member_dict['名称'] = char.find('a')['title'][:-4]
|
||||
try:
|
||||
member_dict['头像'] = unquote(str(avatar_img['srcset']).split(' ')[-2])
|
||||
except KeyError:
|
||||
member_dict['头像'] = unquote(str(avatar_img['src']).split(' ')[-2])
|
||||
member_dict['名称'] = remove_prohibited_str(str(avatar_img['alt'])[: str(avatar_img['alt']).find('头像')])
|
||||
except TypeError:
|
||||
member_dict['头像'] = "img link not find..."
|
||||
logger(f'{member_dict["名称"]} 图片缺失....')
|
||||
star = char.find('div').find('img')['alt']
|
||||
if star == '舰娘头像外框普通.png':
|
||||
star = 1
|
||||
@@ -159,15 +165,19 @@ async def _async_update_azur_extra_info(key: str, session: aiohttp.ClientSession
|
||||
try:
|
||||
async with session.get(f'https://wiki.biligame.com/blhx/{key}', timeout=7) as res:
|
||||
soup = BeautifulSoup(await res.text(), 'lxml')
|
||||
construction_time = str(soup.find('table', {'class': 'wikitable sv-general'}).find('tbody'))
|
||||
x = {key: {'获取途径': []}}
|
||||
if construction_time.find('无法建造') != -1:
|
||||
x[key]['获取途径'].append('无法建造')
|
||||
elif construction_time.find('活动已关闭') != -1:
|
||||
x[key]['获取途径'].append('活动限定')
|
||||
else:
|
||||
x[key]['获取途径'].append('可以建造')
|
||||
logger.info(f'碧蓝航线获取额外信息 {key}...{x[key]["获取途径"]}')
|
||||
try:
|
||||
construction_time = str(soup.find('table', {'class': 'wikitable sv-general'}).find('tbody'))
|
||||
x = {key: {'获取途径': []}}
|
||||
if construction_time.find('无法建造') != -1:
|
||||
x[key]['获取途径'].append('无法建造')
|
||||
elif construction_time.find('活动已关闭') != -1:
|
||||
x[key]['获取途径'].append('活动限定')
|
||||
else:
|
||||
x[key]['获取途径'].append('可以建造')
|
||||
logger.info(f'碧蓝航线获取额外信息 {key}...{x[key]["获取途径"]}')
|
||||
except AttributeError:
|
||||
x = {key: {'获取途径': []}}
|
||||
logger.warning(f'碧蓝航线获取额外信息错误 {key}...{[]}')
|
||||
return x
|
||||
except TimeoutError:
|
||||
logger.warning(f'访问 https://wiki.biligame.com/blhx/{key} 第 {i}次 超时...已再次访问')
|
||||
|
||||
Reference in New Issue
Block a user