{"record":{"id":"49411e5c1bbb49cc","repo":"DIYgod/RSSHub","slug":"pixiv-rss-is-disabled-due-to-the-lack-of-a-href-49411e","errorCode":null,"errorMessage":"pixiv RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>","messagePattern":"pixiv RSS is disabled due to the lack of <a href=\"https://docs\\.rsshub\\.app/deploy/config#route-specific-configurations\">relevant config</a>","errorType":"error_code","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/pixiv/user.ts","lineNumber":38,"sourceCode":"        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n        nsfw: true,\n    },\n    radar: [\n        {\n            source: ['www.pixiv.net/users/:id', 'www.pixiv.net/en/users/:id'],\n        },\n    ],\n    name: 'User Activity',\n    maintainers: ['DIYgod'],\n    handler,\n};\n\nasync function handler(ctx) {\n    if (!config.pixiv || !config.pixiv.refreshToken) {\n        throw new ConfigNotFoundError('pixiv RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>');\n    }\n\n    const id = ctx.req.param('id');\n    const token = await getToken();\n    if (!token) {\n        throw new ConfigNotFoundError('pixiv not login');\n    }\n\n    const response = await getIllusts(id, token);\n\n    const illusts = response.data.illusts;\n    const username = illusts[0].user.name;\n\n    return {\n        title: `${username} 的 pixiv 动态`,\n        link: `https://www.pixiv.net/users/${id}`,\n        image: pixivUtils.getProxiedImageUrl(illusts[0].user.profile_image_urls.medium),\n        description: `${username} 的 pixiv 最新动态`,","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/pixiv/user.ts#L20-L56","documentation":"ConfigNotFoundError thrown at the top of the pixiv user-activity handler when config.pixiv or config.pixiv.refreshToken is falsy. The /v1/user/illusts call needs a bearer token, so the route requires credentials for any user, R18 or not.","triggerScenarios":"Requesting /pixiv/user/:id without PIXIV_REFRESHTOKEN set; handler aborts before resolving the user id.","commonSituations":"Fresh install; env var dropped; operator expecting the user route to work unauthenticated like some SFW novel paths.","solutions":["Set PIXIV_REFRESHTOKEN in the environment and restart.","Verify the token is loaded into config.pixiv.refreshToken.","There is no unauthenticated fallback for this route; credentials are mandatory.","Check the env source (file, Docker, secrets manager) actually provides the value."],"exampleFix":"// before: PIXIV_REFRESHTOKEN unset\n// after (in .env):\nPIXIV_REFRESHTOKEN=your_refresh_token_here","handlingStrategy":"validation","validationCode":"import { config } from '@/config';\nfunction canFetchUserActivity(): boolean {\n  return Boolean(config.pixiv && config.pixiv.refreshToken);\n}\nif (!canFetchUserActivity()) {\n  // user route has no SFW fallback; require token\n}","typeGuard":"const hasPixivAuth = (c: typeof config): c is typeof config & { pixiv: { refreshToken: string } } =>\n  Boolean(c.pixiv && typeof c.pixiv.refreshToken === 'string' && c.pixiv.refreshToken.length > 0);","tryCatchPattern":"try {\n  // user handler body\n} catch (e) {\n  if (e instanceof ConfigNotFoundError) {\n    // user activity needs auth: surface config guidance\n  }\n}","preventionTips":["The user-activity route is auth-only; do not expose it without credentials.","Reuse a shared hasPixivAuth() guard across pixiv routes.","Validate token presence at startup."],"tags":["pixiv","config","authentication","user"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}