DIYgod/RSSHub · error · Error

未获取到数据!

Error message

未获取到数据!

What it means

Generic Error ('No data retrieved!') thrown when the Miyoushe image-ranking API returns HTTP 200 but response.data.data.list is missing. The upstream call succeeded but the expected list array is absent — typically an empty result for that ranking/cate combination or an upstream envelope change.

Source

Thrown at lib/routes/mihoyo/bbs/img-ranking.ts:135

    }
    const { cate_id, title: cate_title } = getCateInfo(game, forum_type, cate_type);
    const { id: type, title: type_title } = getRankingTypeInfo(game, ranking_type);
    const query = new URLSearchParams({
        gids,
        forum_id,
        cate_id,
        type,
        page_size,
        last_id,
    }).toString();
    const url = `https://bbs-api.miyoushe.com/post/wapi/getImagePostList?${query}`;
    const response = await got({
        method: 'get',
        url,
    });
    const list = response?.data?.data?.list;
    if (!list) {
        throw new Error('未获取到数据!');
    }
    const title = `米游社-${game_title}-${forum_title}${cate_title ? `-${cate_title}` : ''}-${type_title}`;
    const items = list.map((e) => post2item(e));
    const data = {
        title,
        link: url,
        item: items,
    };
    return data;
}

View on GitHub (pinned to bed535e087)

Solutions

  1. Try the default rankingType=daily and cateType=illustration to confirm the route works for that game.
  2. Retry after a few minutes in case of a transient empty response.
  3. Verify cateType is valid for the game/forum combination (see route description table).
  4. If persistent, report an envelope change to maintainers.

Example fix

// before
// /mihoyo/bbs/img-ranking/ys/forumType=tongren&cateType=qute&rankingType=daily

// after
// /mihoyo/bbs/img-ranking/ys/forumType=tongren&cateType=illustration&rankingType=daily
Defensive patterns

Strategy: retry

Validate before calling

// Validate combination shape before calling API
const { cate_id } = getCateInfo(game, forum_type, cate_type);
if (!cate_id) throw new Error('Invalid cateType for this game/forum');

Type guard

function hasRankingList(res: any): boolean {
    return Array.isArray(res?.data?.data?.list);
}

Try / catch

try {
    const list = response?.data?.data?.list;
    if (!list) throw new Error('No ranking data yet — retry later');
} catch (e) { /* retry or return allowEmpty */ }

Prevention

When it happens

Trigger: got(getImagePostList) resolves, but response.data.data.list is falsy. Happens when cate_id/ranking_type combination yields no posts, the game's ranking is temporarily empty, or the API returned an error envelope with HTTP 200.

Common situations: Asking for a weekly/monthly ranking that hasn't been populated yet; an invalid cate_type for that forum; upstream transient error; API envelope changed.

Related errors


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