{"record":{"id":"64a6f2fdf02eb6d4","repo":"DIYgod/RSSHub","slug":"message-code-64a6f2","errorCode":null,"errorMessage":"message ?? code","messagePattern":"message \\?\\? code","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"error","filePath":"lib/routes/bilibili/like.ts","lineNumber":46,"sourceCode":"    maintainers: ['ygguorun'],\n    handler,\n};\n\nasync function handler(ctx) {\n    const uid = ctx.req.param('uid');\n    const embed = !ctx.req.param('embed');\n\n    const name = await cache.getUsernameFromUID(uid);\n\n    const response = await got({\n        url: `https://api.bilibili.com/x/space/like/video?vmid=${uid}`,\n        headers: {\n            Referer: `https://space.bilibili.com/${uid}/`,\n        },\n    });\n    const { data, code, message } = response.data;\n    if (code) {\n        throw new Error(message ?? code);\n    }\n\n    return {\n        title: `${name} 的 bilibili 点赞视频`,\n        link: `https://space.bilibili.com/${uid}`,\n        description: `${name} 的 bilibili 点赞视频`,\n        item: data.list.map((item) => ({\n            title: item.title,\n            description: utils.renderUGCDescription(embed, item.pic, item.desc, item.aid, undefined, item.bvid),\n            pubDate: parseDate(item.pubdate * 1000),\n            link: item.pubdate > utils.bvidTime && item.bvid ? `https://www.bilibili.com/video/${item.bvid}` : `https://www.bilibili.com/video/av${item.aid}`,\n            author: item.owner.name,\n        })),\n    };\n}\n","sourceCodeStart":28,"sourceCodeEnd":62,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/bilibili/like.ts#L28-L62","documentation":"Generic Error thrown by the like ('点赞视频') route when Bilibili's /x/space/like/video API returns a non-zero code. The error message is response.data.message if present, otherwise the raw code. This route does NOT require a cookie (it queries public liked-video lists) but can still fail if Bilibili returns an error.","triggerScenarios":"The space/like/video endpoint returns a non-zero code. Common causes: the uid doesn't exist, Bilibili rate-limits the request (-509), the user hid their liked videos, or wbi signature verification fails.","commonSituations":"Polling too frequently from a datacenter IP; uid typo or deleted account; user set liked videos to private; Bilibili enabled wbi verification that the route doesn't satisfy.","solutions":["Check the server log or reproduce the API call to see the specific code/message.","Reduce request frequency and increase cache expiry.","Verify the uid exists by visiting space.bilibili.com/<uid> in a browser.","If the user hid their liked videos, use a different route — this cannot be bypassed."],"exampleFix":"// before\nif (code) {\n    throw new Error(message ?? code);\n}\n\n// after: include code context for diagnostics\nif (code) {\n    throw new Error(`Bilibili like/video API error ${code}: ${message ?? 'unknown'}`);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    const { data, code, message } = response.data;\n    if (code) {\n        throw new Error(message ?? `Bilibili code ${code}`);\n    }\n} catch (e) {\n    logger.error(`like/video route failed for uid=${uid}: ${e.message}`);\n    throw e;\n}","preventionTips":["Cache results to reduce API pressure.","Verify uid exists before subscribing.","Handle transient errors gracefully in the RSS reader."],"tags":["bilibili","api-error","rate-limiting","rsshub"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}