DIYgod/RSSHub · error

Unknown product: ${product}

Error message

Unknown product: ${product}

What it means

Generic Error thrown by the link-news route when the :product path parameter does not match one of the supported values ('live', 'vc', 'wh'). The switch statement's default case fires. This is a client-side validation error — the route was called with an unsupported product value.

Source

Thrown at lib/routes/bilibili/link-news.ts:38

};

async function handler(ctx) {
    const product = ctx.req.param('product');

    let productTitle: string;

    switch (product) {
        case 'live':
            productTitle = '直播';
            break;
        case 'vc':
            productTitle = '小视频';
            break;
        case 'wh':
            productTitle = '相簿';
            break;
        default:
            throw new Error(`Unknown product: ${product}`);
    }

    const response = await got({
        method: 'get',
        url: `https://api.vc.bilibili.com/news/v1/notice/list?platform=pc&product=${product}&category=all&page_no=1&page_size=20`,
        headers: {
            Referer: 'https://link.bilibili.com/p/eden/news',
        },
    });
    const data = response.data.data.items;

    return {
        title: `bilibili ${productTitle}公告`,
        link: `https://link.bilibili.com/p/eden/news#/?tab=${product}&tag=all&page_no=1`,
        description: `bilibili ${productTitle}公告`,
        item:
            data &&
            data.map((item) => ({

View on GitHub (pinned to bed535e087)

Solutions

  1. Use one of the three valid product values: 'live' (直播), 'vc' (小视频), or 'wh' (相簿).
  2. Check the route definition / API docs for the accepted parameter values.
  3. Fix the subscription URL in your RSS reader to use a valid product.

Example fix

// before
// /bilibili/link/news/video

// after
// /bilibili/link/news/live
// or
// /bilibili/link/news/vc
// or
// /bilibili/link/news/wh
Defensive patterns

Strategy: validation

Validate before calling

const validProducts = ['live', 'vc', 'wh'] as const;
if (!validProducts.includes(product as any)) {
    throw new Error(`Invalid product '${product}'. Valid: ${validProducts.join(', ')}`);
}

Type guard

function isValidProduct(product: string): product is 'live' | 'vc' | 'wh' {
    return product === 'live' || product === 'vc' || product === 'wh';
}

Prevention

When it happens

Trigger: Requesting /bilibili/link/news/:product with a product value other than 'live', 'vc', or 'wh' (e.g., 'video', 'article', 'manga', or a typo).

Common situations: User guessed the route parameter incorrectly; typo in the subscription URL; outdated documentation suggesting a parameter value that was never supported.

Related errors


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