mirror of
https://github.com/Xtao-Labs/iShotaBot.git
synced 2024-11-16 04:35:55 +00:00
🐛 修复描述为空时无法解析
This commit is contained in:
parent
1da600f9d7
commit
44351ac7a1
@ -70,7 +70,10 @@ async def get_loft(url: str) -> List[LofterItem]:
|
||||
res = await request.get(url)
|
||||
assert res.status_code == 200
|
||||
username, avatar, name, bio, soup = parse_loft_user(url, res.text)
|
||||
title = soup.findAll("div", {"class": "text"})[-1].getText().strip()
|
||||
try:
|
||||
title = soup.findAll("div", {"class": "text"})[-1].getText().strip()
|
||||
except IndexError:
|
||||
title = ""
|
||||
links = soup.findAll("a", {"class": "imgclasstag"})
|
||||
audio_link = None
|
||||
audio = soup.find("div", {"class": "img"})
|
||||
|
Loading…
Reference in New Issue
Block a user