jackwener/OpenCLI · warning · EmptyResultError

No Pixiv bookmarks matched the requested page.

Error message

No Pixiv bookmarks matched the requested page.

What it means

Before doing any work, bookmark-download fetches the requested bookmark page and requires at least one row. This EmptyResultError is thrown when fetchCurrentBookmarks returns an empty array, i.e. Pixiv reported zero bookmarks matching the requested page, type, and filters. It is a deliberate early exit so no partial archive is created.

Source

Thrown at clis/pixiv/bookmark-download.js:164

  strategy: Strategy.COOKIE,
  args: [
    { name: 'type', default: 'illust', help: 'Bookmark type: illust or novel' },
    { name: 'limit', type: 'int', default: 20, help: 'Number of bookmarks to download' },
    { name: 'offset', type: 'int', default: 0, help: 'Pagination offset' },
    { name: 'visibility', default: 'show', help: 'Bookmark visibility: show(public) or hide(private)' },
    { name: 'output', default: './pixiv-downloads/bookmarks', help: 'Output directory' },
    { name: 'file-format', default: 'txt', help: 'Novel output file format: txt or md' },
    { name: 'execute', type: 'boolean', default: false, help: 'Actually write the local archive' },
  ],
  columns: ['rank', 'type', 'id', 'title', 'download_status', 'path'],
  func: async (page, kwargs) => {
    requireExecute(kwargs.execute);
    const type = normalizeBookmarkType(kwargs.type);
    const format = normalizeNovelFileFormat(kwargs['file-format'] ?? kwargs.format ?? 'txt');
    const outputRoot = normalizePixivOutputRoot(kwargs.output, './pixiv-downloads/bookmarks');
    const rows = await fetchCurrentBookmarks(page, kwargs);
    if (rows.length === 0) {
      throw new EmptyResultError('pixiv bookmark-download', 'No Pixiv bookmarks matched the requested page.');
    }

    // Complete every API/schema/collision check before creating a file.
    const plans = [];
    for (const row of rows) {
      if (type === 'novel') {
        const body = await fetchNovelForDownload(page, row.novel_id);
        plans.push({ ...prepareNovelFile(body, path.join(outputRoot, 'novel'), format), row });
      } else {
        plans.push({ ...await prepareIllustPlan(page, row, outputRoot), row });
      }
    }
    const targets = new Set();
    for (const plan of plans) {
      const target = plan.kind === 'novel' ? plan.destPath : plan.finalPath;
      if (targets.has(target)) {
        throw new CommandExecutionError(`Pixiv bookmark archive contains a duplicate download target: ${target}`);
      }

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Lower the --page value (start at 1) and confirm bookmarks exist at that page
  2. Log in to pixiv.net in the browser session to verify the bookmarks are still present and visible
  3. Check that type/filter kwargs are not accidentally excluding all rows (e.g. wrong 'file-format' or type value)
  4. Refresh/verify Pixiv cookies — expired sessions can yield empty lists
  5. Catch EmptyResultError and treat it as a normal 'nothing to download' outcome

Example fix

// before: hard failure aborts the pipeline
await pixivBookmarkDownload({ page: 10 });
// after: treat empty pages as end-of-list
try {
  await pixivBookmarkDownload({ page: 10 });
} catch (e) {
  if (e.name === 'EmptyResultError') return; // no more bookmarks
  throw e;
}
Defensive patterns

Strategy: try-catch

Type guard

function isEmptyResultError(e) {
  return e instanceof Error && (e.name === 'EmptyResultError' || /No Pixiv bookmarks matched/.test(e.message));
}

Try / catch

try {
  await pixivBookmarkDownload({ page, type });
} catch (err) {
  if (err.name === 'EmptyResultError') return; // end of bookmarks — normal
  throw err;
}

Prevention

When it happens

Trigger: The command's page number is beyond the last page of the user's bookmarks, or the bookmark list is genuinely empty for the requested type (illust/novel) and filters passed via kwargs.

Common situations: Requesting page 50 when the user only has 3 pages of bookmarks; bookmarks were un-liked/deleted since a previous run; filtering options exclude everything; the logged-in account has no bookmarks of the requested type; cookies expired and Pixiv returns an empty list instead of a login page.

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


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