Skip to content

Commit

Permalink
更新 protobuf+metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
djkcyl committed Jul 30, 2023
1 parent 10cc9ab commit d53de9c
Show file tree
Hide file tree
Showing 280 changed files with 33,798 additions and 11,003 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ build/

test_data.py
.pdm-python
login_cache.json
test/http_pack/*
26 changes: 22 additions & 4 deletions bilireq/grpc/dynamic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
from ..protos.bilibili.ad.v1 import ad_pb2
import json

from ..protos.bilibili.app.dynamic.v2.dynamic_pb2 import (
DynAllReply,
DynAllReq,
DynMixUpListViewMoreReply,
DynMixUpListViewMoreReq,
DynSpaceReq,
DynSpaceRsp,
DynDetailsReq,
DynDetailsReply,
DynDetailReq,
DynDetailReply,
AdParam,
)
from ..protos.bilibili.app.dynamic.v2.dynamic_pb2_grpc import DynamicStub
from ..utils import grpc_request


@grpc_request
async def grpc_get_user_dynamics(
uid: int, offset: str = "", page: int = 1, **kwargs
) -> DynSpaceRsp:
async def grpc_get_user_dynamics(uid: int, offset: str = "", page: int = 1, **kwargs) -> DynSpaceRsp:
stub = DynamicStub(kwargs.pop("_channel"))
req = DynSpaceReq(host_uid=uid, history_offset=offset, page=page)
return await stub.DynSpace(req, **kwargs)
Expand All @@ -32,3 +36,17 @@ async def grpc_get_followed_dynamic_users(**kwargs) -> DynMixUpListViewMoreReply
stub = DynamicStub(kwargs.pop("_channel"))
req = DynMixUpListViewMoreReq(sort_type=1)
return await stub.DynMixUpListViewMore(req, **kwargs)


@grpc_request
async def grpc_get_dynamic_details(dynamic_ids: list[int], **kwargs) -> DynDetailsReply:
stub = DynamicStub(kwargs.pop("_channel"))
req = DynDetailsReq(dynamic_ids=json.dumps({"dyn_ids": dynamic_ids}))
return await stub.DynDetails(req, **kwargs)


@grpc_request
async def grpc_get_dynamic_detail(dynamic_id: str, **kwargs) -> DynDetailReply:
stub = DynamicStub(kwargs.pop("_channel"))
req = DynDetailReq(dynamic_id=dynamic_id)
return await stub.DynDetail(req, **kwargs)
126 changes: 64 additions & 62 deletions bilireq/grpc/protos/bilibili/account/fission/v1/fission.proto
Original file line number Diff line number Diff line change
@@ -1,62 +1,64 @@
syntax = "proto3";

package bilibili.account.fission.v1;

// Fission裂变
service Fission {
// 活动入口
rpc Entrance (EntranceReq) returns (EntranceReply);
// 首页弹窗
rpc Window (WindowReq) returns (WindowReply);
//
rpc Privacy(PrivacyReq) returns (PrivacyReply);
}

// 动画效果
message AnimateIcon {
// icon文件
string icon = 1;
// 动效json文件
string json = 2;
}

// 活动入口-响应
message EntranceReply {
// 展示图标
string icon = 1;
// 活动名称
string name = 2;
// 活动跳转链接
string url = 3;
// 动画效果
AnimateIcon animate_icon = 4;
}

// 活动入口-请求
message EntranceReq {}

//
message PrivacyReply {
//
string message = 1;
}

//
message PrivacyReq {
//
string activity_uid = 1;
}

//首页弹窗-响应
message WindowReply {
// 弹窗类型
// 0:弹窗 1:普通页面
int32 type = 1;
// 跳转链接
string url = 2;
// 上报数据字段
string report_data = 3;
}

// 首页弹窗-请求
message WindowReq {}
syntax = "proto3";

package bilibili.account.fission.v1;

// Fission裂变
service Fission {
// 活动入口
rpc Entrance (EntranceReq) returns (EntranceReply);
// 首页弹窗
rpc Window (WindowReq) returns (WindowReply);
//
rpc Privacy (PrivacyReq) returns (PrivacyReply);
}

// 动画效果
message AnimateIcon {
// icon文件
string icon = 1;
// 动效json文件
string json = 2;
}

// 活动入口-响应
message EntranceReply {
// 展示图标
string icon = 1;
// 活动名称
string name = 2;
// 活动跳转链接
string url = 3;
// 动画效果
AnimateIcon animate_icon = 4;
}

// 活动入口-请求
message EntranceReq {}

//
message PrivacyReply {
//
string message = 1;
}

//
message PrivacyReq {
//
string activity_uid = 1;
}

//首页弹窗-响应
message WindowReply {
// 弹窗类型
// 0:弹窗 1:普通页面
int32 type = 1;
// 跳转链接
string url = 2;
// 上报数据字段
string report_data = 3;
}

// 首页弹窗-请求
message WindowReq {

}
41 changes: 21 additions & 20 deletions bilireq/grpc/protos/bilibili/account/fission/v1/fission_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

209 changes: 105 additions & 104 deletions bilireq/grpc/protos/bilibili/ad/v1/ad_pb2.py

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions bilireq/grpc/protos/bilibili/api/player/v1/player_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d53de9c

Please sign in to comment.