DIYgod/RSSHub · warning

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

Error message

Fanfou 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 fanfou home-timeline route when any of config.fanfou.consumer_key, consumer_secret, username, or password is missing. Identical guard to the other fanfou routes; the home timeline is an authenticated-only endpoint.

Source

Thrown at lib/routes-deprecated/fanfou/home-timeline.js:6

const config = require('@/config').value;
const utils = require('./utils');

module.exports = async (ctx) => {
    if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) {
        throw new Error('Fanfou RSS is disabled due to the lack of <a href="https://docs.rsshub.app/deploy/config#route-specific-configurations">relevant config</a>');
    }

    const fanfou = await utils.getFanfou();
    const timeline = await fanfou.get('/statuses/home_timeline', { mode: 'lite', format: 'html' });

    const result = timeline.map((item) => {
        let img_html = '';
        if (item.photo) {
            img_html = `<br/><img src="${item.photo.originurl}" alt="饭否动态图片"/>`;
        }
        return {
            title: item.plain_text,
            author: item.user.name,
            description: item.text + img_html,
            pubDate: item.created_at,
            link: `http://fanfou.com/statuses/${item.id}`,
        };
    });

View on GitHub (pinned to bed535e087)

Solutions

  1. Set all four FANFOU_* env vars and restart.
  2. Remove the route from clients if fanfou is not used.

Example fix

# before
# (partial or no fanfou config)
# after
FANFOU_CONSUMER_KEY=...
FANFOU_CONSUMER_SECRET=...
FANFOU_USERNAME=...
FANFOU_PASSWORD=...
Defensive patterns

Strategy: validation

Validate before calling

const f = config.fanfou;
const ok = f && f.consumer_key && f.consumer_secret && f.username && f.password;
if (!ok) throw new Error('Fanfou RSS is disabled ...');

Type guard

const isFanfouConfigured = (c: any): boolean =>
  !!c?.fanfou?.consumer_key && !!c?.fanfou?.consumer_secret &&
  !!c?.fanfou?.username && !!c?.fanfou?.password;

Prevention

When it happens

Trigger: Any of the four FANFOU_* env vars is unset when /fanfou/home-timeline is requested.

Common situations: Same as other fanfou routes: optional config omitted, partial, or renamed during deploy.

Related errors


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