DIYgod/RSSHub · error · Error
${game_title} 的排行榜不存在!
Error message
${game_title} 的排行榜不存在! What it means
Generic Error ('<game> 的排行榜不存在!' = 'ranking does not exist for <game>') thrown when the resolved forum_id is falsy. The game is known (375 passed) but the combination of game + forum_type does not map to a forum — e.g. requesting a 'cos' forum for a game that only has 'tongren'.
Source
Thrown at lib/routes/mihoyo/bbs/img-ranking.ts:116
排行榜类型
| 日榜 | 周榜 | 月榜 |
| ----- | ------ | ------- |
| daily | weekly | monthly |`,
};
async function handler(ctx) {
const game = ctx.req.param('game');
const routeParams = Object.fromEntries(new URLSearchParams(ctx.req.param('routeParams')));
const { forumType: forum_type = 'tongren', cateType: cate_type, rankingType: ranking_type, lastId: last_id = '' } = routeParams;
const page_size = ctx.req.query('limit') || '20';
const { gids, title: game_title } = getGameInfo(game);
if (!gids) {
throw new Error('未知的游戏!');
}
const { forum_id, title: forum_title } = getForumInfo(game, forum_type);
if (!forum_id) {
throw new Error(`${game_title} 的排行榜不存在!`);
}
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) {View on GitHub (pinned to bed535e087)
Solutions
- Omit forumType or use forumType=tongren (the universal default).
- Only use forumType=cos for games that document a COS榜 (ys, dby).
- Check the route's description table for which forumType values each game supports.
- Verify spelling: values are lowercase (tongren, cos).
Example fix
// before // /mihoyo/bbs/img-ranking/bh2/forumType=cos -> bh2 has no cos forum // after // /mihoyo/bbs/img-ranking/bh2/forumType=tongren
Defensive patterns
Strategy: validation
Validate before calling
const { forum_id } = getForumInfo(game, forum_type);
if (!forum_id) {
throw new Error(`${game_title} has no forum '${forum_type}'. Use forumType=tongren.`);
} Type guard
function forumExists(game: string, forum_type: string): boolean {
return Boolean(DATA_MAP[game]?.forums?.[forum_type]?.forum_id);
} Prevention
- Default forumType to 'tongren' (always valid).
- Document per-game forum support in the route table.
- Validate the combination before calling the API.
When it happens
Trigger: getForumInfo(game, forum_type) returns forum_id undefined because DATA_MAP[game].forums[forum_type] is missing. The default forum_type is 'tongren'; only some games (ys, dby) have a 'cos' forum.
Common situations: Setting forumType=cos for a game without a COS ranking (e.g. bh2, wd); typo in forumType value; requesting a forum that was removed from DATA_MAP.
Related errors
- 未知的游戏!
- Invalid type parameter
- unknown site: ${site}
- Invalid type parameter
- Invalid category: ${category}
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/653510ad04ebb9c7.
Report an issue: GitHub.