Conversation
gexiaojun1201
commented
Nov 30, 2025
- 添加详细的调试日志,显示cookies状态和API响应
- 增加重试等待时间(2-3秒),避免触发闲鱼风控
- 新增Cookie诊断工具debug_cookies.py,帮助用户检查Cookie配置
- 添加详细的调试日志,显示cookies状态和API响应 - 增加重试等待时间(2-3秒),避免触发闲鱼风控 - 新增Cookie诊断工具debug_cookies.py,帮助用户检查Cookie配置
|
1 |
JiwaniZakir
left a comment
There was a problem hiding this comment.
The cookie parsing in debug_cookies.py's check_cookies() splits on '; ' (with a trailing space), but real-world Cookie headers sometimes use ';' without a space between pairs — this would silently produce incorrect key names with leading spaces, causing required cookies like cna or unb to appear missing even when present. Consider using cookie.strip().split('=', 1) after splitting on ';' alone.
In XianyuApis.py, the retry wait formula wait_time = 2 + retry_count produces linear backoff (2s, 3s, 4s…), which is weak against rate-limiting scenarios; exponential backoff (e.g., 2 ** retry_count) is the more standard approach for anti-scraping/risk-control situations. Also, the debug lines logging partial cookie values (cna, cookie2, _m_h5_tk) at DEBUG level could expose sensitive auth material in persisted log files — it's worth adding a note in the docstring or a conditional guard so this is only active in explicitly opted-in debug environments.