DIYgod/RSSHub · error · ConfigNotFoundError
huitun RSS is disabled due to the lack of <a href="https://d
Error message
huitun RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>
What it means
Thrown by the Huitun (灰豚数据) Xiaohongshu route when the RSSHub instance configuration does not include `config.huitun.cookie`. The Huitun API requires an authenticated session cookie to search for anchors and fetch notes. RSSHub's `ConfigNotFoundError` maps to an HTTP 502 response indicating the route is not configured. The route's `features.requireConfig` declares the `HUITUN_COOKIE` environment variable as required.
Source
Thrown at lib/routes/huitun/xiaohongshu.ts:33
name: 'HUITUN_COOKIE',
description: '灰豚数据 cookie 值',
},
],
requirePuppeteer: false,
antiCrawler: true,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
description: '免费版账户每天查询次数为 10 次,若需增加查询次数请购买灰豚数据红薯版会员',
name: '小红书笔记',
maintainers: ['Skylwn'],
handler,
};
async function handler(ctx) {
if (!config.huitun || !config.huitun.cookie) {
throw new ConfigNotFoundError('huitun RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>');
}
const cookie = config.huitun.cookie;
const uid = ctx.req.param('user_id');
const response_user = await got({
method: 'get',
url: 'https://xhsapi.huitun.com/anchor/search/v2?keyword=' + uid,
headers: {
Cookie: cookie,
},
});
const user_data = JSON.parse(response_user.body);
const anchorId = user_data.extData.list[0].anchorId;
const name = user_data.extData.list[0].nick;
const response_note = await got({
method: 'get',
url: 'https://xhsapi.huitun.com/anchor/detail/notesV2?sort=0&anchorId=' + anchorId,
headers: {
Cookie: cookie,View on GitHub (pinned to bed535e087)
Solutions
- Set `HUITUN_COOKIE` in the RSSHub environment configuration (`.env` or config file): add a `huitun: { cookie: 'your_cookie_here' }` entry.
- Obtain the cookie by logging into huitun.com, opening browser DevTools → Network, and copying the `Cookie` header from an authenticated API request.
- Note the free tier limits queries to 10/day; consider caching behavior and whether the cookie's quota is exhausted.
Example fix
// config (.env) // before: HUITUN_COOKIE is unset // after: // HUITUN_COOKIE=PHPSESSID=xxxxx; other_cookie=yyyyy;
Defensive patterns
Strategy: validation
Validate before calling
import { config } from '@/config';
function isHuitunConfigured(): boolean {
return Boolean(config.huitun?.cookie);
}
// The route already checks this at handler entry. Callers can check:
if (!isHuitunConfigured()) {
throw new ConfigNotFoundError('HUITUN_COOKIE is not set');
} Type guard
function hasHuitunCookie(cfg: typeof config): cfg is typeof config & { huitun: { cookie: string } } {
return Boolean(cfg.huitun?.cookie);
} Prevention
- Set `HUITUN_COOKIE` in the deployment environment before subscribing to this route.
- Document the cookie acquisition process (browser DevTools → Network → copy Cookie header).
- Monitor for cookie expiration — Huitun sessions may time out, requiring re-extraction.
- Note the free-tier daily query limit (10/day) when sharing the instance.
When it happens
Trigger: Calling `/huitun/xiaohongshu/<user_id>` on an RSSHub instance where the `HUITUN_COOKIE` config key is not set. This check runs before any network request.
Common situations: Self-hosted RSSHub deployment that didn't set the `HUITUN_COOKIE` environment variable, the cookie expired and was removed, or the config file is missing the `huitun` section entirely.
Related errors
- Last.fm RSS is disabled due to the lack of <a href="https://
- Last.fm RSS is disabled due to the lack of <a href="https://
- Last.fm RSS is disabled due to the lack of <a href="https://
- This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN
- This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/dbe141e0f4e21737.
Report an issue: GitHub.