fix: 修复抖音关键词搜索为中文的情况下,有bug

This commit is contained in:
Relakkes 2024-03-03 19:36:36 +08:00
parent 7002061d70
commit 149b6bcdc8
2 changed files with 3 additions and 2 deletions

View File

@ -114,7 +114,7 @@ class DOUYINClient:
:return: :return:
""" """
params = { params = {
"keyword": keyword, "keyword": urllib.parse.quote(keyword),
"search_channel": search_channel.value, "search_channel": search_channel.value,
"sort_type": sort_type.value, "sort_type": sort_type.value,
"publish_time": publish_time.value, "publish_time": publish_time.value,

View File

@ -138,6 +138,7 @@ class DouYinCrawler(AbstractCrawler):
task = asyncio.create_task( task = asyncio.create_task(
self.get_comments(aweme_id, semaphore), name=aweme_id) self.get_comments(aweme_id, semaphore), name=aweme_id)
task_list.append(task) task_list.append(task)
if len(task_list) > 0 :
await asyncio.wait(task_list) await asyncio.wait(task_list)
async def get_comments(self, aweme_id: str, semaphore: asyncio.Semaphore) -> None: async def get_comments(self, aweme_id: str, semaphore: asyncio.Semaphore) -> None: