completely mitgate the issue

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

12
app.py
View File

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