completely mitgate the issue

This commit is contained in:
John Xina 2023-07-15 14:07:22 +08:00
parent e4cfcd84ed
commit 990b7acf68

6
app.py
View File

@ -139,6 +139,12 @@ async def forum_view():
if only_use_native_api:
forum_info, threads = await asyncio.gather(tieba.get_forum_detail(fname),
tieba.get_threads(fname, pn=pn, sort=sort))
if hasattr(forum_info, 'slogan'):
forum_info = { 'avatar': extract_image_name(forum_info.origin_avatar),
'topic': forum_info.post_num, 'thread': forum_info.post_num,
'member': forum_info.member_num, 'desc': forum_info.slogan,
'name': forum_info.fname }
else:
forum_info = { 'avatar': 'a6efce1b9d16fdfa6291460ab98f8c5495ee7b51.jpg',
'topic': forum_info.post_num, 'thread': forum_info.post_num,
'member': forum_info.member_num, 'desc': '贴吧描述暂不可用', 'name': forum_info.fname }