jackwener/OpenCLI · warning · AuthRequiredError

[taxonomy=selector_drift] site=jianyu command=search blocked

Error message

[taxonomy=selector_drift] site=jianyu command=search blocked by human verification / access challenge

What it means

AuthRequiredError thrown by the jianyu search command when the search results are blocked by human verification or an access challenge. The search flow either received a challenge flag in the API result (apiResult.challenge) or the isAuthRequired(page) check detected an auth/challenge page, and it tags the error with taxonomy 'selector_drift' because challenge pages usually mean the site's normal DOM/API contract no longer holds.

Source

Thrown at clis/jianyu/search.js:588

                        ...row,
                        source_id: SITE,
                        notice_id: extractNoticeId(row.url),
                        published_at: publishedAt,
                        detail_status: detailSignal.detail_status,
                        detail_reason: detailSignal.detail_reason,
                    };
                }))
                    .filter((row) => row.detail_status === 'ok')
                    .filter((row) => sinceDays == null || isWithinSinceDays(row.published_at, sinceDays))
                    .slice(0, limit)
                    .map((row, index) => ({
                    ...row,
                    rank: index + 1,
                }));
                return enriched;
            }
            if (apiResult.challenge || await isAuthRequired(page)) {
                throw new AuthRequiredError(DOMAIN, '[taxonomy=selector_drift] site=jianyu command=search blocked by human verification / access challenge');
            }
        }
        const records = toProcurementSearchRecords(rows, {
            site: SITE,
            query,
            limit,
        });
        const enriched = dedupeByNoticeKey(records.map((row) => {
            const detailSignal = classifyDetailStatus(row.url);
            const publishedAt = normalizeDate(row.publish_time || row.date);
            return {
                ...row,
                source_id: SITE,
                notice_id: extractNoticeId(row.url),
                published_at: publishedAt,
                detail_status: detailSignal.detail_status,
                detail_reason: detailSignal.detail_reason,
            };

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Solve the CAPTCHA/challenge manually in the automated browser window, then re-run the search
  2. Slow down request rate and add delays between searches to avoid tripping rate limits
  3. Switch to a residential IP or disable the VPN/datacenter proxy being flagged
  4. Re-authenticate (opencli jianyu login) so search uses a valid logged-in session
  5. If challenges become persistent, update isAuthRequired/challenge detection in clis/jianyu/search.js for the new challenge markup

Example fix

// before: rapid loop trips challenge
for (const q of queries) await jianyuSearch(page, q);
// after: throttle and reuse authenticated session
for (const q of queries) {
  await jianyuSearch(page, q);
  await page.wait(5);
}
Defensive patterns

Strategy: retry

Validate before calling

if (await isAuthRequired(page)) {
  throw new Error('Jianyu is showing a verification page — solve the challenge in the browser before searching');
}

Type guard

function isChallengeBlocked(e) {
  return e instanceof Error && /blocked by human verification/.test(e.message);
}

Try / catch

try {
  rows = await jianyuSearch(page, query);
} catch (e) {
  if (isChallengeBlocked(e)) {
    await solveChallengeInBrowser(page); // pause for human CAPTCHA solve
    rows = await jianyuSearch(page, query); // retry once after solving
  } else throw e;
}

Prevention

When it happens

Trigger: Calling the jianyu search command when the site injects a CAPTCHA/slider challenge into the API response (apiResult.challenge truthy) or the rendered page matches isAuthRequired instead of returning result rows.

Common situations: Too many rapid searches from one IP triggering anti-bot rate limiting; datacenter/VPN IP flagged by Jianyu's WAF; expired session causing the search endpoint to redirect to a verification page; site security update adding new challenge types.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/c5c204065238b282. Report an issue: GitHub.