jackwener/OpenCLI · error · CommandExecutionError
IMDb blocked this request
Error message
IMDb blocked this request
What it means
The imdb search command throws CommandExecutionError('IMDb blocked this request') when, after navigating to the IMDb /find/ URL, the page is detected as a bot-challenge page via isChallengePage(page). IMDb serves CAPTCHA or anti-bot interstitials instead of search results. The hint suggests retrying with a normal browser session or extension mode.
Source
Thrown at clis/imdb/search.js:32
browser: true,
args: [
{ name: 'query', positional: true, required: true, help: 'Search query' },
{ name: 'limit', type: 'int', default: 20, help: 'Number of results' },
],
columns: ['rank', 'id', 'title', 'year', 'type', 'url'],
func: async (page, args) => {
const query = String(args.query || '').trim();
// Reject empty or whitespace-only queries early
if (!query) {
throw new ArgumentError('Search query cannot be empty');
}
const limit = Math.max(1, Math.min(Number(args.limit) || 20, 50));
const url = forceEnglishUrl(`https://www.imdb.com/find/?q=${encodeURIComponent(query)}&ref_=nv_sr_sm`);
await page.goto(url);
const onSearchPage = await waitForImdbPath(page, '^/find/?$');
const searchReady = await waitForImdbSearchReady(page, 15000);
if (await isChallengePage(page)) {
throw new CommandExecutionError('IMDb blocked this request', 'Try again with a normal browser session or extension mode');
}
if (!onSearchPage || !searchReady) {
throw new CommandExecutionError('IMDb search results did not finish loading', 'Retry the command; if it persists, the search page structure may have changed');
}
const results = await page.evaluate(`
(function() {
var results = [];
function pushResult(item) {
if (!item || !item.id || !item.title) {
return;
}
results.push(item);
}
var nextDataEl = document.getElementById('__NEXT_DATA__');
if (nextDataEl) {
try {View on GitHub (pinned to 49907e53dc)
Solutions
- Retry later or from a different network/residential IP.
- Run with the extension-based / normal browser session mode so real cookies and fingerprint are used.
- Reduce request frequency and add delays between commands to avoid rate limiting.
- Clear browser state/cookies that may be flagged, or log in to IMDb in the controlled browser.
Example fix
// before
await imdbSearch({ query: 'inception' }); // fired in tight loop, got blocked
// after
await sleep(3000); // back off between requests
await imdbSearch({ query: 'inception', mode: 'extension' }); Defensive patterns
Strategy: retry
Try / catch
try {
return await imdbSearch({ query });
} catch (e) {
if (/IMDb blocked this request/.test(e.message)) {
await sleep(30_000);
return retryWithBackoff(() => imdbSearch({ query, mode: 'extension' }), { attempts: 3 });
}
throw e;
} Prevention
- Use the extension/normal browser session mode so real cookies and fingerprints are sent.
- Throttle and add jitter between requests; avoid tight loops over many queries.
- Run from residential IPs rather than datacenter/CI networks.
- Cache results to reduce repeat hits on IMDb.
When it happens
Trigger: page.goto of the IMDb find URL followed by waitForImdbPath and waitForImdbSearchReady succeed navigation-wise, but isChallengePage(page) returns true because IMDb presented a challenge/captcha page.
Common situations: Running from datacenter IPs or CI, heavy scripted usage triggering rate limiting, headless browser fingerprint detection, or cookies/session flagged by IMDb anti-bot protection.
Related errors
- IMDb blocked this request
- IMDb blocked this request
- IMDb blocked this request
- [taxonomy=selector_drift] site=jianyu command=search blocked
- 触发了验证码,请先在浏览器中完成验证
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/444844a1b1ff96b7.
Report an issue: GitHub.