jackwener/OpenCLI · error · CommandExecutionError

IMDb blocked this request

Error message

IMDb blocked this request

What it means

The imdb title command throws CommandExecutionError('IMDb blocked this request') when, after navigating to https://www.imdb.com/title/<id>/, isChallengePage(page) detects an anti-bot challenge page. IMDb replaced the title page with a CAPTCHA/interstitial, so the command aborts before extracting JSON-LD data.

Source

Thrown at clis/imdb/title.js:25

cli({
    site: 'imdb',
    name: 'title',
    access: 'read',
    description: 'Get movie or TV show details',
    domain: 'www.imdb.com',
    strategy: Strategy.PUBLIC,
    browser: true,
    args: [
        { name: 'id', positional: true, required: true, help: 'IMDb title ID (tt1375666) or URL' },
    ],
    columns: ['field', 'value'],
    func: async (page, args) => {
        const id = normalizeImdbId(String(args.id), 'tt');
        const url = forceEnglishUrl(`https://www.imdb.com/title/${id}/`);
        await page.goto(url);
        const onTitlePage = await waitForImdbPath(page, `^/title/${id}/`);
        if (await isChallengePage(page)) {
            throw new CommandExecutionError('IMDb blocked this request', 'Try again with a normal browser session or extension mode');
        }
        if (!onTitlePage) {
            throw new CommandExecutionError(`Title page did not finish loading: ${id}`, 'Retry the command; if it persists, IMDb may have changed their navigation flow');
        }
        const currentId = await getCurrentImdbId(page, 'tt');
        if (currentId && currentId !== id) {
            throw new CommandExecutionError(`IMDb redirected to a different title: ${currentId}`, 'Retry the command; if it persists, the title page may have changed');
        }
        // Single browser roundtrip: fetch title JSON-LD by type whitelist
        const titleTypes = ['Movie', 'TVSeries', 'TVEpisode', 'TVMiniseries', 'TVMovie', 'TVSpecial', 'VideoGame', 'ShortFilm'];
        const ld = await extractJsonLd(page, titleTypes);
        if (!ld) {
            throw new CommandExecutionError(`Title not found: ${id}`, 'Check the title ID and try again');
        }
        const data = ld;
        const type = String(data['@type'] || '');
        const isTvSeries = type === 'TVSeries' || type === 'TVMiniseries';
        // Handle both array and single-object JSON-LD person fields

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry with a normal browser session or extension mode so real cookies/fingerprint are used.
  2. Throttle requests (add delays, batch fewer IDs) to avoid triggering rate limits.
  3. Switch network/IP (residential proxy or different host) if blocked repeatedly.
  4. Log in to IMDb in the automated browser or clear flagged cookies, then retry.

Example fix

// before
for (const id of ids) await imdbTitle({ id }); // hammering 100 ids
// after
for (const id of ids) {
  await imdbTitle({ id, mode: 'extension' });
  await sleep(2000);
}
Defensive patterns

Strategy: retry

Try / catch

try {
  return await imdbTitle({ id });
} catch (e) {
  if (/IMDb blocked this request/.test(e.message)) {
    await sleep(60_000);
    return retryWithBackoff(() => imdbTitle({ id, mode: 'extension' }), { attempts: 3 });
  }
  throw e;
}

Prevention

When it happens

Trigger: page.goto of the title URL completes and waitForImdbPath runs, but isChallengePage(page) returns true — the served page is a bot challenge rather than the title page.

Common situations: Scraping many title IDs in sequence from a datacenter IP, headless browser detection, flagged cookies, or running in CI where IMDb's protection is stricter.

Related errors


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