{"record":{"id":"5994321d89836102","repo":"DIYgod/RSSHub","slug":"this-type-of-ranking-is-not-supported-yet","errorCode":null,"errorMessage":"This type of ranking is not supported yet","messagePattern":"This type of ranking is not supported yet","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"warning","filePath":"lib/routes/bilibili/ranking.ts","lineNumber":243,"sourceCode":"}\n\nasync function handler(ctx) {\n    const isJsonFeed = ctx.req.query('format') === 'json';\n    const args = ctx.req.param();\n    if (args.redirect1 || args.redirect2) {\n        // redirect old routes like /bilibili/ranking/0/3/1 or /bilibili/ranking/0/3/1/xxx\n        const embedArg = args.redirect2 ? '/' + args.redirect2 : '';\n        ctx.set('redirect', `/bilibili/ranking/${args.rid}${embedArg}`);\n        return null;\n    }\n\n    const rid = ctx.req.param('rid') || 'all';\n    const embed = !ctx.req.param('embed');\n    const isNumericRid = /^\\d+$/.test(rid);\n\n    const { apiBase, apiParams, referer, ridChinese, link, ridType } = getAPI(isNumericRid, rid);\n    if (ridType.startsWith('pgc/')) {\n        throw new Error('This type of ranking is not supported yet');\n    }\n\n    const response = await ofetch(`${apiBase}?${apiParams}`, {\n        headers: {\n            Referer: referer,\n            origin: 'https://www.bilibili.com',\n        },\n    });\n\n    if (response.code !== 0) {\n        throw new Error(response.message);\n    }\n    const data = response.data || response.result;\n    const list = data.list || [];\n    return {\n        title: `bilibili 排行榜-${ridChinese}`,\n        link,\n        item: await Promise.all(","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/bilibili/ranking.ts#L225-L261","documentation":"Thrown by the ranking handler after getAPI() returns a ridType starting with 'pgc/' (i.e. 'pgc/web' or 'pgc/season'). The pgc ranking endpoints (bangumi/movie/tv/guochuang/documentary/variety — numeric rids 1,2,3,4,5,7) return a different response shape than the x/web-interface ranking API, and the handler does not implement parsing for them, so it explicitly refuses to proceed rather than returning malformed data. The route's `parameters.rid.options` already filters these out.","triggerScenarios":"GET /bilibili/ranking/:rid where :rid is a pgc slug — 'bangumi' (1), 'movie' (2), 'documentary' (3), 'guochuang' (4), 'tv' (5), 'variety' (7) — or the matching numeric id. The isNumericRid branch returns ridType 'x/rid' for any digit string, but a numeric pgc id like /bilibili/ranking/1 also resolves to ridType 'pgc/web' inside getAPI only when... actually numeric rids short-circuit to 'x/rid', so this fires primarily via the English-slug path for pgc entries.","commonSituations":"User requests a bangumi/movie ranking expecting parity with the all/douga feeds; reader migrated from an old RSSHub version that may have supported pgc; user guesses 'anime'/'movie' slugs.","solutions":["Switch to a supported x/rid ranking: all, douga, game, kichiku, music, dance, cinephile, ent, knowledge, tech, food, car, fashion, sports, animal (or their numeric ids).","For bangumi/movie rankings, use a different RSSHub route if one exists, or open a feature request to implement pgc response parsing.","If you maintain this instance and need pgc support, implement parsing for the pgc/web and pgc/season response shapes in the handler and remove the guard."],"exampleFix":"// before\n//   /bilibili/ranking/bangumi   -> 'This type of ranking is not supported yet'\n//   /bilibili/ranking/movie      -> 'This type of ranking is not supported yet'\n\n// after\n//   /bilibili/ranking/all         (supported)\n//   /bilibili/ranking/douga       (supported)","handlingStrategy":"validation","validationCode":"// Block unsupported pgc rids before calling getAPI().\nconst PGC_SLUGS = new Set(['bangumi','movie','documentary','guochuang','tv','variety']);\nfunction isUnsupportedPgcRid(rid: string): boolean {\n  return PGC_SLUGS.has(rid);\n}\n\nif (isUnsupportedPgcRid(rid)) {\n  throw new Error(`Ranking for '${rid}' (pgc) is not supported. Use an x/rid ranking like 'all'.`);\n}","typeGuard":"function isPgcSlug(rid: string): rid is 'bangumi'|'movie'|'documentary'|'guochuang'|'tv'|'variety' {\n  return ['bangumi','movie','documentary','guochuang','tv','variety'].includes(rid);\n}","tryCatchPattern":"try {\n  if (ridType.startsWith('pgc/')) throw new Error('This type of ranking is not supported yet');\n} catch (e) {\n  if (e instanceof Error && /not supported/.test(e.message)) {\n    ctx.status = 501;\n    ctx.body = { error: `Ranking '${rid}' is pgc and not implemented; use an x/rid ranking.` };\n    return;\n  }\n  throw e;\n}","preventionTips":["Only subscribe to slugs listed in the route's parameters.rid.options (the pgc ones are already filtered out).","If you maintain the instance and need pgc rankings, implement the pgc/web + pgc/season response parsing before removing the guard.","Document the unsupported set for feed consumers so they don't request bangumi/movie rankings."],"tags":["bilibili","ranking","unsupported","validation","rsshub"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}