DIYgod/RSSHub · error · ConfigNotFoundError

newrank RSS is disabled due to the lack of <a href="https://

Error message

newrank 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

Identical guard to the Douyin route, but in the newrank WeChat (公众号) route. It throws ConfigNotFoundError when config.newrank.cookie is missing, because the route must send an authenticated Cookie to newrank's article-list API. The HTML link in the message points operators at the route-specific config docs.

Source

Thrown at lib/routes/newrank/wechat.ts:36

            {
                name: 'NEWRANK_COOKIE',
                description: '',
            },
        ],
        requirePuppeteer: false,
        antiCrawler: true,
        supportBT: false,
        supportPodcast: false,
        supportScihub: false,
    },
    name: '微信公众号',
    maintainers: ['lessmoe', 'pseudoyu'],
    handler,
};

async function handler(ctx) {
    if (!config.newrank || !config.newrank.cookie) {
        throw new ConfigNotFoundError('newrank RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>');
    }
    const uid = ctx.req.param('wxid');
    const nonce = utils.random_nonce(9);
    const { data: summaryHTML } = await got({
        method: 'get',
        url: `https://www.newrank.cn/new/readDetial?account=${uid}`,
        headers: {
            Connection: 'keep-alive',
            Cookie: config.newrank.cookie,
        },
    });
    const summary$ = load(summaryHTML);
    const mainsrc = summary$('script')
        .toArray()
        .find((item) => (item.attribs.src || '').startsWith('/new/static/js/main.'))!.attribs.src;
    const { data: mainScript } = await got({
        method: 'get',
        url: `https://www.newrank.cn${mainsrc}`,

View on GitHub (pinned to bed535e087)

Solutions

  1. Set NEWRANK_COOKIE in the environment to the full Cookie string from a logged-in newrank.cn session and restart RSSHub.
  2. Confirm the cookie works by hitting the route once after restart; an expired cookie passes this check but fails later at the N-Token or API step.
  3. If multiple newrank routes are used, the single NEWRANK_COOKIE covers both douyin and wechat routes — configure it once.

Example fix

// before
if (!config.newrank || !config.newrank.cookie) {
    throw new ConfigNotFoundError('newrank RSS is disabled ...');
}

// after — set env: export NEWRANK_COOKIE='<cookie>'
Defensive patterns

Strategy: validation

Validate before calling

if (!process.env.NEWRANK_COOKIE) {
  console.error('NEWRANK_COOKIE missing — /newrank/wechat/* will throw ConfigNotFoundError.');
}

Type guard

const isNewrankConfigured = (): boolean =>
  Boolean(config.newrank && typeof config.newrank.cookie === 'string' && config.newrank.cookie.trim());

Try / catch

try { await fetch('/newrank/wechat/<id>'); }
catch (e) {
  if (/disabled due to the lack/.test(e.message)) { /* operator config issue, no retry */ }
  else throw e;
}

Prevention

When it happens

Trigger: Requesting /newrank/wechat/:wxid when NEWRANK_COOKIE is unset or empty. Same shape as 401 but for the WeChat endpoint — the handler needs the cookie for both the readDetial page fetch and the gw.newrank.cn API call.

Common situations: Self-hosted RSSHub without the newrank cookie configured; cookie removed during a config cleanup; deploying from a template env that omits NEWRANK_COOKIE.

Related errors


AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12). Data as JSON: /api/errors/ee0e2b998ebe6fc7. Report an issue: GitHub.