fix(route): 修复 bilibili UP 主动态/用户关注动态 开启内嵌视频 参数错误的问题 (#17462)

fix #17444
This commit is contained in:
CaoMeiYouRen 2024-11-05 23:02:26 +08:00 committed by GitHub
parent fe22d59de6
commit 2c2913bd57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View File

@ -19,7 +19,7 @@ export const route: Route = {
| | | | |
| ---------- | --------------------------------- | -------------- | ------ |
| showEmoji | | 0/1/true/false | false |
| embed | | | |
| embed | | 0/1/true/false | true |
| useAvid | 使 AV ( BV ) | 0/1/true/false | false |
| directLink | 使 | 0/1/true/false | false |
| hideGoods | | 0/1/true/false | false |
@ -230,7 +230,7 @@ async function handler(ctx) {
const uid = ctx.req.param('uid');
const routeParams = Object.fromEntries(new URLSearchParams(ctx.req.param('routeParams')));
const showEmoji = fallback(undefined, queryToBoolean(routeParams.showEmoji), false);
const embed = !ctx.req.param('embed');
const embed = fallback(undefined, queryToBoolean(routeParams.embed), true);
const displayArticle = ctx.req.query('mode') === 'fulltext';
const useAvid = fallback(undefined, queryToBoolean(routeParams.useAvid), false);
const directLink = fallback(undefined, queryToBoolean(routeParams.directLink), false);
@ -259,7 +259,12 @@ async function handler(ctx) {
const rssItems = await Promise.all(
items
.filter((item) => !hideGoods || item.modules.module_dynamic?.additional?.type !== 'ADDITIONAL_TYPE_GOODS')
.filter((item) => {
if (hideGoods) {
return item.modules.module_dynamic?.additional?.type !== 'ADDITIONAL_TYPE_GOODS';
}
return true;
})
.map(async (item) => {
// const parsed = JSONbig.parse(item.card);

View File

@ -18,7 +18,7 @@ export const route: Route = {
| | | | |
| ---------- | --------------------------------- | -------------- | ------ |
| showEmoji | | 0/1/true/false | false |
| embed | | | |
| embed | | 0/1/true/false | true |
| useAvid | 使 AV ( BV ) | 0/1/true/false | false |
| directLink | 使 | 0/1/true/false | false |
| hideGoods | | 0/1/true/false | false |
@ -55,7 +55,7 @@ async function handler(ctx) {
const routeParams = querystring.parse(ctx.req.param('routeParams'));
const showEmoji = fallback(undefined, queryToBoolean(routeParams.showEmoji), false);
const embed = !ctx.req.param('embed');
const embed = fallback(undefined, queryToBoolean(routeParams.embed), true);
const displayArticle = fallback(undefined, queryToBoolean(routeParams.displayArticle), false);
const name = await cache.getUsernameFromUID(uid);