{"record":{"id":"e161c882f0def868","repo":"jackwener/OpenCLI","slug":"no-pixiv-bookmarks-matched-the-requested-page","errorCode":null,"errorMessage":"No Pixiv bookmarks matched the requested page.","messagePattern":"No Pixiv bookmarks matched the requested page\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/pixiv/bookmark-download.js","lineNumber":164,"sourceCode":"  strategy: Strategy.COOKIE,\n  args: [\n    { name: 'type', default: 'illust', help: 'Bookmark type: illust or novel' },\n    { name: 'limit', type: 'int', default: 20, help: 'Number of bookmarks to download' },\n    { name: 'offset', type: 'int', default: 0, help: 'Pagination offset' },\n    { name: 'visibility', default: 'show', help: 'Bookmark visibility: show(public) or hide(private)' },\n    { name: 'output', default: './pixiv-downloads/bookmarks', help: 'Output directory' },\n    { name: 'file-format', default: 'txt', help: 'Novel output file format: txt or md' },\n    { name: 'execute', type: 'boolean', default: false, help: 'Actually write the local archive' },\n  ],\n  columns: ['rank', 'type', 'id', 'title', 'download_status', 'path'],\n  func: async (page, kwargs) => {\n    requireExecute(kwargs.execute);\n    const type = normalizeBookmarkType(kwargs.type);\n    const format = normalizeNovelFileFormat(kwargs['file-format'] ?? kwargs.format ?? 'txt');\n    const outputRoot = normalizePixivOutputRoot(kwargs.output, './pixiv-downloads/bookmarks');\n    const rows = await fetchCurrentBookmarks(page, kwargs);\n    if (rows.length === 0) {\n      throw new EmptyResultError('pixiv bookmark-download', 'No Pixiv bookmarks matched the requested page.');\n    }\n\n    // Complete every API/schema/collision check before creating a file.\n    const plans = [];\n    for (const row of rows) {\n      if (type === 'novel') {\n        const body = await fetchNovelForDownload(page, row.novel_id);\n        plans.push({ ...prepareNovelFile(body, path.join(outputRoot, 'novel'), format), row });\n      } else {\n        plans.push({ ...await prepareIllustPlan(page, row, outputRoot), row });\n      }\n    }\n    const targets = new Set();\n    for (const plan of plans) {\n      const target = plan.kind === 'novel' ? plan.destPath : plan.finalPath;\n      if (targets.has(target)) {\n        throw new CommandExecutionError(`Pixiv bookmark archive contains a duplicate download target: ${target}`);\n      }","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pixiv/bookmark-download.js#L146-L182","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Lower the --page value (start at 1) and confirm bookmarks exist at that page","Log in to pixiv.net in the browser session to verify the bookmarks are still present and visible","Check that type/filter kwargs are not accidentally excluding all rows (e.g. wrong 'file-format' or type value)","Refresh/verify Pixiv cookies — expired sessions can yield empty lists","Catch EmptyResultError and treat it as a normal 'nothing to download' outcome"],"exampleFix":"// before: hard failure aborts the pipeline\nawait pixivBookmarkDownload({ page: 10 });\n// after: treat empty pages as end-of-list\ntry {\n  await pixivBookmarkDownload({ page: 10 });\n} catch (e) {\n  if (e.name === 'EmptyResultError') return; // no more bookmarks\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isEmptyResultError(e) {\n  return e instanceof Error && (e.name === 'EmptyResultError' || /No Pixiv bookmarks matched/.test(e.message));\n}","tryCatchPattern":"try {\n  await pixivBookmarkDownload({ page, type });\n} catch (err) {\n  if (err.name === 'EmptyResultError') return; // end of bookmarks — normal\n  throw err;\n}","preventionTips":["Start at page 1 and stop at the first EmptyResultError when walking pages","Verify bookmarks exist in the browser session before scripting","Check type/filters aren't excluding everything","Refresh cookies if a formerly non-empty page suddenly returns empty"],"tags":["pixiv","bookmarks","empty-result","pagination"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}