One function

classify_login_probe_response in eatmoreduck/boss-zhipin-scraper

The author described this change as fix: 登录探测识别风控 code 37 及未知风控码,不再误判已登录用户 (#33) (#34). It counts as a record because the check below fails on the code as it stood at 80e20c8b6 and passes on d150a2cea, with nothing else changed between the two runs.

Fix saved2026-07-17
Sharing licenceMIT · LICENSE
Change size+4 0

What the code was meant to do, written into the code itself as a docstring

Classify a BOSS search response without collapsing failures to bool.

The change

3333 if code in LOGIN_RESTRICTED_CODES:
3434 return LoginProbeResult(LoginProbeStatus.RESTRICTED, code=code, message=message)
3535 if code != 0:
36+ # code 不在已知风控码集合里时,再按 message 关键字兜底判定是否风控,
37+ # 避免新风控码被当成不可恢复的 RESPONSE_ERROR 误拦已登录用户。
38+ if any(kw in message for kw in LOGIN_RESTRICTED_MESSAGE_KEYWORDS):
39+ return LoginProbeResult(LoginProbeStatus.RESTRICTED, code=code, message=message)
3640 return LoginProbeResult(LoginProbeStatus.RESPONSE_ERROR, code=code, message=message)
3741
3842 zp_data = data.get("zpData")

The check that tells the two apart

failpass·tests/test_chrome_setup.py::ChromeSetupTests::test_login_probe_classifies_distinct_failure_states

Check file tests/test_chrome_setup.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it80e20c8b6939aba3c450bf2a3e1ba5d159a300d6
Broken version dated2026-07-16
Modulescripts.boss_cdp_raw
Units changedclassify_login_probe_response
Fingerprintecb3bb26826f1f61
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.