{"record":{"id":"97ce959818675680","repo":"jackwener/OpenCLI","slug":"imdb-blocked-this-request-97ce95","errorCode":null,"errorMessage":"IMDb blocked this request","messagePattern":"IMDb blocked this request","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/imdb/title.js","lineNumber":25,"sourceCode":"cli({\n    site: 'imdb',\n    name: 'title',\n    access: 'read',\n    description: 'Get movie or TV show details',\n    domain: 'www.imdb.com',\n    strategy: Strategy.PUBLIC,\n    browser: true,\n    args: [\n        { name: 'id', positional: true, required: true, help: 'IMDb title ID (tt1375666) or URL' },\n    ],\n    columns: ['field', 'value'],\n    func: async (page, args) => {\n        const id = normalizeImdbId(String(args.id), 'tt');\n        const url = forceEnglishUrl(`https://www.imdb.com/title/${id}/`);\n        await page.goto(url);\n        const onTitlePage = await waitForImdbPath(page, `^/title/${id}/`);\n        if (await isChallengePage(page)) {\n            throw new CommandExecutionError('IMDb blocked this request', 'Try again with a normal browser session or extension mode');\n        }\n        if (!onTitlePage) {\n            throw new CommandExecutionError(`Title page did not finish loading: ${id}`, 'Retry the command; if it persists, IMDb may have changed their navigation flow');\n        }\n        const currentId = await getCurrentImdbId(page, 'tt');\n        if (currentId && currentId !== id) {\n            throw new CommandExecutionError(`IMDb redirected to a different title: ${currentId}`, 'Retry the command; if it persists, the title page may have changed');\n        }\n        // Single browser roundtrip: fetch title JSON-LD by type whitelist\n        const titleTypes = ['Movie', 'TVSeries', 'TVEpisode', 'TVMiniseries', 'TVMovie', 'TVSpecial', 'VideoGame', 'ShortFilm'];\n        const ld = await extractJsonLd(page, titleTypes);\n        if (!ld) {\n            throw new CommandExecutionError(`Title not found: ${id}`, 'Check the title ID and try again');\n        }\n        const data = ld;\n        const type = String(data['@type'] || '');\n        const isTvSeries = type === 'TVSeries' || type === 'TVMiniseries';\n        // Handle both array and single-object JSON-LD person fields","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/imdb/title.js#L7-L43","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Retry with a normal browser session or extension mode so real cookies/fingerprint are used.","Throttle requests (add delays, batch fewer IDs) to avoid triggering rate limits.","Switch network/IP (residential proxy or different host) if blocked repeatedly.","Log in to IMDb in the automated browser or clear flagged cookies, then retry."],"exampleFix":"// before\nfor (const id of ids) await imdbTitle({ id }); // hammering 100 ids\n// after\nfor (const id of ids) {\n  await imdbTitle({ id, mode: 'extension' });\n  await sleep(2000);\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await imdbTitle({ id });\n} catch (e) {\n  if (/IMDb blocked this request/.test(e.message)) {\n    await sleep(60_000);\n    return retryWithBackoff(() => imdbTitle({ id, mode: 'extension' }), { attempts: 3 });\n  }\n  throw e;\n}","preventionTips":["Reuse a logged-in, real-browser (extension mode) session for bulk title fetches.","Rate-limit batch jobs (e.g. 1-2 seconds between title requests).","Avoid datacenter IPs; use residential networks for scraping IMDb.","Cache title data locally since title metadata is largely static."],"tags":["anti-bot","captcha","network","rate-limit"],"backgroundTag":"bot-detection-blocked","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}