From 548271e5373e523d8c49676a60b4c66487a03577 Mon Sep 17 00:00:00 2001 From: Relakkes Date: Tue, 16 Jul 2024 01:33:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8A=96=E9=9F=B3?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=90=9C=E7=B4=A2=E5=85=B3=E9=94=AE=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E7=BC=96=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/base_config.py | 2 +- media_platform/douyin/client.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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"