jackwener/OpenCLI · warning · EmptyResultError
No images found for illustration ${illustId}.
Error message
No images found for illustration ${illustId}. What it means
An EmptyResultError thrown when the pixiv pages API responded successfully but the returned array contains zero images. The illustration exists (or at least did not 404) but has no downloadable pages.
Source
Thrown at clis/pixiv/download.js:40
{ name: 'illust-id', positional: true, required: true, help: 'Illustration ID' },
{ name: 'output', default: './pixiv-downloads', help: 'Output directory' },
],
columns: ['index', 'type', 'status', 'size'],
func: async (page, kwargs) => {
const illustId = String(kwargs['illust-id'] ?? '');
const output = String(kwargs.output ?? './pixiv-downloads');
if (!/^\d+$/.test(illustId)) {
throw new CommandExecutionError(`Invalid illustration ID: ${illustId}`);
}
// pixivFetch handles navigate + error checking; returns the response body directly
const pages = await pixivFetch(page, `/ajax/illust/${illustId}/pages`, {
notFoundMsg: `Illustration not found: ${illustId}`,
});
if (!Array.isArray(pages)) {
throw new CommandExecutionError('Pixiv pages API returned malformed payload');
}
if (pages.length === 0) {
throw new EmptyResultError('pixiv download', `No images found for illustration ${illustId}.`);
}
// Extract cookies for authenticated downloads
const cookies = formatCookieHeader(await page.getCookies({ domain: 'pixiv.net' }));
// Create output directory
const outputDir = path.join(output, illustId);
fs.mkdirSync(outputDir, { recursive: true });
const results = [];
for (let i = 0; i < pages.length; i++) {
const p = pages[i];
const url = p.urls?.original || p.urls?.regular || '';
if (!url) {
results.push({ index: i + 1, type: 'image', status: 'failed', size: 'No URL' });
continue;
}
try {
const ext = path.extname(new URL(url).pathname) || '.jpg';
const filename = `${illustId}_p${i}${ext}`;
const destPath = path.join(outputDir, filename);View on GitHub (pinned to 49907e53dc)
Solutions
- Log in and export valid pixiv cookies (including age-verification for R-18) and retry
- Verify the artwork is still public by opening its pixiv page in a browser
- Try a different illustration ID to confirm your session works at all
- If R-18, enable the R-18 setting on your pixiv account before exporting cookies
Defensive patterns
Strategy: fallback
Validate before calling
// Verify accessibility before downloading
const res = await fetch(`https://www.pixiv.net/artworks/${illustId}`);
if (!res.ok) throw new Error(`Artwork ${illustId} not publicly accessible`); Try / catch
try {
await pixivDownload({ illustId });
} catch (e) {
if (e instanceof EmptyResultError || /No images found/.test(e.message)) {
console.warn(`Skipping ${illustId}: no visible pages (R-18/deleted/private?)`);
} else throw e;
} Prevention
- Use a logged-in, age-verified pixiv session for R-18 works
- Check the artwork page in a browser before bulk downloads
- Treat EmptyResultError as skippable in bulk scripts
- Remove deleted/private IDs from your download list
When it happens
Trigger: The illustration is R-18/restricted and the current session cannot see its pages, the work was deleted or made private after the ID was resolved, or pixiv returns an empty pages list for the ID.
Common situations: Downloading R-18 content without an authenticated/age-verified cookie session; using a stale ID for a since-deleted artwork; region-restricted works.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- No images found for illustration ${row.illust_id}.
- No Pixiv bookmarks matched the requested page.
- No prices returned for train_no=${trainNo} ${fromStation.nam
- No 12306 stations match "${keyword}"
- No trains found from ${fromStation.name} to ${toStation.name
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/e9ef304a0b5a7949.
Report an issue: GitHub.