From 476754e16c13b28f17a156724d9de088ba73c722 Mon Sep 17 00:00:00 2001 From: Shadownc <365172043@qq.com> Date: Wed, 18 Dec 2024 10:26:53 +0800 Subject: [PATCH] Update follow.py --- scripts/follow.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/follow.py b/scripts/follow.py index c8331b8..99e87cd 100644 --- a/scripts/follow.py +++ b/scripts/follow.py @@ -5,6 +5,7 @@ sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) +from dotenv import load_dotenv from utils.qywechat_notify import send_wechat_notification # 假设你有此函数实现企业微信通知 from utils.qmsg_notify import send_qmsg_notification from utils.serve_chan_notify import send_server_chan_notification @@ -20,7 +21,7 @@ def load_env_variables(): csrfToken = os.getenv("FOLLOW_CSRF_TOKEN") cookie = os.getenv("FOLLOW_COOKIE") - if not csrfToken or not cookie: + if not cookie: raise ValueError("缺少必须的环境变量:CSRF Token 或 Cookie") return csrfToken, cookie @@ -38,12 +39,8 @@ def sign_in(): 'Cookie': cookie } - payload = { - "csrfToken": csrfToken - } - # 发送 POST 请求 - response = requests.post(url, headers=headers, data=json.dumps(payload)) + response = requests.post(url, headers=headers) # 解析返回结果 result = response.json()