zhangliang 1 month ago
parent
commit
e3c2c63b43
1 changed files with 3 additions and 0 deletions
  1. 3 0
      cookie_generator.py

+ 3 - 0
cookie_generator.py

@@ -67,6 +67,9 @@ class CookieGenerator:
                 cookies = context.cookies("https://www.douyin.com")
                 cookie_dict = {c['name']: c['value'] for c in cookies}
                 logger.info(f"💾 Cookie: {cookie_dict}")
+                if '__ac_referer' in cookie_dict:
+                    logger.error(f"❌ 触发抖音风控{cookie_dict}")
+                    return None
 
                 # 检查 signature 格式
                 if len(cookie_dict) < 8: