Skip to main content

is_challenge

Function is_challenge 

Source
pub fn is_challenge(status: u16, cf_mitigated: Option<&str>, body: &str) -> bool
Expand description

判定一次响应是否为反爬挑战(纯函数,便于离线测试)。

命中任一即视为挑战页(而非真实内容): ① 响应头 cf-mitigated: challenge(最干净、机器可读); ② HTTP 403/503 且 body 含 Cloudflare 挑战脚本特征 (_cf_chl_opt / /cdn-cgi/challenge-platform/ / <title>Just a moment)。