diff --git a/config/base_config.py b/config/base_config.py index e789b0f..cdac54e 100644 --- a/config/base_config.py +++ b/config/base_config.py @@ -1,6 +1,6 @@ # 基础配置 PLATFORM = "xhs" -KEYWORDS = "python,golang" +KEYWORDS = "编程副业,编程兼职" LOGIN_TYPE = "qrcode" # qrcode or phone or cookie COOKIES = "" # 具体值参见media_platform.xxx.field下的枚举值,暂时只支持小红书 diff --git a/media_platform/douyin/client.py b/media_platform/douyin/client.py index b228b9e..7e2a78e 100644 --- a/media_platform/douyin/client.py +++ b/media_platform/douyin/client.py @@ -140,7 +140,7 @@ class DOUYINClient(AbstractApiClient): query_params = { 'search_channel': search_channel.value, 'enable_history': '1', - 'keyword': urllib.parse.quote(keyword), + 'keyword': keyword, 'search_source': 'tab_search', 'query_correct_type': '1', 'is_filter_search': '0', @@ -151,10 +151,10 @@ class DOUYINClient(AbstractApiClient): 'list_type': 'multi', } if sort_type.value != SearchSortType.GENERAL.value or publish_time.value != PublishTimeType.UNLIMITED.value: - query_params["filter_selected"] = urllib.parse.quote(json.dumps({ + query_params["filter_selected"] = json.dumps({ "sort_type": str(sort_type.value), "publish_time": str(publish_time.value) - })) + }) query_params["is_filter_search"] = 1 query_params["search_source"] = "tab_search" referer_url = f"https://www.douyin.com/search/{keyword}?aid=f594bbd9-a0e2-4651-9319-ebe3cb6298c1&type=general"