1 parent fdee193 commit 9c2fb65Copy full SHA for 9c2fb65
1 file changed
xunbot/plugins/bt/data_source.py
@@ -23,6 +23,10 @@ async def get_bt_info(url: str) -> str:
23
html_data = requests.get(url, headers=header)
24
html = etree.HTML(html_data.text)
25
26
+ num = html.xpath('//div[@id="wall"]//span/b/text()')[0]
27
+ if num == '0':
28
+ return "没有找到记录"
29
+
30
div_all = html.xpath('//div[@class="search-item"]')
31
div_all = div_all[:MAXINFO_BT] if len(div_all) > MAXINFO_BT else div_all
32
line_list = [await get_item_line(div) for div in div_all]
0 commit comments