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 public-timeline route when any of config.fanfou.consumer_key, consumer_secret, username, or password is missing. The public search endpoint still requires authenticated OAuth credentials in fanfou's model.

Source

Thrown at lib/routes-deprecated/fanfou/public-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 keyword = ctx.params.keyword;
    const fanfou = await utils.getFanfou();
    const timeline = await fanfou.get('/search/public_timeline', { q: keyword, 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: `https://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/public-timeline/:keyword is requested.

Common situations: Optional fanfou config omitted, partial, or renamed.

Related errors


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