Skip to content

Commit

Permalink
feat: 添加夸克搜全网搜索
Browse files Browse the repository at this point in the history
  • Loading branch information
fllesser committed Dec 25, 2024
1 parent 281b7df commit e35c49b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions nonebot_plugin_quark/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,21 @@ def __lt__(self, other):


async def search(keyword: str) -> list[UrlInfo]:
share_id_set = await search_quark_so(keyword)
#......
local_share_id_set = await search_quark_so(keyword)
entire_share_id_set = await search_quark_so(keyword, 2)

share_id_set = local_share_id_set | entire_share_id_set

url_info_list = [info for share_id in share_id_set if (info := await get_url_info(share_id))]
return sorted(url_info_list)


async def search_quark_so(keyword: str) -> set[str]:
async def search_quark_so(keyword: str, type: int = 1) -> set[str]:
url = "https://www.quark.so/s"

params = {
'query': keyword
'query': keyword,
'type': type
}

headers = {
Expand Down

0 comments on commit e35c49b

Please sign in to comment.