Skip to content

Commit

Permalink
feat(response): bilibili.app.viewunite.v1.View/View
Browse files Browse the repository at this point in the history
Update protobuf
  • Loading branch information
VirgilClyne committed Nov 1, 2024
1 parent a3007c7 commit 4229d41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/response.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import database from "./function/database.mjs";
import setENV from "./function/setENV.mjs";
import { WireType, UnknownFieldHandler, reflectionMergePartial, MESSAGE_TYPE, MessageType, BinaryReader, isJsonObject, typeofJsonValue, jsonWriteOptions } from "@protobuf-ts/runtime";
import { ViewReply } from "./protobuf/bilibili/app/viewunite/v1/viewunite.js";
import { ViewPgcAny } from "./protobuf/bilibili/app/viewunite/pgcanymodel.js";
/***************** Processing *****************/
// 解构URL
const url = new URL($request.url);
Expand Down Expand Up @@ -201,13 +202,17 @@ log(`⚠ FORMAT: ${FORMAT}`, "");
//infoGroup.evaluate = result?.evaluate ?? infoGroup.evaluate;
if (infoGroup.seasonId || infoGroup.epId) infoGroup.type = "PGC";
switch (body?.supplement?.typeUrl) {
case "type.googleapis.com/bilibili.app.viewunite.pgcanymodel.ViewPgcAny":
case "type.googleapis.com/bilibili.app.viewunite.pgcanymodel.ViewPgcAny": {
infoGroup.type = "PGC";
const PgcBody = ViewPgcAny.fromBinary(body?.supplement?.value);
log(`🚧 PgcBody: ${JSON.stringify(PgcBody)}`, "");
break;
}
case "type.googleapis.com/bilibili.app.viewunite.ugcanymodel.ViewUgcAny":
default:
default: {
infoGroup.type = "UGC";
break;
}
}
infoGroup.locales = detectLocales(infoGroup);
setCache(infoGroup, [], Caches);
Expand Down

0 comments on commit 4229d41

Please sign in to comment.