From b353ae81bb08b6a6347e073e38de7aede99fd9c6 Mon Sep 17 00:00:00 2001 From: zjf Date: Tue, 27 May 2025 19:04:57 +0800 Subject: [PATCH] rpa --- src/cluster/rpa.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cluster/rpa.py b/src/cluster/rpa.py index 722afd7..6fb1586 100644 --- a/src/cluster/rpa.py +++ b/src/cluster/rpa.py @@ -70,7 +70,6 @@ headers = { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Origin': 'https://live.douyin.com', 'Priority': 'u=1, i', - 'Referer': 'https://live.douyin.com/837842834415', 'Sec-Ch-Ua': '"Chromium";v="136", "Microsoft Edge";v="136", "Not.A/Brand";v="99"', 'Sec-Ch-Ua-Mobile': '?0', 'Sec-Ch-Ua-Platform': '"Windows"', @@ -115,9 +114,12 @@ async def handle_response(custom_param, response): try: json_data = await response.json() logger.debug(f"json_data:{json.dumps(json_data, indent=2, ensure_ascii=False)}") - logger.debug(f'top_promotion:{json_data["top_promotion"]}') - logger.debug(f'promotions:{json_data["promotions"]}') - logger.debug(f'total:{json_data["total"]}') + if "top_promotion" in json_data: + logger.debug(f'top_promotion:{json_data["top_promotion"]}') + if "promotions" in json_data: + logger.debug(f'promotions:{json_data["promotions"]}') + if "total" in json_data: + logger.debug(f'total:{json_data["total"]}') except: logger.debug("Non-JSON response")