Skip to content

Commit

Permalink
Update follow.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadownc authored Dec 18, 2024
1 parent 72a99ee commit 476754e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions scripts/follow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 476754e

Please sign in to comment.