From c5be64eb1c48044838766bc38de980a2fb7894f3 Mon Sep 17 00:00:00 2001 From: Shinku <17696928+Shinku-Chen@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:59:46 +0800 Subject: [PATCH] fix(bilibili/user/dynamic): bilibili dynamic offset (#17986) --- lib/routes/bilibili/dynamic.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/routes/bilibili/dynamic.ts b/lib/routes/bilibili/dynamic.ts index be3c3e8d797412..101c1c34f35bf4 100644 --- a/lib/routes/bilibili/dynamic.ts +++ b/lib/routes/bilibili/dynamic.ts @@ -23,6 +23,7 @@ export const route: Route = { | useAvid | 视频链接使用 AV 号 (默认为 BV 号) | 0/1/true/false | false | | directLink | 使用内容直链 | 0/1/true/false | false | | hideGoods | 隐藏带货动态 | 0/1/true/false | false | +| offset | 偏移状态 | string | "" | 用例:\`/bilibili/user/dynamic/2267573/showEmoji=1&embed=0&useAvid=1\``, }, @@ -232,13 +233,14 @@ async function handler(ctx) { const showEmoji = fallback(undefined, queryToBoolean(routeParams.showEmoji), false); const embed = fallback(undefined, queryToBoolean(routeParams.embed), true); const displayArticle = ctx.req.query('mode') === 'fulltext'; + const offset = fallback(undefined, routeParams.offset, ''); const useAvid = fallback(undefined, queryToBoolean(routeParams.useAvid), false); const directLink = fallback(undefined, queryToBoolean(routeParams.directLink), false); const hideGoods = fallback(undefined, queryToBoolean(routeParams.hideGoods), false); const cookie = await cacheIn.getCookie(); - const params = utils.addDmVerifyInfo(`host_mid=${uid}&platform=web&features=itemOpusStyle,listOnlyfans,opusBigCover,onlyfansVote`, utils.getDmImgList()); + const params = utils.addDmVerifyInfo(`offset=${offset}&host_mid=${uid}&platform=web&features=itemOpusStyle,listOnlyfans,opusBigCover,onlyfansVote`, utils.getDmImgList()); const response = await got(`https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/space?${params}`, { headers: { Referer: `https://space.bilibili.com/${uid}/`,