diff --git a/App.ruleset b/App.ruleset index e4613ab670ff904f6924e789c2aa436968114741..08aab49fcbbbb8925a1f391cce9abcba91a65fbe 100644 --- a/App.ruleset +++ b/App.ruleset @@ -1,5 +1,5 @@  - + @@ -78,6 +78,7 @@ + diff --git a/Bili.UWP.sln b/Bili.UWP.sln index 67290ec982c7a53efeca2a7d336db6357bfb1e83..3e50ad4121c8ea1d8b8a00a6b1cd441b7bb47b07 100644 --- a/Bili.UWP.sln +++ b/Bili.UWP.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31321.278 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31410.414 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "src\App\App.csproj", "{1C288BC0-72F3-4C4C-90AD-A05B52E937B0}" EndProject @@ -47,6 +47,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controller.Uwp", "src\Contr EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controller.Uwp.UnitTests", "src\Controller\Controller.Uwp.UnitTests\Controller.Uwp.UnitTests.csproj", "{3B66D3B1-4B4C-4AAF-8556-B3B51999F177}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Models.gRPC", "src\Models\Models.gRPC\Models.gRPC.csproj", "{0187840F-8D1A-4198-B5BF-8B05CADB4554}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -351,6 +353,26 @@ Global {3B66D3B1-4B4C-4AAF-8556-B3B51999F177}.Release|x86.ActiveCfg = Release|x86 {3B66D3B1-4B4C-4AAF-8556-B3B51999F177}.Release|x86.Build.0 = Release|x86 {3B66D3B1-4B4C-4AAF-8556-B3B51999F177}.Release|x86.Deploy.0 = Release|x86 + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Debug|ARM.ActiveCfg = Debug|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Debug|ARM.Build.0 = Debug|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Debug|ARM64.Build.0 = Debug|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Debug|x64.ActiveCfg = Debug|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Debug|x64.Build.0 = Debug|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Debug|x86.ActiveCfg = Debug|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Debug|x86.Build.0 = Debug|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Release|Any CPU.Build.0 = Release|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Release|ARM.ActiveCfg = Release|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Release|ARM.Build.0 = Release|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Release|ARM64.ActiveCfg = Release|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Release|ARM64.Build.0 = Release|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Release|x64.ActiveCfg = Release|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Release|x64.Build.0 = Release|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Release|x86.ActiveCfg = Release|Any CPU + {0187840F-8D1A-4198-B5BF-8B05CADB4554}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -372,6 +394,7 @@ Global {CAE9B987-6DB2-42A8-B3F2-3BB700CC4DD8} = {45B5DFF9-9F13-4BF3-B561-8ABBDFE5C237} {5213E830-43F5-491E-A8EF-D75083578EF3} = {65F17D44-343F-4B87-A726-3BE3E48168B4} {3B66D3B1-4B4C-4AAF-8556-B3B51999F177} = {65F17D44-343F-4B87-A726-3BE3E48168B4} + {0187840F-8D1A-4198-B5BF-8B05CADB4554} = {232C0E31-606A-48CD-B860-2E9155EAB4C6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {563225C5-4D56-446B-9ADE-09D3F0DE7963} diff --git a/src/Controller/Controller.Uwp/BiliController.Rank.cs b/src/Controller/Controller.Uwp/BiliController.Rank.cs index b9a36d456fc19cd101831e2595e1fe55162f7443..e153ec3bf0e3375b4d3dede45544c108f7e0854c 100644 --- a/src/Controller/Controller.Uwp/BiliController.Rank.cs +++ b/src/Controller/Controller.Uwp/BiliController.Rank.cs @@ -1,8 +1,8 @@ // Copyright (c) Richasy. All rights reserved. +using System.Collections.Generic; using System.Threading.Tasks; -using Richasy.Bili.Models.BiliBili; -using Richasy.Bili.Models.Enums; +using Bilibili.App.Show.V1; namespace Richasy.Bili.Controller.Uwp { @@ -15,13 +15,12 @@ namespace Richasy.Bili.Controller.Uwp /// 获取排行榜信息. /// /// 分区Id. - /// 排行榜范围. /// 排行榜信息. - public async Task GetRankAsync(int partitionId, RankScope scope) + public async Task> GetRankAsync(int partitionId) { try { - var rank = await _rankProvider.GetRankDetailAsync(partitionId, scope); + var rank = await _rankProvider.GetRankDetailAsync(partitionId); return rank; } catch diff --git a/src/Controller/Controller.Uwp/Controller.Uwp.csproj b/src/Controller/Controller.Uwp/Controller.Uwp.csproj index c5c70a0c70ec676697575e0f6bc8f26f504e21bd..a9278310e1b7ddf09b23f225fc475884914480d6 100644 --- a/src/Controller/Controller.Uwp/Controller.Uwp.csproj +++ b/src/Controller/Controller.Uwp/Controller.Uwp.csproj @@ -49,6 +49,10 @@ {88314412-b020-415b-aeab-57adc43b273e} Models.Enums + + {0187840F-8D1A-4198-B5BF-8B05CADB4554} + Models.gRPC + {793ec923-d704-4c6f-9506-eb6a32bfbb8d} Locator.Uwp diff --git a/src/Lib/Lib.Interfaces/IHttpProvider.cs b/src/Lib/Lib.Interfaces/IHttpProvider.cs index 624ac631c368a9f404236b8b62295aa6192e70ed..e7391715790829f400ebb9d6e571165231897b1a 100644 --- a/src/Lib/Lib.Interfaces/IHttpProvider.cs +++ b/src/Lib/Lib.Interfaces/IHttpProvider.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using Google.Protobuf; using Richasy.Bili.Models.Enums; namespace Richasy.Bili.Lib.Interfaces @@ -30,6 +31,14 @@ namespace Richasy.Bili.Lib.Interfaces /// . Task GetRequestMessageAsync(HttpMethod method, string url, Dictionary queryParams = null, RequestClientType type = RequestClientType.Android, bool needToken = false); + /// + /// 获取 . + /// + /// 请求地址. + /// gRPC信息. + /// . + Task GetRequestMessageAsync(string url, IMessage grpcMessage); + /// /// 发送请求. /// @@ -52,5 +61,15 @@ namespace Richasy.Bili.Lib.Interfaces /// 需要转换的目标类型. /// 转换结果. Task ParseAsync(HttpResponseMessage response); + + /// + /// 解析响应. + /// + /// 得到的 . + /// 对应gRPC类型的转换器. + /// 需要转换的gRPC目标类型. + /// 转换结果. + Task ParseAsync(HttpResponseMessage response, MessageParser parser) + where T : IMessage; } } diff --git a/src/Lib/Lib.Interfaces/IRankProvider.cs b/src/Lib/Lib.Interfaces/IRankProvider.cs index bfefdefa8968d79b2235921b9ec973c36f67e344..eab08962e8446c7c0be21bf3165f295c8f50d583 100644 --- a/src/Lib/Lib.Interfaces/IRankProvider.cs +++ b/src/Lib/Lib.Interfaces/IRankProvider.cs @@ -1,8 +1,8 @@ // Copyright (c) Richasy. All rights reserved. +using System.Collections.Generic; using System.Threading.Tasks; -using Richasy.Bili.Models.BiliBili; -using Richasy.Bili.Models.Enums; +using Bilibili.App.Show.V1; namespace Richasy.Bili.Lib.Interfaces { @@ -15,8 +15,7 @@ namespace Richasy.Bili.Lib.Interfaces /// 获取排行榜详情. /// /// 分区Id. 如果是全区则为0. - /// 排行榜范围. /// 排行榜信息. - Task GetRankDetailAsync(int partitionId, RankScope rankScope); + Task> GetRankDetailAsync(int partitionId); } } diff --git a/src/Lib/Lib.Interfaces/Lib.Interfaces.csproj b/src/Lib/Lib.Interfaces/Lib.Interfaces.csproj index 654b7e34b7550cef4f197334bb2e7efcb71f6fca..9c757830bd8843041bf5ea9ff069a57c848e6a80 100644 --- a/src/Lib/Lib.Interfaces/Lib.Interfaces.csproj +++ b/src/Lib/Lib.Interfaces/Lib.Interfaces.csproj @@ -129,6 +129,9 @@ + + 3.17.3 + 6.2.12 @@ -146,6 +149,10 @@ {88314412-B020-415B-AEAB-57ADC43B273E} Models.Enums + + {0187840F-8D1A-4198-B5BF-8B05CADB4554} + Models.gRPC + 14.0 diff --git a/src/Lib/Lib.Uwp/HttpProvider/HttpProvider.Extension.cs b/src/Lib/Lib.Uwp/HttpProvider/HttpProvider.Extension.cs index 058cbe1a746681c950ecf59a93addcf4f3bbfed6..d143322edc3716a9420c099b47aeb2583091d62a 100644 --- a/src/Lib/Lib.Uwp/HttpProvider/HttpProvider.Extension.cs +++ b/src/Lib/Lib.Uwp/HttpProvider/HttpProvider.Extension.cs @@ -110,7 +110,6 @@ namespace Richasy.Bili.Lib.Uwp ServerResponse errorResponse = null; try { - var errorResponseStr = await response.Content.ReadAsStringAsync(); if (response.Content.Headers.ContentType?.MediaType.Contains("image") ?? false) { if (response.IsSuccessStatusCode) @@ -118,7 +117,19 @@ namespace Richasy.Bili.Lib.Uwp return; } } + else if (response.Content.Headers.ContentType?.MediaType == ServiceConstants.Headers.GRPCContentType) + { + var bytes = await response.Content.ReadAsByteArrayAsync(); + if (bytes.Length <= 5) + { + errorResponse = new ServerResponse { Message = ServiceConstants.Messages.NoData }; + throw new ServiceException(errorResponse, response.Headers, response.StatusCode); + } + + return; + } + var errorResponseStr = await response.Content.ReadAsStringAsync(); errorResponse = JsonConvert.DeserializeObject(errorResponseStr); if (errorResponse?.Code == 0 || string.IsNullOrEmpty(errorResponseStr)) { diff --git a/src/Lib/Lib.Uwp/HttpProvider/HttpProvider.cs b/src/Lib/Lib.Uwp/HttpProvider/HttpProvider.cs index c8a78f5f84c21136e1ad199cc61152b1960eee9b..3ffbe2d1e94d29857d268fddd21c16cd90f4dc88 100644 --- a/src/Lib/Lib.Uwp/HttpProvider/HttpProvider.cs +++ b/src/Lib/Lib.Uwp/HttpProvider/HttpProvider.cs @@ -2,14 +2,19 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Net.Http; +using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; +using Google.Protobuf; using Newtonsoft.Json; using Richasy.Bili.Lib.Interfaces; using Richasy.Bili.Models.App.Constants; using Richasy.Bili.Models.App.Other; using Richasy.Bili.Models.Enums; +using Richasy.Bili.Models.gRPC; +using static Richasy.Bili.Models.App.Constants.ServiceConstants; namespace Richasy.Bili.Lib.Uwp { @@ -79,6 +84,50 @@ namespace Richasy.Bili.Lib.Uwp return requestMessage; } + /// + public async Task GetRequestMessageAsync(string url, IMessage grpcMessage) + { + var requestMessage = new HttpRequestMessage(HttpMethod.Post, url); + var token = await _authenticationProvider.GetTokenAsync(); + var grpcConfig = new GRPCConfig(token); + var userAgent = $"bili-universal/62800300 " + + $"os/ios model/{GRPCConfig.Model} mobi_app/iphone " + + $"osVer/{GRPCConfig.OSVersion} " + + $"network/{GRPCConfig.NetworkType} " + + $"grpc-objc/1.32.0 grpc-c/12.0.0 (ios; cronet_http)"; + requestMessage.Headers.Authorization = new AuthenticationHeaderValue(Headers.Identify, token); + requestMessage.Headers.Add(Headers.UserAgent, userAgent); + requestMessage.Headers.Add(Headers.AppKey, GRPCConfig.MobileApp); + requestMessage.Headers.Add(Headers.BiliDevice, grpcConfig.GetDeviceBin()); + requestMessage.Headers.Add(Headers.BiliFawkes, grpcConfig.GetFawkesreqBin()); + requestMessage.Headers.Add(Headers.BiliLocale, grpcConfig.GetLocaleBin()); + requestMessage.Headers.Add(Headers.BiliMeta, grpcConfig.GetMetadataBin()); + requestMessage.Headers.Add(Headers.BiliNetwork, grpcConfig.GetNetworkBin()); + requestMessage.Headers.Add(Headers.BiliRestriction, grpcConfig.GetRestrictionBin()); + requestMessage.Headers.Add(Headers.GRPCAcceptEncodingKey, Headers.GRPCAcceptEncodingValue); + requestMessage.Headers.Add(Headers.GRPCTimeOutKey, Headers.GRPCTimeOutValue); + requestMessage.Headers.Add(Headers.Envoriment, GRPCConfig.Envorienment); + requestMessage.Headers.Add(Headers.TransferEncodingKey, Headers.TransferEncodingValue); + requestMessage.Headers.Add(Headers.TEKey, Headers.TEValue); + + var messageBytes = grpcMessage.ToByteArray(); + + // 校验用?第五位为数组长度 + var stateBytes = new byte[] { 0, 0, 0, 0, (byte)messageBytes.Length }; + + // 合并两个字节数组 + var bodyBytes = new byte[5 + messageBytes.Length]; + stateBytes.CopyTo(bodyBytes, 0); + messageBytes.CopyTo(bodyBytes, 5); + + var byteArrayContent = new ByteArrayContent(bodyBytes); + byteArrayContent.Headers.ContentType = new MediaTypeHeaderValue(Headers.GRPCContentType); + byteArrayContent.Headers.ContentLength = bodyBytes.Length; + + requestMessage.Content = byteArrayContent; + return requestMessage; + } + /// public Task SendAsync(HttpRequestMessage request) { @@ -107,5 +156,13 @@ namespace Richasy.Bili.Lib.Uwp var responseString = await response.Content.ReadAsStringAsync(); return JsonConvert.DeserializeObject(responseString); } + + /// + public async Task ParseAsync(HttpResponseMessage response, MessageParser parser) + where T : IMessage + { + var bytes = await response.Content.ReadAsByteArrayAsync(); + return parser.ParseFrom(bytes.Skip(5).ToArray()); + } } } diff --git a/src/Lib/Lib.Uwp/Lib.Uwp.csproj b/src/Lib/Lib.Uwp/Lib.Uwp.csproj index 24f453600017b0630dbbea73997905475cf03686..29fae6a4093b9bbca23cfc27ce8984093e869ff1 100644 --- a/src/Lib/Lib.Uwp/Lib.Uwp.csproj +++ b/src/Lib/Lib.Uwp/Lib.Uwp.csproj @@ -29,6 +29,9 @@ + + 3.17.3 + 6.2.12 @@ -52,6 +55,10 @@ {88314412-B020-415B-AEAB-57ADC43B273E} Models.Enums + + {0187840F-8D1A-4198-B5BF-8B05CADB4554} + Models.gRPC + {793EC923-D704-4C6F-9506-EB6A32BFBB8D} Locator.Uwp diff --git a/src/Lib/Lib.Uwp/RankProvider/RankProvider.cs b/src/Lib/Lib.Uwp/RankProvider/RankProvider.cs index f4613551f26603af7cb7df16529d56cac233e3e9..0fe98cdf206734fc6e927602e14322b3aaeb842d 100644 --- a/src/Lib/Lib.Uwp/RankProvider/RankProvider.cs +++ b/src/Lib/Lib.Uwp/RankProvider/RankProvider.cs @@ -1,11 +1,10 @@ // Copyright (c) Richasy. All rights reserved. using System.Collections.Generic; -using System.Net.Http; +using System.Linq; using System.Threading.Tasks; +using Bilibili.App.Show.V1; using Richasy.Bili.Lib.Interfaces; -using Richasy.Bili.Models.BiliBili; -using Richasy.Bili.Models.Enums; using static Richasy.Bili.Models.App.Constants.ServiceConstants; namespace Richasy.Bili.Lib.Uwp @@ -25,18 +24,13 @@ namespace Richasy.Bili.Lib.Uwp } /// - public async Task GetRankDetailAsync(int partitionId, RankScope rankScope) + public async Task> GetRankDetailAsync(int partitionId) { - var queryParameters = new Dictionary - { - { Query.PartitionId, partitionId.ToString() }, - { Query.Type, rankScope.ToString().ToLower() }, - }; - - var request = await _httpProvider.GetRequestMessageAsync(HttpMethod.Get, Api.Rank.Ranking, queryParameters, RequestClientType.Web); + var rankRequst = new RankRegionResultReq() { Rid = partitionId }; + var request = await _httpProvider.GetRequestMessageAsync(Api.Rank.RankingGRPC, rankRequst); var response = await _httpProvider.SendAsync(request); - var data = await _httpProvider.ParseAsync>(response); - return data.Data; + var data = await _httpProvider.ParseAsync(response, RankListReply.Parser); + return data.Items.ToList(); } } } diff --git a/src/Models/Models.App/Constants/ServiceConstants.cs b/src/Models/Models.App/Constants/ServiceConstants.cs index d68556b08f1429bbc2665094f0227c8931a6e261..21e2ef9c1664f3a1fc64ab546dc4ad6bf0900686 100644 --- a/src/Models/Models.App/Constants/ServiceConstants.cs +++ b/src/Models/Models.App/Constants/ServiceConstants.cs @@ -60,6 +60,7 @@ namespace Richasy.Bili.Models.App.Constants public static class Messages { public const string NotFound = "没有找到你所需要的资源"; + public const string NoData = "请求失败,没有数据返回"; public const string UnexpectedExceptionOnSend = "在发送请求时出现了异常"; public const string RequestTimedOut = "请求超时"; public const string OverallTimeoutCannotBeSet = "全局超时未能在第一次请求后设置"; @@ -69,8 +70,28 @@ namespace Richasy.Bili.Models.App.Constants public static class Headers { public const string Bearer = "Bearer"; + public const string Identify = "identify_v1"; public const string FormUrlEncodedContentType = "application/x-www-form-urlencoded"; public const string JsonContentType = "application/json"; + public const string GRPCContentType = "application/grpc"; + public const string UserAgent = "User-Agent"; + public const string AppKey = "APP-KEY"; + public const string BiliMeta = "x-bili-metadata-bin"; + public const string Authorization = "authorization"; + public const string BiliDevice = "x-bili-device-bin"; + public const string BiliNetwork = "x-bili-network-bin"; + public const string BiliRestriction = "x-bili-restriction-bin"; + public const string BiliLocale = "x-bili-locale-bin"; + public const string BiliFawkes = "x-bili-fawkes-req-bin"; + public const string GRPCAcceptEncodingKey = "grpc-accept-encoding"; + public const string GRPCAcceptEncodingValue = "identity,deflate,gzip"; + public const string GRPCTimeOutKey = "grpc-timeout"; + public const string GRPCTimeOutValue = "20100m"; + public const string Envoriment = "env"; + public const string TransferEncodingKey = "Transfer-Encoding"; + public const string TransferEncodingValue = "chunked"; + public const string TEKey = "TE"; + public const string TEValue = "trailers"; } public static class Settings @@ -91,6 +112,7 @@ namespace Richasy.Bili.Models.App.Constants public const string _liveBase = "https://api.live.bilibili.com"; public const string _passBase = "https://passport.bilibili.com"; public const string _bangumiBase = "https://bangumi.bilibili.com"; + public const string _grpcBase = "https://grpc.biliapi.net"; public static class Passport { @@ -174,9 +196,14 @@ namespace Richasy.Bili.Models.App.Constants public static class Rank { /// - /// 排行榜. + /// 排行榜 - Web. /// public const string Ranking = _apiBase + "/x/web-interface/ranking/v2"; + + /// + /// 排行榜 - gRPC. + /// + public const string RankingGRPC = _grpcBase + "/bilibili.app.show.v1.Rank/RankRegion"; } } #pragma warning restore SA1401 // Fields should be private diff --git a/src/Models/Models.App/Other/RankPartition.cs b/src/Models/Models.App/Other/RankPartition.cs index 24f74356dc6141ce9c3dc9335e2308c063e101f4..174f6d075853fcb1fc96955d6640dd9ba01a7e6c 100644 --- a/src/Models/Models.App/Other/RankPartition.cs +++ b/src/Models/Models.App/Other/RankPartition.cs @@ -1,7 +1,6 @@ // Copyright (c) Richasy. All rights reserved. using Richasy.Bili.Models.BiliBili; -using Richasy.Bili.Models.Enums; namespace Richasy.Bili.Models.App.Other { @@ -14,14 +13,12 @@ namespace Richasy.Bili.Models.App.Other /// Initializes a new instance of the class. /// /// 分区名称. - /// 排行榜范围. /// 图标. /// 分区Id. - public RankPartition(string partitionName, RankScope scope, string logo, int partitionId = 0) + public RankPartition(string partitionName, string logo, int partitionId = 0) { this.PartitionName = partitionName; this.PartitionId = partitionId; - this.Scope = scope; this.Logo = logo; } @@ -33,7 +30,6 @@ namespace Richasy.Bili.Models.App.Other { this.PartitionId = partition.Tid; this.PartitionName = partition.Name; - this.Scope = RankScope.All; this.Logo = partition.Logo; } @@ -47,25 +43,19 @@ namespace Richasy.Bili.Models.App.Other /// public string PartitionName { get; set; } - /// - /// 排行榜范围. - /// - public RankScope Scope { get; set; } - /// /// 图标. /// public string Logo { get; set; } /// - public override bool Equals(object obj) => obj is RankPartition partition && PartitionId == partition.PartitionId && Scope == partition.Scope; + public override bool Equals(object obj) => obj is RankPartition partition && PartitionId == partition.PartitionId; /// public override int GetHashCode() { var hashCode = 1323653111; hashCode = (hashCode * -1521134295) + PartitionId.GetHashCode(); - hashCode = (hashCode * -1521134295) + Scope.GetHashCode(); return hashCode; } } diff --git a/src/Models/Models.BiliBili/Core/Video/RankVideo.cs b/src/Models/Models.BiliBili/Core/Video/RankVideo.cs deleted file mode 100644 index e773dfdb1b543712848bdc99a2131dab5c3e1c56..0000000000000000000000000000000000000000 --- a/src/Models/Models.BiliBili/Core/Video/RankVideo.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Richasy. All rights reserved. - -using Newtonsoft.Json; - -namespace Richasy.Bili.Models.BiliBili -{ - /// - /// 排行榜视频信息. - /// - public class RankVideo : VideoBase - { - /// - /// 视频的Aid. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "aid", Required = Required.Default)] - public int Aid { get; set; } - - /// - /// 分区Id. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "tid", Required = Required.Default)] - public int PartitionId { get; set; } - - /// - /// 分区名. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "tname", Required = Required.Default)] - public string PartitionName { get; set; } - - /// - /// 视频类型,1-原创,2-转载. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "copyright", Required = Required.Default)] - public int Copyright { get; set; } - - /// - /// 视频封面. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "pic", Required = Required.Default)] - public string Cover { get; set; } - - /// - /// 投稿时间. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "ctime", Required = Required.Default)] - public int ContributeTime { get; set; } - - /// - /// 视频说明. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "desc", Required = Required.Default)] - public string Description { get; set; } - - /// - /// 视频作者信息. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "owner", Required = Required.Default)] - public PublisherInfo PublisherInfo { get; set; } - - /// - /// 视频播放信息. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "stat", Required = Required.Default)] - public VideoStatusInfo Status { get; set; } - - /// - /// 视频第1P的Id. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "cid", Required = Required.Default)] - public int Cid { get; set; } - - /// - /// 用于分享的短链接. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "short_link", Required = Required.Default)] - public string ShortLink { get; set; } - - /// - /// 视频的Bvid. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "bvid", Required = Required.Default)] - public string Bvid { get; set; } - - /// - /// 综合评分. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "score", Required = Required.Default)] - public int Score { get; set; } - } -} diff --git a/src/Models/Models.BiliBili/Models.BiliBili.csproj b/src/Models/Models.BiliBili/Models.BiliBili.csproj index 1aa49f69741f5150393b861b1ead746db4656419..bbc588bc9719cd47fdaf8ab730cf0aebe0652627 100644 --- a/src/Models/Models.BiliBili/Models.BiliBili.csproj +++ b/src/Models/Models.BiliBili/Models.BiliBili.csproj @@ -10,4 +10,8 @@ + + + + diff --git a/src/Models/Models.BiliBili/Others/RankInfo.cs b/src/Models/Models.BiliBili/Others/RankInfo.cs deleted file mode 100644 index a223acfe996e213adbd5cd6828e15fa80d433900..0000000000000000000000000000000000000000 --- a/src/Models/Models.BiliBili/Others/RankInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Richasy. All rights reserved. - -using System.Collections.Generic; -using Newtonsoft.Json; - -namespace Richasy.Bili.Models.BiliBili -{ - /// - /// 排行榜信息. - /// - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class RankInfo - { - /// - /// 排行榜说明. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "note", Required = Required.Default)] - public string Note { get; set; } - - /// - /// 排行榜下的视频列表. - /// - [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "list", Required = Required.Default)] - public List VideoList { get; set; } - } -} diff --git a/src/Models/Models.Enums/RankType.cs b/src/Models/Models.Enums/RankType.cs deleted file mode 100644 index 7c2d33421baff435b3419380c7f2542c7cd787dd..0000000000000000000000000000000000000000 --- a/src/Models/Models.Enums/RankType.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Richasy. All rights reserved. - -namespace Richasy.Bili.Models.Enums -{ - /// - /// 排行榜类型. - /// - public enum RankScope - { - /// - /// 全部. - /// - All, - - /// - /// 原创. - /// - Origin, - - /// - /// 新人. - /// - Rookie, - } -} diff --git a/src/Models/Models.gRPC/GRPCConfig.cs b/src/Models/Models.gRPC/GRPCConfig.cs new file mode 100644 index 0000000000000000000000000000000000000000..f71730a4bf9ad8b638ea6bf36a91bbf28993a72e --- /dev/null +++ b/src/Models/Models.gRPC/GRPCConfig.cs @@ -0,0 +1,216 @@ +// Copyright (c) Richasy. All rights reserved. + +#pragma warning disable SA1300 // Element should begin with upper-case letter +using System; +using Bilibili.Metadata; +using Bilibili.Metadata.Device; +using Bilibili.Metadata.Fawkes; +using Bilibili.Metadata.Locale; +using Bilibili.Metadata.Network; +using Bilibili.Metadata.Restriction; +using Google.Protobuf; + +namespace Richasy.Bili.Models.gRPC +{ + /// + /// gRPC的请求配置. + /// + public class GRPCConfig + { + /// + /// 系统版本. + /// + public const string OSVersion = "14.6"; + + /// + /// 厂商. + /// + public const string Brand = "Apple"; + + /// + /// 手机系统. + /// + public const string Model = "iPhone 11"; + + /// + /// 应用版本. + /// + public const string AppVersion = "6.7.0"; + + /// + /// 构建标识. + /// + public const int Build = 6070600; + + /// + /// 频道. + /// + public const string Channel = "bilibili140"; + + /// + /// 网络状况. + /// + public const int NetworkType = 2; + + /// + /// 未知. + /// + public const int NetworkTF = 0; + + /// + /// 未知. + /// + public const string NetworkOid = "46007"; + + /// + /// 未知. + /// + public const string Cronet = "1.21.0"; + + /// + /// 未知. + /// + public const string Buvid = "XZFD48CFF1E68E637D0DF11A562468A8DC314"; + + /// + /// 应用类型. + /// + public const string MobileApp = "iphone"; + + /// + /// 移动平台. + /// + public const string Platform = "iphone"; + + /// + /// 产品环境. + /// + public const string Envorienment = "prod"; + + /// + /// 应用Id. + /// + public const int AppId = 1; + + /// + /// 国家或地区. + /// + public const string Region = "CN"; + + /// + /// 语言. + /// + public const string Language = "zh"; + + /// + /// Initializes a new instance of the class. + /// + /// 访问令牌. + public GRPCConfig(string accessToken) + { + this.AccessToken = accessToken; + } + + /// + /// 访问令牌. + /// + public string AccessToken { get; set; } + + /// + /// 获取客户端在Fawkes系统中的信息标头. + /// + /// Base64字符串. + public string GetFawkesreqBin() + { + var msg = new FawkesReq(); + msg.Appkey = MobileApp; + msg.Env = Envorienment; + return ToBase64(msg.ToByteArray()); + } + + /// + /// 获取元数据标头. + /// + /// Base64字符串. + public string GetMetadataBin() + { + var msg = new Metadata(); + msg.AccessKey = AccessToken; + msg.MobiApp = MobileApp; + msg.Build = Build; + msg.Channel = Channel; + msg.Buvid = Buvid; + msg.Platform = Platform; + return ToBase64(msg.ToByteArray()); + } + + /// + /// 获取设备标头. + /// + /// Base64字符串. + public string GetDeviceBin() + { + var msg = new Device(); + msg.AppId = AppId; + msg.MobiApp = MobileApp; + msg.Build = Build; + msg.Channel = Channel; + msg.Buvid = Buvid; + msg.Platform = Platform; + msg.Brand = Brand; + msg.Model = Model; + msg.Osver = OSVersion; + return ToBase64(msg.ToByteArray()); + } + + /// + /// 获取网络标头. + /// + /// Base64字符串. + public string GetNetworkBin() + { + var msg = new Network(); + msg.Type = Bilibili.Metadata.Network.NetworkType.Wifi; + msg.Oid = NetworkOid; + return ToBase64(msg.ToByteArray()); + } + + /// + /// 获取限制标头. + /// + /// Base64字符串. + public string GetRestrictionBin() + { + var msg = new Restriction(); + + return ToBase64(msg.ToByteArray()); + } + + /// + /// 获取本地化标头. + /// + /// Base64字符串. + public string GetLocaleBin() + { + var msg = new Locale(); + msg.CLocale = new LocaleIds(); + msg.SLocale = new LocaleIds(); + msg.CLocale.Language = Language; + msg.CLocale.Region = Region; + msg.SLocale.Language = Language; + msg.SLocale.Region = Region; + return ToBase64(msg.ToByteArray()); + } + + /// + /// 将数据转换为Base64字符串. + /// + /// 数据. + /// Base64字符串. + public string ToBase64(byte[] data) + { + return Convert.ToBase64String(data).TrimEnd('='); + } + } +} +#pragma warning restore SA1300 // Element should begin with upper-case letter diff --git a/src/Models/Models.gRPC/Models.gRPC.csproj b/src/Models/Models.gRPC/Models.gRPC.csproj new file mode 100644 index 0000000000000000000000000000000000000000..bac8c0dd50c511101d36f0597219fd7792d6f9b7 --- /dev/null +++ b/src/Models/Models.gRPC/Models.gRPC.csproj @@ -0,0 +1,102 @@ + + + + netstandard2.0 + Richasy.Bili.Models.gRPC + Richasy.Bili.Models.gRPC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Models/Models.gRPC/bilibili/account/fission/v1/fission.proto b/src/Models/Models.gRPC/bilibili/account/fission/v1/fission.proto new file mode 100644 index 0000000000000000000000000000000000000000..6b6d0a43f82c76d6e398d67660af07cefe1513ef --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/account/fission/v1/fission.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; + +package bilibili.account.fission.v1; + +//Fission裂变 +service Fission { + // 活动入口 + rpc Entrance (EntranceReq) returns (EntranceReply); + // 首页弹窗 + rpc Window (WindowReq) returns (WindowReply); +} + +// 活动入口-请求 +message EntranceReq {} + +// 活动入口-响应 +message EntranceReply { + // 展示图标 + string icon = 1; + // 活动名称 + string name = 2; + // 活动跳转链接 + string url = 3; + // 动画效果 + AnimateIcon animateIcon = 4; +} + +// 首页弹窗-请求 +message WindowReq {} + +//首页弹窗-响应 +message WindowReply { + // 弹窗类型 + // 0:弹窗 1:普通页面 + int32 type = 1; + // 跳转链接 + string url = 2; + // 上报数据字段 + string reportData = 3; +} + +//动画效果 +message AnimateIcon { + // icon文件 + string icon = 1; + // 动效json文件 + string json = 2; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/ad/v1/ad.proto b/src/Models/Models.gRPC/bilibili/ad/v1/ad.proto new file mode 100644 index 0000000000000000000000000000000000000000..2f30288d8350100f25d586b94ebdf37d70fdbb92 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/ad/v1/ad.proto @@ -0,0 +1,469 @@ +syntax = "proto3"; + +package bilibili.ad.v1; + +import "google/protobuf/wrappers.proto"; + +// 广告控制 +message AdsControlDto { + // 视频是否有弹幕,如有,需请求弹幕广告 + int32 hasDanmu = 1; + // 有弹幕的分P视频的cid + repeated int64 cids = 2; + // 有弹幕的ogv ep + repeated AdOgvEpDto eps = 3; +} + +// 有弹幕的ogv ep +message AdOgvEpDto { + // 分集epid + int64 epid = 1; + // 是否显示 "荐" + bool hasRecommend = 2; +} + +// 广告数据 +message SourceContentDto { + // 广告请求id + string requestId = 1; + // 广告资源位source ID + int32 sourceId = 2; + // 广告资源位resource ID + int32 resourceId = 3; + // 广告位上报标记,对广告返回数据恒为true + bool isAdLoc = 4; + // 与天马现有逻辑一致, 0有含义 + // 0:内容 1:广告 + google.protobuf.Int32Value serverType = 5; + // 客户端IP回传拼接 + string clientIp = 6; + // 广告卡片位置在一刷中的位置, 天马用, 0有含义 + google.protobuf.Int32Value cardIndex = 7; + // 广告资源位source 位次 + int32 index = 8; + // 广告内容 + AdDto adContent = 9; +} + +// 广告内容 +message AdDto { + // 广告创意ID + int64 creativeId = 1; + // 广告闭环上报回传数据 + string adCb = 2; + // 额外广告数据 + AdContentExtraDto extra = 3; + // 广告标记 + int32 cmMark = 4; + // + int64 topViewId = 5; + // + int32 creativeType = 6; + // + int32 cardType = 7; + // + int32 creativeStyle = 8; + // + int32 isAd = 9; + // + CreativeDto creativeContent = 10; +} + +// 额外广告数据 +message AdContentExtraDto { + // 动态布局 + string layout = 1; + // 展现监控url + repeated string showUrls = 2; + // 点击监控url + repeated string clickUrls = 3; + // 弹幕创意列表展示第三方上报 + repeated string danmuListShowUrls = 4; + // 弹幕创意列表点击第三方上报 + repeated string danmuListClickUrls = 5; + // 弹幕详情页展示第三方上报 + repeated string danmuDetailShowUrls = 6; + // 弹幕商品添加购物车第三方上报 + repeated string danmuTrolleyAddUrls = 7; + // useWebView默认false + bool useAdWebV2 = 8; + // app唤起白名单 + repeated string openWhitelist = 9; + // app下载白名单 + AppPackageDto downloadWhitelist = 10; + // 卡片相关信息 + AdCardDto card = 11; + // 视频播放和弹幕播放上报控制时间 ms + int32 reportTime = 12; + // 是否优先唤起app store + int32 appstorePriority = 13; + // 广告售卖类型 + int32 salesType = 14; + // 落地页是否预加载 + int32 preloadLandingpage = 15; + // 是否需要展示风险行业提示 + bool specialIndustry = 16; + // 风险行业提示 + string specialIndustryTips = 17; + // 是否展示下载弹框 + bool enableDownloadDialog = 18; + // 是否允许分享 + bool enableShare = 19; + // 个人空间广告入口类型 + // 1:橱窗 2:商品店铺 3:小程序 + int32 upzoneEntranceType = 20; + // 个人空间广告入口上报id,橱窗id(当前用Mid)、店铺id或者小程序id + int32 upzoneEntranceReportId = 21; + // 分享数据 + AdShareInfoDto shareInfo = 22; + // topview图片链接,闪屏预下载用 + string topviewPicUrl = 23; + // topview视频链接,闪屏预下载用 + string topviewVideoUrl = 24; + // 点击区域 + // 0:表示banner可点击 1:表示素材可点击 + int32 clickArea = 25; + // 店铺 + int64 shopId = 26; + // up主 + int64 upMid = 27; + // 回传id + string trackId = 28; + // 商店直投 + int32 enableStoreDirectLaunch = 29; + // DPA2.0商品ID + int64 product_id = 30; +} + +// +message CreativeDto { + // + string title = 1; + // + string description = 2; + // + string imageUrl = 3; + // + string imageMd5 = 4; + // + string url = 5; + // + string clickUrl = 6; + // + string showUrl = 7; + // + int64 videoId = 8; + // + string thumbnailUrl = 9; + // + string thumbnailUrlMd5 = 10; + // + string logoUrl = 11; + // + string logoMd5 = 12; + // + string username = 13; +} + +// app下载白名单 +message AppPackageDto { + // 包大小(单位bytes) + int64 size = 1; + // + string displayName = 2; + // + string apkName = 3; + // url + string url = 4; + // bili schema url + string biliUrl = 5; + // 包md5 + string md5 = 6; + // 包icon + string icon = 7; + // 开发者姓名 + string devName = 8; + // 权限地址 + string authUrl = 9; + // 权限名,逗号隔开 + string authName = 10; + // 版本 + string version = 11; + // 更新时间,yy-mm-hh格式 + string updateTime = 12; + // 隐私协议标题 + string privacy_name = 13; + // 隐私协议url + string privacy_url = 14; +} + +// 卡片 +message AdCardDto { + // 卡片类型 + int32 cardType = 1; + // 标题 + string title = 2; + // 描述 + string desc = 3; + // 额外描述 + string extraDesc = 4; + // 长描述 + string longDesc = 5; + // 短标题, 弹幕广告目录面板标题 + string shortTitle = 6; + // 弹幕/浮层广告的弹幕标题 + string danmuTitle = 7; + // 弹幕/浮层广告的弹幕高度,整型,分母为100 + int32 danmuHeight = 8; + // 弹幕/浮层广告的弹幕宽度,整型,分母为100 + int32 danmuWidth = 9; + // 弹幕/浮层广告生存时间,单位为毫秒 + int32 danmuLife = 10; + // 弹幕/浮层开始时间,单位为毫秒 + int32 danmuBegin = 11; + // 背景色值(含透明度)如#80FFFFFF + string danmuColor = 12; + // 弹幕/浮层广告H5落地页 + string danmuH5Url = 13; + // 弹幕/浮层 广告icon + string danmuIcon = 14; + // 折叠时间,永驻浮层折叠时间,单位为毫秒 + int32 foldTime = 15; + // 广告标文案 + string adTag = 16; + // cover数组 + repeated AdCoverDto covers = 17; + // 卡片跳转链接 + string jumpUrl = 18; + // + string imaxLandingPageJsonString = 19; + // app唤起schema + string callupUrl = 20; + // univeral link域名 + string universalApp = 21; + // 原价, 单位为分 + string oriPrice = 22; + // 现价, 同上 + int32 curPrice = 23; + // 券后/现价 价格描述 + string priceDesc = 24; + // 价格单位符号 + string priceSymbol = 25; + // 券后价格 "1000" + string goodsCurPrice = 26; + // 原价 "¥1002" + string goodsOriPrice = 27; + // 开放平台商品 + AdGoodDto good = 28; + // 打分? 满分为100 + int32 rank = 29; + // 热度 + int32 hotScore = 30; + // 按钮 + AdButtonDto button = 31; + // 广告主logo + string adverLogo = 32; + // 广告主name + string adverName = 33; + // 广告主主页链接 + string adverPageUrl = 34; + // 视频弹幕,视频广告用 + repeated string videoBarrage = 35; + // 商业标信息 + AdBusinessMarkDto adTagStyle = 36; + // 自动播放视频 + AdAutoPlayVideoDto video = 37; + // 反馈面板功能模块,屏蔽、投诉、广告介绍 + AdFeedbackPanelDto feedbackPanel = 38; + // + int64 adverMid = 39; + // + int64 adverAccountId = 40; + // + string duration = 41; + // + repeated QualityInfo qualityInfos = 42; + // 动态广告文本 + string dynamicText = 43; + // 广告主信息 + AdverDto adver = 44; + // 评分 + int32 grade_level = 45; +} + +// 分享 +message AdShareInfoDto { + // 分享标题 + string title = 1; + // 分享副标题 + string subtitle = 2; + // 分享图片url + string imageUrl = 3; +} + +// 广告卡片封面数据 +message AdCoverDto { + // 图片链接 + string url = 1; + // 动图循环次数 + // 0:无限循环 + int32 loop = 2; + // 图片点击跳转地址,截至目前为空 + string jumpUrl = 3; + // 跳转监测链接, 数组,单个图片的监控,出区别于click_urls,应前端要求。(此字段截至目前为空,使用时需再次确认) + repeated string reportUrls = 4; + // 图片高度 + int32 imageHeight = 5; + // 图片宽度 + int32 imageWidth = 6; +} + +// 按钮 +message AdButtonDto { + // 类型 + // 1:落地页 2:应用唤起 3:应用下载 + int32 type = 1; + // 按钮文案 + string text = 2; + // 按钮跳转地址 + string jumpUrl = 3; + // 跳转监测链接 + string reportUrls = 4; + // 唤起schema + string dlsucCallupUrl = 5; + //游戏id + int32 game_id = 6; + //游戏监控字段 + string game_monitor_param = 7; +} + +// 商业标信息 +message AdBusinessMarkDto { + // 商业标样式 + // 0:不展示标 1:实心+文字 2:空心框+文字 3:纯文字标 4:纯图片标 + int32 type = 1; + // 商业标文案 + string text = 2; + // 商业标文案颜色,如#80FFFFFF RGBA + string textColor = 3; + // 夜间模式文字色 + string textColorNight = 4; + // 背景色 + string bgColor = 5; + // 夜间模式背景色 + string bgColorNight = 6; + // 边框色 + string borderColor = 7; + // 夜间模式边框色 + string borderColorNight = 8; + // 图片商业标 + string imgUrl = 9; + // 图片高度 + int32 imgHeight = 10; + // 图片宽度 + int32 imgWidth = 11; + // + string bgBorderColor = 12; +} + + +// 自动播放视频 +message AdAutoPlayVideoDto { + // avid + int64 avid = 1; + // cid + int64 cid = 2; + // 分P + int64 page = 3; + // + string from = 4; + // 是否自动播放 + string url = 5; + // 是否自动播放 + string cover = 6; + // 是否自动播放 + bool autoPlay = 7; + // 按钮是否动态变色 + bool btnDycColor = 8; + // 按钮动态变色时间 ms + int32 btnDycTime = 9; + // 用于做联播是否是同一个视频的id + int64 bizId = 10; + // 开始播放三方监控 + repeated string process0Urls = 11; + // 播放3S三方监控 + repeated string play3SUrls = 12; + // 播放5S三方监控 + repeated string play5SUrls = 13; + // 横竖屏 + int32 orientation = 14; +} + +// 反馈面板功能模块 +message AdFeedbackPanelDto { + // 面板类型,广告、推广 + string panelTypeText = 1; + // 反馈面版信息 + repeated AdFeedbackPanelModuleDto feedbackPanelDetail = 2; +} + +// 反馈面版信息 +message AdFeedbackPanelModuleDto { + // 模块id + int32 moduleId = 1; + // icon url + string iconUrl = 2; + // 跳转类型 + // 1:气泡 2:H5 + int32 jumpType = 3; + // 跳转地址 + string jumpUrl = 4; + // 文案 + string text = 5; + // 二级文案数组 + repeated AdSecondFeedbackPanelDto secondaryPanel = 6; +} + +// 二级文案 +message AdSecondFeedbackPanelDto { + // 屏蔽理由id + int32 reasonId = 1; + // 理由文案 + string text = 2; +} + +// 开放平台商品 +message AdGoodDto { + // 电商商品ID + int64 itemId = 1; + // 电商SKU ID + int64 skuId = 2; + // 店铺ID + int64 shopId = 3; + // SKU库存 + int64 skuNum = 4; +} + +// +message QualityInfo { + // + string icon = 1; + // + string text = 2; +} + +// 广告主信息 +message AdverDto { + // + int64 adverId = 1; + // + string adverLogo = 2; + // + string adverName = 3; + // + int32 adverType = 4; + // + string adverPageUrl = 5; + // + string adverDesc = 6; +} diff --git a/src/Models/Models.gRPC/bilibili/api/probe/v1/probe.proto b/src/Models/Models.gRPC/bilibili/api/probe/v1/probe.proto new file mode 100644 index 0000000000000000000000000000000000000000..edfeae0f32f78ac0a3edf68168f2de3306dd6809 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/api/probe/v1/probe.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package bilibili.api.probe.v1; + +// +service Probe { + // + rpc TestCode (CodeReq) returns (CodeReply); + // + rpc TestReq (ProbeReq) returns (ProbeReply); + // + rpc TestStream (ProbeStreamReq) returns (ProbeStreamReply); + // + rpc TestSub (ProbeSubReq) returns (ProbeSubReply); +} + +// +message CodeReq { + // + int64 code = 1; +} + +// +message CodeReply {} + +// +message ProbeReq { + // + int64 mid = 1; + // + string buvid = 2; +} + +// +message ProbeReply { + // + string content = 1; + // + int64 timestamp = 2; +} + +// +message ProbeStreamReq { + // + int64 mid = 1; + // + int64 sequence = 2; +} + +// +message ProbeStreamReply { + // + int64 sequence = 1; + // + int64 timestamp = 2; + // + string content = 3; +} + +// +message ProbeSubReq { + // + int64 buvid = 1; +} + +// +message ProbeSubReply { + // + int64 messageId = 1; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/archive/middleware/v1/preload.proto b/src/Models/Models.gRPC/bilibili/app/archive/middleware/v1/preload.proto new file mode 100644 index 0000000000000000000000000000000000000000..e5b01e017249b25993a56943120e48d7788924f1 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/archive/middleware/v1/preload.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package bilibili.app.archive.middleware.v1; + +// 视频秒开参数 +message PlayerArgs { + // 清晰度 + int64 qn = 1; + // 流版本 + int64 fnver = 2; + // 流类型 + int64 fnval = 3; + // 返回url是否强制使用域名 + // 0:不强制使用域名 1:http域名 2:https域名 + int64 force_host = 4; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/archive/v1/archive.proto b/src/Models/Models.gRPC/bilibili/app/archive/v1/archive.proto new file mode 100644 index 0000000000000000000000000000000000000000..22f25a4498131d6c645e026aee7087d392827cf8 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/archive/v1/archive.proto @@ -0,0 +1,178 @@ +syntax = "proto3"; + +package bilibili.app.archive.v1; + +// 稿件基本信息 +message Arc{ + // 稿件avid + int64 aid = 1; + // 稿件分P数 + int64 videos = 2; + // 分区id + int32 typeId = 3; + // 二级分区名 + string typeName = 4; + // 稿件类型 + // 1:原创 2:转载 + int32 copyright = 5; + // 稿件封面url + string pic = 6; + // 稿件标题 + string title = 7; + // 稿件发布时间 + int64 pubdate = 8; + // 用户投稿时间 + int64 ctime = 9; + // 稿件简介 + string desc = 10; + // 稿件状态 + int32 state = 11; + // 访问属性 + // 0:全部可见 10000:登录可见 + int32 access = 12; + // 属性位配置(现在无了) + int32 attribute = 13; + // + string tag = 14; + // + repeated string tags = 15; + // 稿件总时长(单位为秒) + int64 duration = 16; + // 参与的活动id + int64 missionId = 17; + // 绑定的商单id + int64 orderId = 18; + // PGC稿件强制重定向url(如番剧、影视) + string redirectUrl = 19; + // + int64 forward = 20; + // 控制标志 + Rights rights = 21; + // UP主信息 + Author author = 22; + // 状态数 + Stat stat = 23; + // + string reportResult = 24; + // 投稿时发送的动态内容 + string dynamic = 25; + // 稿件1P cid + int64 firstCid = 26; + // 稿件1P 分辨率 + Dimension dimension = 27; + // 合作组成员列表 + repeated StaffInfo staffInfo = 28; + // UGC合集id + int64 seasonId = 29; + // 新版属性位配置(也没用) + int64 attributeV2 = 30; +} + +// UP主信息 +message Author{ + // UP主mid + int64 mid = 1; + // UP主昵称 + string name = 2; + // UP主头像url + string face = 3; +} + +// 分辨率 +message Dimension{ + // 宽度 + int64 width = 1; + // 高度 + int64 height = 2; + // 方向 + // 0:横屏 1:竖屏 + int64 rotate = 3; +} + +// 分P信息 +message Page{ + // 视频cid + int64 cid = 1; + // 分P序号 + int32 page = 2; + // 源类型 + // vupload:B站 qq:腾讯 hunan:芒果 + string from = 3; + // 分P标题 + string part = 4; + // 分P时长(单位为秒) + int64 duration = 5; + // 外链vid + string vid = 6; + // 分P简介 + string desc = 7; + // 外链url + string webLink = 8; + // 分P分辨率 + Dimension dimension = 9; +} + +// 稿件控制标志 +message Rights{ + // 老版是否付费 + int32 bp = 1; + // 允许充电 + int32 elec = 2; + // 允许下载 + int32 download = 3; + // 是否电影 + int32 movie = 4; + // PGC稿件需要付费 + int32 pay = 5; + // 是否高码率 + int32 hd5 = 6; + // 是否禁止转载标志 + int32 noReprint = 7; + // 是否允许自动播放 + int32 autoplay = 8; + // UGC稿件需要付费 + int32 ugcPay = 9; + // 是否联合投稿 + int32 isCooperation = 10; + // 是否UGC付费预览 + int32 ugcPayPreview = 11; + // 是否禁止后台播放 + int32 noBackground = 12; +} + +// 合作成员信息 +message StaffInfo{ + // 成员mid + int64 mid = 1; + // 成员角色 + string title = 2; + // 属性位 + // 0:普通 1:赞助商金色标志 + int64 attribute = 3; +} + +// 状态数 +message Stat{ + // 稿件avid + int64 aid = 1; + // 播放数 + int32 view = 2; + // 弹幕数 + int32 danmaku = 3; + // 评论数 + int32 reply = 4; + // 收藏数 + int32 fav = 5; + // 投币数 + int32 coin = 6; + // 分享数 + int32 share = 7; + // 当前排名 + int32 nowRank = 8; + // 历史最高排名 + int32 hisRank = 9; + // 点赞数 + int32 like = 10; + // 点踩数(前端不可见故恒为0) + int32 dislike = 11; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/card/v1/ad.proto b/src/Models/Models.gRPC/bilibili/app/card/v1/ad.proto new file mode 100644 index 0000000000000000000000000000000000000000..418b38468d469f1b056cafe89fb9cd347ab8e8b2 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/card/v1/ad.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; + +package bilibili.app.card.v1; + +// +message AdInfo { + // + int64 creative_id = 1; + // + int32 creative_type = 2; + // + int32 card_type = 3; + // + CreativeContent creative_content = 4; + // + string ad_cb = 5; + // + int64 resource = 6; + // + int32 source = 7; + // + string request_id = 8; + // + bool is_ad = 9; + // + int64 cm_mark = 10; + // + int32 index = 11; + // + bool is_ad_loc = 12; + // + int32 card_index = 13; + // + string client_ip = 14; + // + bytes extra = 15; + // + int32 creative_style = 16; +} + +// +message CreativeContent { + // + string title = 1; + // + string description = 2; + // + int64 video_id = 3; + // + string username = 4; + // + string image_url = 5; + // + string image_md5 = 6; + // + string log_url = 7; + // + string log_md5 = 8; + // + string url = 9; + // + string click_url = 10; + // + string show_url = 11; +} diff --git a/src/Models/Models.gRPC/bilibili/app/card/v1/card.proto b/src/Models/Models.gRPC/bilibili/app/card/v1/card.proto new file mode 100644 index 0000000000000000000000000000000000000000..87cdec8e2c254d0e245645ed5d31140c07f17399 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/card/v1/card.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package bilibili.app.card.v1; + +import "bilibili/app/card/v1/single.proto"; + +// 卡片信息 +message Card { + oneof item { + // 小封面条目 + SmallCoverV5 smallCoverV5 = 1; + // + LargeCoverV1 largeCoverV1 = 2; + // + ThreeItemAllV2 threeItemAllV2 = 3; + // + ThreeItemV1 threeItemV1 = 4; + // + HotTopic hotTopic = 5; + // + DynamicHot dynamicHot = 6; + // + MiddleCoverV3 middleCoverV3 = 7; + // + LargeCoverV4 largeCoverV4 = 8; + // 热门列表顶部按钮 + PopularTopEntrance popularTopEntrance = 9; + // + RcmdOneItem rcmdOneItem = 10; + } +} diff --git a/src/Models/Models.gRPC/bilibili/app/card/v1/common.proto b/src/Models/Models.gRPC/bilibili/app/card/v1/common.proto new file mode 100644 index 0000000000000000000000000000000000000000..2795f3e556e70616b2237624cf040894fa43f1d2 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/card/v1/common.proto @@ -0,0 +1,324 @@ +syntax = "proto3"; + +package bilibili.app.card.v1; + +import "bilibili/app/card/v1/ad.proto"; + +// 条目基本信息 +message Base { + // 卡片类型 + string cardType = 1; + // 卡片跳转类型? + string cardGoto = 2; + // 跳转类型 + // av:视频稿件 mid:用户空间 + string goto = 3; + // 目标参数 + string param = 4; + // 封面url + string cover = 5; + // 标题 + string title = 6; + // 跳转uri + string uri = 7; + // + ThreePoint threePoint = 8; + // + Args args = 9; + // + PlayerArgs playerArgs = 10; + // 条目排位序号 + int64 idx = 11; + // + AdInfo adInfo = 12; + // + Mask mask = 13; + //来源标识 + // recommend:推荐 operation:管理? + string fromType = 14; + // + repeated ThreePointV2 threePointV2 = 15; + // + repeated ThreePointV3 threePointV3 = 16; + // + Button descButton = 17; + // 三点v4 + ThreePointV4 threePointV4 = 18; +} + +// 按钮信息 +message Button { + // 文案 + string text = 1; + // 参数 + string param = 2; + // + string uri = 3; + // 事件 + string event = 4; + // + int32 selected = 5; + // 类型 + int32 type = 6; + // 事件v2 + string eventV2 = 7; + // 关系信息 + Relation relation = 8; +} + +// +message ThreePoint { + // + repeated DislikeReason dislikeReasons = 1; + // + repeated DislikeReason feedbacks = 2; + //稍后再看 + int32 watchLater = 3; +} + +// +message DislikeReason { + // + int64 id = 1; + // + string name = 2; +} + +// +message Args { + // + int32 type = 1; + // + int64 up_id = 2; + // + string up_name = 3; + // + int32 rid = 4; + // + string rname = 5; + // + int64 tid = 6; + // + string tname = 7; + // + string track_id = 8; + // + string state = 9; + // + int32 converge_type = 10; + // + int64 aid = 11; +} + +// +message PlayerArgs { + // + int32 is_live = 1; + // + int64 aid = 2; + // + int64 cid = 3; + // + int32 sub_type = 4; + // + int64 room_id = 5; + // + int64 ep_id = 7; + // + int32 is_preview = 8; + // + string type = 9; + // + int64 duration = 10; + // + int64 season_id = 11; +} + +// +message Mask { + // + Avatar avatar = 1; + // + Button button = 2; +} + +// +message Avatar { + // + string cover = 1; + // + string text = 2; + // + string uri = 3; + // + int32 type = 4; + // + string event = 5; + // + string event_v2 = 6; + // + int32 defalut_cover = 7; +} + +// +message ThreePointV2 { + // + string title = 1; + // + string subtitle = 2; + // + repeated DislikeReason reasons = 3; + // + string type = 4; + // + int64 id = 5; +} + +// +message ThreePointV3 { + // + string title = 1; + // + string selected_title = 2; + // + string subtitle = 3; + // + repeated DislikeReason reasons = 4; + // + string type = 5; + // + int64 id = 6; + // + int32 selected = 7; + // + string icon = 8; + // + string selected_icon = 9; + // + string url = 10; + // + int32 default_id = 11; +} + +// 三点v4 +message ThreePointV4 { + // 分享面板信息 + SharePlane share_plane = 1; + // 稍后再看 + WatchLater watch_later = 2; +} + +// 分享面板信息 +message SharePlane { + // 标题 + string title = 1; + // 副标贴文案 + string shareSubtitle = 2; + // 备注 + string desc = 3; + // 封面url + string cover = 4; + // 稿件avid + int64 aid = 5; + // 稿件bvid + string bvid = 6; + // 允许分享方式 + map shareTo = 7; + // UP主昵称 + string author = 8; + // UP主mid + int64 authorId = 9; + // 短连接 + string shortLink = 10; + // 播放次数文案 + string playNumber = 11; +} + +// 稍后再看信息 +message WatchLater { + // 稿件avid + int64 aid = 1; + // 稿件bvid + string bvid = 2; +} + +// 标签框信息 +message ReasonStyle { + // 文案 + string text = 1; + // 文字颜色 + string textColor = 2; + // 背景色 + string bgColor = 3; + // 边框色 + string borderColor = 4; + // 图标url + string iconUrl = 5; + // 文字颜色-夜间 + string textColorNight = 6; + // 背景色-夜间 + string bgColorNight = 7; + // 边框色-夜间 + string borderColorNight = 8; + // 图标url-夜间 + string iconNightUrl = 9; + // 背景风格id + // 1:无背景 2:有背景 + int32 bgStyle = 10; + // + string uri = 11; + // + string iconBgUrl = 12; + // + string event = 13; + // + string eventV2 = 14; + // + int32 rightIconType = 15; + // + string leftIconType = 16; +} + +// +message LikeButton { + // + int64 Aid = 1; + // + int32 count = 2; + // + bool show_count = 3; + // + string event = 4; + // + int32 selected = 5; + // + string event_v2 = 6; +} + +// +message Up { + // + int64 id = 1; + // + string name = 2; + // + string desc = 3; + // + Avatar avatar = 4; + // + int32 official_icon = 5; + // + Button desc_button = 6; + // + string cooperation = 7; +} + +// 关系信息 +message Relation { + // 关系状态 + int32 status = 1; + // 是否关注 + int32 isFollow = 2; + // 是否粉丝 + int32 isFollowed = 3; +} diff --git a/src/Models/Models.gRPC/bilibili/app/card/v1/double.proto b/src/Models/Models.gRPC/bilibili/app/card/v1/double.proto new file mode 100644 index 0000000000000000000000000000000000000000..beae32ae3a75fe2e0c4deb110da578f94d694e3b --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/card/v1/double.proto @@ -0,0 +1,416 @@ +syntax = "proto3"; + +package bilibili.app.card.v1; + +import "bilibili/app/card/v1/common.proto"; + +// +message DoubleCards { + oneof Card { + // + SmallCoverV2 small_cover_v2 = 1; + // + OnePicV2 one_pic_v2 = 2; + // + ThreePicV2 three_pic_v2 = 3; + } +} + +// +message SmallCoverV2 { + // + Base base = 1; + // + string cover_gif = 2; + // + int32 cover_blur = 3; + // + string cover_left_text_1 = 4; + // + int32 cover_left_icon_1 = 5; + // + string cover_left_text_2 = 6; + // + int32 cover_left_icon_2 = 7; + // + string cover_right_text = 8; + // + int32 cover_right_icon = 9; + // + string cover_right_background_color = 10; + // + string subtitle = 11; + // + string badge = 12; + // + string rcmd_reason = 13; + // + string desc = 14; + // + Avatar avatar = 15; + // + int32 official_icon = 16; + // + int32 can_play = 17; + // + ReasonStyle rcmd_reason_style = 18; + // + ReasonStyle rcmd_reason_style_v2 = 19; + // + LikeButton like_button = 20; +} + +// +message SmallCoverV3 { + // + Base base = 1; + // + Avatar avatar = 2; + // + string cover_left_text = 3; + // + Button cover_right_button = 4; + // + string rcmd_reason = 5; + // + string desc = 6; + // + int32 official_icon = 7; + // + int32 can_play = 8; + // + ReasonStyle rcmd_reason_style = 9; +} + +// +message MiddleCoverV2 { + // + Base base = 1; + // + int32 ratio = 2; + // + string desc = 3; + // + string badge = 4; +} + +// +message LargeCoverV2 { + // + Base base = 1; + // + Avatar avatar = 2; + // + string badge = 3; + // + Button cover_right_button = 4; + // + string cover_left_text_1 = 5; + // + int32 cover_left_icon_1 = 6; + // + string cover_left_text_2 = 7; + // + int32 cover_left_icon_2 = 8; + // + string rcmd_reason = 9; + // + int32 official_icon = 10; + // + int32 can_play = 11; + // + ReasonStyle rcmd_reason_style = 12; + // + int32 show_top = 13; + // + int32 show_bottom = 14; +} + +// +message ThreeItemV2 { + // + Base base = 1; + // + int32 title_icon = 2; + // + string more_uri = 3; + // + string more_text = 4; + // + repeated ThreeItemV2Item items = 5; +} + +// +message ThreeItemV2Item { + // + Base base = 1; + // + int32 cover_left_icon = 2; + // + string desc_text_1 = 3; + // + int32 desc_icon_1 = 4; + // + string desc_text_2 = 5; + // + int32 desc_icon_2 = 6; + // + string badge = 7; +} + +// +message SmallCoverV4 { + // + Base base = 1; + // + string cover_badge = 2; + // + string desc = 3; + // + string title_right_text = 4; + // + int32 title_right_pic = 5; +} + +// +message TwoItemV2 { + // + Base base = 1; + // + repeated TwoItemV2Item items = 2; +} + +message TwoItemV2Item { + // + Base base = 1; + // + string badge = 2; + // + string cover_left_text_1 = 3; + // + int32 cover_left_icon_1 = 4; +} + +// +message MultiItem { + // + Base base = 1; + // + string more_uri = 2; + // + string more_text = 3; + // + repeated DoubleCards items = 4; +} + +// +message ThreePicV2 { + // + Base base = 1; + // + string left_cover = 2; + // + string right_cover_1 = 3; + // + string right_cover_2 = 4; + // + string cover_left_text_1 = 5; + // + int32 cover_left_icon_1 = 6; + // + string cover_left_text_2 = 7; + // + int32 cover_left_icon_2 = 8; + // + string cover_right_text = 9; + // + int32 cover_right_icon = 10; + // + string cover_right_background_color = 11; + // + string badge = 12; + // + string rcmd_reason = 13; + // + string desc = 14; + // + Avatar avatar = 15; + // + ReasonStyle rcmd_reason_style = 16; +} + +// +message OnePicV2 { + // + Base base = 1; + // + int32 cover_left_icon_1 = 2; + // + string cover_left_text_2 = 3; + // + string cover_right_text = 4; + // + int32 cover_right_icon = 5; + // + string cover_right_background_color = 6; + // + string badge = 7; + // + string rcmd_reason = 8; + // + Avatar avatar = 9; + // + ReasonStyle rcmd_reason_style = 10; +} + +// +message LargeCoverV3 { + // + Base base = 1; + // + string cover_gif = 2; + // + Avatar avatar = 3; + // + ReasonStyle top_rcmd_reason_style = 4; + // + ReasonStyle bottom_rcmd_reason_style = 5; + // + string cover_left_text_1 = 6; + // + int32 cover_left_icon_1 = 7; + // + string cover_left_text_2 = 8; + // + int32 cover_left_icon_2 = 9; + // + string cover_right_text = 10; + // + string desc = 11; + // + int32 official_icon = 12; +} + +// +message ThreePicV3 { + // + Base base = 1; + // + string left_cover = 2; + // + string right_cover_1 = 3; + // + string right_cover_2 = 4; + // + string cover_left_text_1 = 5; + // + int32 cover_left_icon_1 = 6; + // + string cover_left_text_2 = 7; + // + int32 cover_left_icon_2 = 8; + // + string cover_right_text = 9; + // + int32 cover_right_icon = 10; + // + string cover_right_background_color = 11; + // + string badge = 12; + // + ReasonStyle rcmd_reason_style = 13; +} + +// +message OnePicV3 { + // + Base base = 1; + // + string cover_left_text_1 = 2; + // + int32 cover_left_icon_1 = 3; + // + string cover_right_text = 4; + // + int32 cover_right_icon = 5; + // + string cover_right_background_color = 6; + // + string badge = 7; + // + ReasonStyle rcmd_reason_style = 8; +} + +// +message SmallCoverV7 { + // + Base base = 1; + // + string desc = 2; +} + +// +message SmallCoverV9 { + // + Base base = 1; + // + string cover_left_text_1 = 2; + // + int32 cover_left_icon_1 = 3; + // + string cover_left_text_2 = 4; + // + int32 cover_left_icon_2 = 5; + // + string cover_right_text = 6; + // + int32 cover_right_icon = 7; + // + int32 can_play = 8; + // + ReasonStyle rcmd_reason_style = 9; + // + Up up = 10; + // + ReasonStyle left_cover_badge_style = 11; + // + ReasonStyle left_bottom_rcmd_reason_style = 12; +} + +// +message SmallCoverConvergeV2 { + // + Base base = 1; + // + string cover_left_text_1 = 2; + // + int32 cover_left_icon_1 = 3; + // + string cover_left_text_2 = 4; + // + int32 cover_left_icon_2 = 5; + // + string cover_right_text = 6; + // + string cover_right_top_text = 7; + // + ReasonStyle rcmd_reason_style = 8; + // + ReasonStyle rcmd_reason_style_v2 = 9; +} + +// +message SmallChannelSpecial { + // + Base base = 1; + // + string bg_cover = 2; + // + string desc_1 = 3; + // + string desc_2 = 4; + // + string badge = 5; + // + ReasonStyle rcmd_reason_style_2 = 6; +} diff --git a/src/Models/Models.gRPC/bilibili/app/card/v1/single.proto b/src/Models/Models.gRPC/bilibili/app/card/v1/single.proto new file mode 100644 index 0000000000000000000000000000000000000000..24ad90a0276affaad98b99f5fafb1a97f07ffcda --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/card/v1/single.proto @@ -0,0 +1,313 @@ +syntax = "proto3"; + +package bilibili.app.card.v1; + +import "bilibili/app/card/v1/common.proto"; + +// +message SmallCoverV5 { + // 条目基本信息 + Base base = 1; + // + string cover_gif = 2; + // + Up up = 3; + // 封面右下角标文案 + string cover_right_text_1 = 4; + // 右侧文案1 + string right_desc_1 = 5; + // 右侧文案2 + string right_desc_2 = 6; + // 右侧推荐原因标签框 + ReasonStyle rcmd_reason_style = 7; + // + HotwordEntrance hotword_entrance = 8; + // 直播小卡的角标 + ReasonStyle corner_mark_style = 9; + // 右侧文案1图标id + int32 right_icon_1 = 10; + // 右侧文案2图标id + int32 right_icon_2 = 11; + // 左上角角标 + ReasonStyle left_corner_mark_style = 12; +} + +// +message HotwordEntrance { + // + int64 hotword_id = 1; + // + string hot_text = 2; + // + string h5_url = 3; + // + string icon = 4; +} + +// +message LargeCoverV1 { + // 条目基本信息 + Base base = 1; + // + string cover_gif = 2; + // + Avatar avatar = 3; + // + string cover_left_text_1 = 4; + // + string cover_left_text_2 = 5; + // + string cover_left_text_3 = 6; + // + string cover_badge = 7; + // + string top_rcmd_reason = 8; + // + string bottom_rcmd_reason = 9; + // + string desc = 10; + // + int32 official_icon = 11; + // + int32 can_play = 12; + // + ReasonStyle top_rcmd_reason_style = 13; + // + ReasonStyle bottom_rcmd_reason_style = 14; + // + ReasonStyle rcmd_reason_style_v2 = 15; + // + ReasonStyle left_cover_badge_style = 16; + // + ReasonStyle right_cover_badge_style = 17; + // + string cover_badge_2 = 18; + // + LikeButton like_button = 19; + // + int32 title_single_line = 20; + // + string cover_right_text = 21; +} + +// +message ThreeItemAllV2 { + // 条目基本信息 + Base base = 1; + // + ReasonStyle top_rcmd_reason_style = 2; + // + repeated TwoItemHV1Item item = 3; +} + +// +message TwoItemHV1Item { + // + string title = 1; + // + string cover = 2; + // + string uri = 3; + // + string param = 4; + // + Args args = 5; + // + string goto = 6; + // + string cover_left_text_1 = 7; + // + int32 cover_left_icon_1 = 8; + // + string cover_right_text = 9; +} + +// 推荐 +message RcmdOneItem { + // 条目基本信息 + Base base = 1; + // 标签框信息 + ReasonStyle topRcmdReasonStyle = 2; + // 小封面推荐内容信息 + SmallCoverRcmdItem item = 3; +} + +// 小封面推荐内容信息 +message SmallCoverRcmdItem { + // 标题 + string title = 1; + // 封面url + string cover = 2; + // 跳转uri + string uri = 3; + // 参数 + string param = 4; + // 跳转类型 + // av:视频稿件 + string goto = 5; + // 封面右下角标文案 + string coverRightText1 = 6; + // 右侧文案1 + string rightDesc1 = 7; + // 右侧文案2 + string rightDesc2 = 8; + // + string coverGif = 9; + // 右侧文案1图标id + int32 rightIcon1 = 10; + // 右侧文案2图标id + int32 rightIcon2 = 11; +} + +// +message ThreeItemV1 { + // 条目基本信息 + Base base = 1; + // + int32 titleIcon = 2; + // + string moreUri = 3; + // + string moreText = 4; + // + repeated ThreeItemV1Item items = 5; +} + +// +message ThreeItemV1Item { + // 条目基本信息 + Base base = 1; + // + string coverLeftText = 2; + // + int32 coverLeftIcon = 3; + // + string desc1 = 4; + // + string desc2 = 5; + // + string badge = 6; +} + +// +message HotTopicItem { + // + string cover = 1; + // + string uri = 2; + // + string param = 3; + // + string name = 4; +} + +// +message HotTopic { + // 条目基本信息 + Base base = 1; + // + string desc = 2; + // + repeated HotTopicItem items = 3; +} + +// +message DynamicHot { + // 条目基本信息 + Base base = 1; + // + string top_left_title = 2; + // + string desc1 = 3; + // + string desc2 = 4; + // + string more_uri = 5; + // + string more_text = 6; + // + repeated string covers = 7; + // + string cover_right_text = 8; + // + ReasonStyle top_rcmd_reason_style = 9; +} + +// +message MiddleCoverV3 { + // 条目基本信息 + Base base = 1; + // + string desc1 = 2; + // + string desc2 = 3; + // + ReasonStyle cover_badge_style = 4; +} + +// +message LargeCoverV4 { + // 条目基本信息 + Base base = 1; + // + string cover_left_text_1 = 2; + // + string cover_left_text_2 = 3; + // + string cover_left_text_3 = 4; + // + string cover_badge = 5; + // + int32 can_play = 6; + // + Up up = 7; + // + string short_link = 8; + // + string share_subtitle = 9; + // + string play_number = 10; + // + string bvid = 11; + // + string sub_param = 12; +} + +// 热门列表顶部按钮 +message PopularTopEntrance { + // 条目基本信息 + Base base = 1; + // 按钮项 + repeated EntranceItem items = 2; +} + +// 热门列表按钮信息 +message EntranceItem { + // 跳转类型 + string goto = 1; + // 图标url + string icon = 2; + // 标题 + string title = 3; + // 入口模块id + string moduleId = 4; + // 跳转uri + string uri = 5; + // 入口id + int64 entranceId = 6; + // 气泡信息 + Bubble bubble = 7; + // 入口类型 + // 1:代表分品类热门 + int32 entranceType = 8; +} + +// 气泡信息 +message Bubble { + // 文案 + string bubbleContent = 1; + // 版本 + int32 version = 2; + // 起始时间 + int64 stime = 3; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/dynamic/v1/dynamic.proto b/src/Models/Models.gRPC/bilibili/app/dynamic/v1/dynamic.proto new file mode 100644 index 0000000000000000000000000000000000000000..229f48594e4a46a9f5a78db1cbcb1acbde475822 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/dynamic/v1/dynamic.proto @@ -0,0 +1,1354 @@ +syntax = "proto3"; + +package bilibili.app.dynamic.v1; + +import "bilibili/app/archive/middleware/v1/preload.proto"; + +// v1动态 +service Dynamic { + // 动态视频页 + rpc DynVideo (DynVideoReq) returns (DynVideoReqReply); + // 批量动态id获取动态详情 + rpc DynDetails (DynDetailsReq) returns (DynDetailsReply); + // 小视频连播页 + rpc SVideo (SVideoReq) returns (SVideoReply); + // 动态tab页 + rpc DynTab (DynTabReq) returns (DynTabReply); + // 同城接口开关 + rpc DynOurCitySwitch (DynOurCitySwitchReq) returns (NoReply); + // 动态同城页 + rpc DynOurCity(DynOurCityReq) returns (DynOurCityReply); + // 最近访问-个人视频feed流 + rpc DynVideoPersonal(DynVideoPersonalReq) returns (DynVideoPersonalReply); + // 最近访问-标记已读 + rpc DynUpdOffset(DynUpdOffsetReq) returns (NoReply); + // 动态红点接口 + rpc DynRed(DynRedReq) returns(DynRedReply); + // 查看更多-列表 + rpc DynMixUpListViewMore(NoReq) returns (DynMixUpListViewMoreReply); + // 查看更多-搜索 + rpc DynMixUpListSearch(DynMixUpListSearchReq) returns (DynMixUpListSearchReply); + // 同城点击上报 + rpc OurCityClickReport(OurCityClickReportReq) returns (OurCityClickReportReply); + // 位置定位 + rpc GeoCoder(GeoCoderReq) returns (GeoCoderReply); +} + +// 空请求 +message NoReq {} + +// 空响应 +message NoReply {} + +// 动态视频页-请求 +message DynVideoReq { + // 青少年模式 + int32 teenagers_mode = 1; + // 透传 update_baseline + string update_baseline = 2; + // 透传 history_offset + string offset = 3; + // 向下翻页数 + int32 page = 4; + // 刷新方式 + // 1:向上刷新 2:向下翻页 + int32 refresh_type = 5; + // 清晰度 + int32 qn = 6; + // 流版本 + int32 fnver = 7; + // 流类型 + int32 fnval = 8; + // 是否强制使用域名 + int32 force_host = 9; + // 是否4K + int32 fourk = 10; +} + +// 动态视频页-响应 +message DynVideoReqReply { + // 动态列表 + repeated DynamicItem list = 1; + // 更新的动态数 + int32 update_num = 2; + // 历史偏移 + string history_offset = 3; + // 更新基础信息 + string update_baseline = 4; + // 是否还有更多数据 + int32 has_more = 5; +} + +// 动态卡片项 +message DynamicItem { + // 卡片类型 + // forward:转发 av:稿件视频 fold:折叠 pgc:pgc内容 courses:付费视频 upList:最近访问列表 followList:我的追番列表 + string card_type = 1; + // 转发类型下,items的类型 + string item_type = 2; + // 模块内容 + repeated Module modules = 3; + // 动态ID str + string dyn_id_str = 4; + // 转发动态ID str + string orig_dyn_id_str = 5; + // r_type + int32 r_type = 6; + // 该卡片下面是否含有折叠卡 + int32 has_fold = 7; +} + +// 模块 +message Module { + // 类型 + // fold:折叠 author:发布人 dynamic:动态卡片内容 state:计数信息 forward:转发 extend:小卡信息 dispute:争议小黄条 desc:描述信息 + // likeUser:点赞用户 upList:最近访问列表 followList:我的追番 + string module_type = 1; + oneof module_item{ + // 折叠 + ModuleFold module_fold = 2; + // 发布人 + ModuleAuthor module_author = 3; + // 动态卡片内容 + ModuleDynamic module_dynamic = 4; + // 计数信息 + ModuleState module_state = 5; + // 转发 + ModuleForward module_forward = 6; + // 小卡信息 + ModuleExtend module_extend = 7; + // 争议小黄条 + ModuleDispute module_dispute = 8; + // 描述信息 + ModuleDesc module_desc = 9; + // 点赞用户 + ModuleLikeUser module_likeUser= 10; + // 最近访问列表 + ModuleDynUpList module_upList = 11; + // 我的追番 + ModuleFollowList module_followList = 12; + } +} + +// 折叠模块 +message ModuleFold { + // 折叠分类(该字段废弃) + int32 fold_type = 1; + // 折叠文案 + string text = 2; + // 被折叠的动态 + string fold_ids = 3; + // 被折叠的用户信息 + repeated UserInfo fold_users = 4; + // 折叠分类 + FoldType fold_type_v2 = 5; +} + +// 折叠分类 +enum FoldType { + // 占位 + FoldTypeZero = 0; + // 用户发布折叠 + FoldTypePublish = 1; + // 转发超频折叠 + FoldTypeFrequent = 2; + // 联合投稿折叠 + FoldTypeUnite = 3; + // 动态受限折叠 + FoldTypeLimit = 4; +} + +// 作者信息模块 +message ModuleAuthor { + // 用户mid + int64 id = 1; + // 时间标签 + string ptime_label_text = 2; + // 用户详情 + UserInfo author = 3; + // 装扮卡片 + DecorateCard decorate_card = 4; +} + +// 争议小黄条模块 +message ModuleDispute { + // 标题 + string title = 1; + // 描述内容 + string desc = 2; + // 跳转链接 + string uri = 3; +} + +// 文本内容模块 +message ModuleDesc { + // 文本描述 + repeated Description desc = 1; +} + +// 动态详情模块 +message ModuleDynamic { + // 卡片类型 + // ugc:ugc卡 pgc:pgc卡 currSeason:付费课程系列 currBatch:付费课程批次 + string card_type = 1; + // 正文卡片 + oneof card { + // ugc卡 + CardUGC card_ugc = 2; + // pgc卡 + CardPGC card_pgc = 3; + // 付费课程系列 + CardCurrSeason card_curr_season = 4; + // 付费课程批次 + CardCurrBatch card_curr_batch = 5; + } +} + +// 点赞用户模块 +message ModuleLikeUser { + // 点赞用户 + repeated LikeUser like_users = 1; + // 文案 + string display_text = 2; +} + +// 计数信息模块 +message ModuleState { + // 转发数 + int32 repost = 1; + // 点赞数 + int32 like = 2; + // 评论数 + int32 reply = 3; + // 点赞拓展信息 + LikeInfo like_info = 4; + // 禁评 + bool no_comment = 5; + // 禁转 + bool no_forward = 6; +} + +// 转发模块 +message ModuleForward { + // 卡片类型 + string card_type = 1; + // 嵌套模型 + repeated Module modules= 2; +} + +// UGC视频卡片数据 +message CardUGC { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 秒开地址 + string uri = 3; + // 视频封面展示项 1 + string cover_left_text_1 = 4; + // 视频封面展示项 2 + string cover_left_text_2 = 5; + // 封面视频展示项 3 + string cover_left_text_3 = 6; + // avid + int64 avid = 7; + // cid + int64 cid = 8; + // 视频源类型 + MediaType media_type = 9; + // 尺寸信息 + Dimension dimension = 10; + // 角标 + repeated VideoBadge badge = 11; + // 是否能够自动播放 + int32 can_play= 12; +} + +// PGC视频卡片数据 +message CardPGC { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 秒开地址 + string uri = 3; + // 视频封面展示项 1 + string cover_left_text_1 = 4; + // 视频封面展示项 2 + string cover_left_text_2 = 5; + // 封面视频展示项 3 + string cover_left_text_3 = 6; + // cid + int64 cid = 7; + // season_id + int64 season_id = 8; + // epid + int64 epid = 9; + // aid + int64 aid = 10; + // 视频源类型 + MediaType media_type = 11; + // 番剧类型 + VideoSubType sub_type = 12; + // 番剧是否为预览视频 0:否,1:是 + int32 is_preview = 13; + // 尺寸信息 + Dimension dimension = 14; + // 角标 + repeated VideoBadge badge = 15; + // 是否能够自动播放 + int32 can_play= 16; + // PGC单季信息 + PGCSeason season = 17; +} + +// 付费课程系列卡 +message CardCurrSeason { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 跳转地址 + string uri = 3; + // 展示项 1(更新信息) + string text_1 = 4; + // 描述信息 + string desc = 5; + // 角标 + VideoBadge badge = 6; +} + +// 付费课程批次卡 +message CardCurrBatch { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 跳转地址 + string uri = 3; + // 展示项 1(本集标题) + string text_1 = 4; + // 展示项 2(更新了多少个视频) + string text_2 = 5; + // 角标 + VideoBadge badge = 6; +} + +// 角标信息 +message VideoBadge { + // 文案 + string text = 1; + // 文案颜色-日间 + string text_color = 2; + // 文案颜色-夜间 + string text_color_night = 3; + // 背景颜色-日间 + string bg_color = 4; + // 背景颜色-夜间 + string bg_color_night = 5; + // 边框颜色-日间 + string border_color = 6; + // 边框颜色-夜间 + string border_color_night = 7; + // 样式 + int32 bg_style = 8; +} + +// 尺寸信息 +message Dimension { + int64 height = 1; + int64 width = 2; + int64 rotate = 3; +} + +// 番剧类型 +enum VideoSubType { + // 没有子类型 + VideoSubTypeNone = 0; + // 番剧 + VideoSubTypeBangumi = 1; + // 电影 + VideoSubTypeMovie = 2; + // 纪录片 + VideoSubTypeDocumentary = 3; + // 国创 + VideoSubTypeDomestic = 4; + // 电视剧 + VideoSubTypeTeleplay = 5; +} + +// 播放器类型 +enum MediaType { + // 本地 + MediaTypeNone = 0; + // UGC + MediaTypeUGC = 1; + // PGC + MediaTypePGC = 2; + // 直播 + MediaTypeLive = 3; + // 小视频 + MediaTypeVCS = 4; +} + +// 拓展信息 +message ModuleExtend { + // 拓展 + repeated Extend extend = 1; +} + +// 拓展 +message Extend { + // 类型 + // topic:话题小卡 lbs:lbs hot:热门视频 game:游戏 + string type = 1; + // 卡片详情 + oneof extend { + // 话题小卡 + ExtInfoTopic ext_info_topic = 2; + // lbs + ExtInfoLBS ext_info_lbs = 3; + // 热门视频 + ExtInfoHot ext_info_hot = 4; + // 游戏 + ExtInfoGame ext_info_game = 5; + } +} + +// 拓展信息-游戏小卡 +message ExtInfoGame { + // 标题 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; +} + +// 拓展信息-话题小卡 +message ExtInfoTopic { + // 标题-话题名 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; +} + +// 拓展信息-lbs +message ExtInfoLBS { + // 标题 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; + // poiType + int32 poi_type = 4; +} + +// 拓展信息-热门视频 +message ExtInfoHot { + // 标题 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; +} + +// 点赞拓展信息 +message LikeInfo { + // 点赞动画 + LikeAnimation animation = 1; + // 是否点赞 + int32 is_like = 2; +} + +// 点赞用户 +message LikeUser { + // 用户mid + int64 uid = 1; + // 用户昵称 + string uname = 2; + // 点击跳转链接 + string uri = 3; +} + +// 点赞动画 +message LikeAnimation { + // 开始动画 + string begin = 1; + // 过程动画 + string proc = 2; + // 结束动画 + string end = 3; + // id + int64 like_icon_id = 4; +} + +// 文本描述 +message Description { + // 文本内容 + string text = 1; + // 文本类型 + string type = 2; + // 点击跳转链接 + string uri = 3; + // emoji类型 + string emoji_type = 4; + // 商品类型 + string goods_type = 5; +} + +// 装扮卡片 +message DecorateCard { + // 装扮卡片id + int64 id = 1; + // 装扮卡片链接 + string card_url = 2; + // 装扮卡片点击跳转链接 + string jump_url = 3; + // 粉丝样式 + DecoCardFan fan = 4; +} + +// 粉丝样式 +message DecoCardFan { + // 是否是粉丝 + int32 is_fan = 1; + // 数量 + int32 number = 2; + // 颜色 + string color = 3; +} + +// 用户信息 +message UserInfo { + // 用户mid + int64 mid = 1; + // 用户昵称 + string name = 2; + // 用户头像 + string face = 3; + // 认证信息 + OfficialVerify official = 4; + // 大会员信息 + VipInfo vip = 5; + // 直播信息 + LiveInfo live = 6; + // 空间页跳转链接 + string uri = 7; + // 挂件信息 + UserPendant pendant = 8; + // 认证名牌 + Nameplate nameplate = 9; +} + +// 认证名牌 +message Nameplate { + // nid + int64 nid = 1; + // 名称 + string name = 2; + // 图片地址 + string image = 3; + // 小图地址 + string image_small = 4; + // 等级 + string level = 5; + // 获取条件 + string condition = 6; +} + +// 头像挂件信息 +message UserPendant { + // pid + int64 pid = 1; + // 名称 + string name = 2; + // 图片链接 + string image = 3; + // 有效期 + int64 expire = 4; +} + +// 认证信息 +message OfficialVerify { + // 认证类型 + // 127:未认证 0:个人 1:机构 + int32 type = 1; + // 认证描述 + string desc = 2; + // + int32 is_atten = 3; +} + +// 大会员信息 +message VipInfo { + // 大会员类型 + int32 Type = 1; + // 大会员状态 + int32 status = 2; + // 到期时间 + int64 due_date = 3; + // 标签 + VipLabel label = 4; + // 主题 + int32 theme_type = 5; +} + +// 大会员标签 +message VipLabel { + // 图片地址 + string path = 1; +} + +// 直播信息 +message LiveInfo { + // 是否在直播 + // 0:未直播 1:正在直播 + int32 is_living = 1; + // 跳转链接 + string uri = 2; +} + +// 批量动态id获取动态详情请求参数 +message DynDetailsReq { + // 青少年模式 + int32 teenagers_mode = 1; + // 动态id + string dynamic_ids = 2; + // 清晰度 + int32 qn = 3; + // 流版本 + int32 fnver = 4; + // 流功能 + int32 fnval = 5; + // 是否强制使用域名 + int32 force_host = 6; + // 是否4k + int32 fourk = 7; +} + +// 批量动态id获取动态详情返回值 +message DynDetailsReply { + // 动态列表 + repeated DynamicItem list = 1; +} + +// 小视频连播页-请求 +message SVideoReq { + // 当前素材的id + int64 oid = 1; + // 当前素材类型 + // 1:动态(如果有oid则必传) 2:热门分类 3:热点聚合 + SVideoType type = 2; + // 翻页offset + string offset = 3; + // 清晰度(旧版) + int32 qn = 4; + // 流版本(旧版) + int32 fnver = 5; + // 流类型(旧版) + int32 fnval = 6; + // 是否强制使用域名(旧版) + int32 force_host = 7; + // 是否4k(旧版) + int32 fourk = 8; + // 当前页面spm + string spmid = 9; + // 上级页面spm + string from_spmid = 10; + // 秒开参数 + PlayerPreloadParams player_preload = 11; + // 热门进入联播页的锚点aid + int64 focus_aid = 12; + // 秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 13; +} + +// 入口联播页类型 +enum SVideoType { + // 无类型 + TypeNone = 0; + // 动态 + TypeDynamic = 1; + // 热门分类 + TypePopularIndex = 2; + // 热点聚合 + TypePopularHotword = 3; +} + +// 小视频连播页-响应 +message SVideoReply { + // 列表 + repeated SVideoItem list = 1; + // 翻页游标 + string offset = 2; + // 是否还有更多数据 + // 1:有 + int32 has_more = 3; + // 顶部 + SVideoTop top = 4; +} + +// 顶部 +message SVideoTop { + // 联播页标题 + string Title = 1; + // 联播页导语 + string Desc = 2; +} + +// 秒开参数 +message PlayerPreloadParams { + // 清晰度 + int32 qn = 1; + // 流版本 + int32 fnver = 2; + // 流类型 + int32 fnval = 3; + // 是否强制使用域名 + int32 force_host = 4; + // 是否4k + int32 fourk = 5; +} + +// 小视频卡片项 +message SVideoItem { + // 卡片类型 + // av:稿件视频 + string card_type = 1; + // 模块内容 + repeated SVideoModule modules = 2; + // 动态ID str + string dyn_id_str = 3; + // 卡片游标 + int64 index = 4; +} + +// 小视频模块 +message SVideoModule { + // 类型 + // author:发布人 player:播放器内容 desc:描述信息 stat:计数信息 + string module_type = 1; + oneof module_item { + // 发布人 + SVideoModuleAuthor module_author = 2; + // 播放器内容 + SVideoModulePlayer module_player = 3; + // 描述信息 + SVideoModuleDesc module_desc = 4; + // 计数信息 + SVideoModuleStat module_stat = 5; + } +} + +// 作者信息模块 +message SVideoModuleAuthor { + // 用户mid + int64 mid = 1; + // 用户昵称 + string name = 2; + // 用户头像 + string face = 3; + // 发布描述 + string pub_desc = 4; + // 是否关注up + // 1:已关注 + int32 is_attention = 5; + // 跳转地址 + string uri = 6; +} + +// 播放器模块 +message SVideoModulePlayer { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 跳转地址,秒开地址如果有会拼接player_preload可参考天马 + string uri = 3; + // aid + int64 aid = 4; + // cid + int64 cid = 5; + // 视频时长 + int64 duration = 6; + // 尺寸信息 + Dimension dimension = 7; +} + +// 文本内容模块 +message SVideoModuleDesc { + // 文本内容 + string text = 1; + // 跳转地址 + string uri = 2; +} + +// 计数信息模块 +message SVideoModuleStat { + // 计数内容 + repeated SVideoStatInfo stat_info = 1; + // 分享需要 + ShareInfo share_info = 2; +} + +// 计数内容 +message SVideoStatInfo { + // 计数icon + // 1:分享符号 2:评论符号 3:点赞符号 + int32 icon = 1; + // 计数值 + int64 num = 2; + // 选中状态 + // 1:选中 + int32 selected = 3; + // 跳转链接(如评论) + string uri = 4; +} + +// 分享需要 +message ShareInfo { + // 稿件avid + int64 aid = 1; + // 稿件bvid + string bvid = 2; + // 标题 + string title = 3; + // 副标题 + string subtitle = 4; + // 稿件封面 + string cover = 5; + // up mid + int64 mid = 6; + // up昵称 + string name = 7; +} + +// 动态tab页-请求 +message DynTabReq { + // 青少年模式 + // 1:开启青少年模式 + int32 teenagers_mode = 1; +} + +// 动态tab页-响应 +message DynTabReply { + // 动态tab详情列表 + repeated DynTab dyn_tab = 1; +} + +// 动态tab详情 +message DynTab { + // tab标题 优先展示用,未开启状态第一次请求返回同城,后续请求返回对应城市名 + string title = 1; + // 跳转链接 + string uri = 2; + // 气泡内容 + string bubble = 3; + // 是否推红点 + int32 red_point = 4; + // 城市ID + int64 city_id = 5; + // 是否弹窗 + int32 is_popup = 6; + // 弹窗内容 + Popup popup = 7; + // 是否默认tab + bool defaultTab = 8; + // 副标题 对应城市名 + string sub_title = 9; + // 锚点字段 + string anchor = 10; + // 内测文案 + string internal_test = 11; +} + +// 动态tab弹窗详情 +message Popup { + // 标题 + string title = 1; + // 文案 + string desc = 2; + // 文案附加跳转地址 + string uri = 3; +} + +// 动态同城开关-请求 +message DynOurCitySwitchReq { + // 开关参数 + // 0:关闭 1:开启 + int32 switch = 1; +} + +// 动态同城页-请求 +message DynOurCityReq { + // 城市ID + int64 city_id = 1; + // 纬度 + double lat = 2; + // 经度 + double lng = 3; + // 透传上一次接口请求返回的offset + string offset = 4; + // 每页元素个数 + int32 page_size = 5; + // 青少年模式 + // 1:开启青少年模式 + int32 teenagers_mode = 6; + // 清晰度(旧版) + int32 qn = 7; + // 流版本(旧版) + int32 fnver = 8; + // 流类型(旧版) + int32 fnval = 9; + // 是否强制使用域名(旧版) + int32 force_host = 10; + // 是否4k(旧版) + int32 fourk = 11; + // 是否开启lbs + // 0:关闭 1:开启 + int32 lbs_state = 12; + // 是否刷新城市 + uint32 refresh_city = 13; + // 魔镜设置 + ExpConf exp_conf = 14; + // 秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 15; + // 城市码 + int64 city_code = 16; + // 构建时间 + int64 build_time = 17; +} + +// 魔镜设置 +message ExpConf { + // 是否是魔镜请求 + int32 exp_enable = 1; + // 实验配置 + repeated Exp exps = 2; +} + +// 魔镜实验配置项 +message Exp { + // 实验名 + string exp_name = 1; + // 实验组 + string exp_group = 2; +} + +// 动态同城-响应 +message DynOurCityReply { + // 翻页游标 + string offset = 1; + // 是否还有更多数据 + // 1:有 + int32 has_more = 2; + // 样式类型 + // 1:双列 2:瀑布流 + int32 style = 3; + // 顶导信息 + string top_label = 4; + // 列表详情 + repeated DynOurCityItem list = 5; + // 顶导按钮信息 + string top_button_label = 6; + // 城市ID + int32 city_id = 7; + // 城市名 + string city_name = 8; +} + +// 动态同城物料 +message DynOurCityItem { + // 卡片类型 + // av:稿件 draw:图文 + string card_type = 1; + // 动态ID + int64 dyn_id = 2; + // 跳转地址 + string uri = 3; + // 模块列表 + repeated DynOurCityModule modules = 4; + // 资源ID + int64 rid = 5; + // 透传服务端魔镜参数 + string debug_info = 6; +} + +// 动态同城物料模块 +message DynOurCityModule { + // 类型 + // cover:封面 desc:描述 author:发布人 extend:扩展部分 + string module_type = 1; + oneof module_item { + // 封面 + DynOurCityModuleCover module_cover = 2; + // 描述 + DynOurCityModuleDesc module_desc = 3; + // 发布人 + DynOurCityModuleAuthor module_author = 4; + // 扩展部分 + DynOurCityModuleExtend module_extend = 5; +} +} + +// 动态同城物料-封面模块 +message DynOurCityModuleCover { + // 封面图 单图样式取第一个元素 + repeated string covers = 1; + // 封面样式 + // 1:横图 2:竖图 3:方图 + int32 style = 2; + // 视频封面展示项图标 1 + int32 cover_left_icon_1 = 3; + // 视频封面展示项 1 + string cover_left_text_1 = 4; + // 视频封面展示项图标 2 + int32 cover_left_icon_2 = 5; + // 视频封面展示项 2 + string cover_left_text_2 = 6; + // 封面视频展示项 3 + string cover_left_text_3 = 7; + // 角标 + repeated VideoBadge badge = 8; +} + +// 动态同城物料-描述模块 +message DynOurCityModuleDesc { + // 描述信息 + string desc = 1; +} + +// 动态同城物料-发布人模块 +message DynOurCityModuleAuthor { + // 用户Mid + int64 mid = 1; + // 用户昵称 + string name = 2; + // 用户头像 + string face = 3; + // 跳转地址 + string uri = 4; +} + +// 动态同城物料-扩展部分模块 +message DynOurCityModuleExtend { + // 类型 + string type = 1; + oneof extend { + // LBS模块 + DynOurCityModuleExtendLBS extend_lbs = 2; + } +} + +// 动态同城物料extent-LBS模块 +message DynOurCityModuleExtendLBS{ + // 标题 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; + // poiType + int32 poi_type = 4; +} + +// 最近访问up主列表 +message ModuleDynUpList { + // 标题展示文案 + string module_title = 1; + // “全部”按钮文案 + string show_all = 2; + // up主列表 + repeated UpListItem list = 3; +} + +// up主列表 +message UpListItem { + // 是否有更新 + // 0:没有 1:有 + int32 has_update = 1; + // up主头像 + string face = 2; + // up主昵称 + string name = 3; + // up主uid + int64 uid = 4; +} + +// 我的追番列表 +message ModuleFollowList { + // 查看全部的跳转链接 + string view_all_link = 1; + // + repeated FollowListItem list = 2; +} + +// 我的追番列表Item +message FollowListItem { + // season_id + int32 season_id = 1; + // 标题 + string title = 2; + // 封面图 + string cover = 3; + // 跳转链接 + string url = 4; + // 最新ep + NewEP new_ep = 5; +} + +// 最新ep +message NewEP { + // 最新话epid + int32 id = 1; + // 更新至XX话 + string index_show = 2; + // 更新剧集的封面 + string cover = 3; +} + +// 最近访问-个人feed流列表-请求 +message DynVideoPersonalReq { + // 青少年模式 + // 1:开启青少年模式 + int32 teenagers_mode = 1; + // 被访问者的mid + int64 host_uid = 2; + // 偏移量 第一页可传空 + string offset = 3; + // 标明下拉几次 + int32 page = 4; + // 是否是预加载 + int32 is_preload = 5; + // 清晰度 + int32 qn = 6; + // 流版本 + int32 fnver = 7; + // 流类型 + int32 fnval = 8; + // 是否强制使用域名 + int32 force_host = 9; + // 是否4k + int32 fourk = 10; +} + +// 最近访问-个人feed流列表-响应 +message DynVideoPersonalReply { + // 动态列表 + repeated DynamicItem list = 1; + // 偏移量 + string offset = 2; + // 是否还有更多数据 + int32 has_more = 3; + // 已读进度 + string read_offset = 4; +} + +// 最近访问-标记已读-请求 +message DynUpdOffsetReq { + // 被访问者的UID + int64 host_uid = 1; + // 用户已读进度 + string read_offset = 2; +} + +// PGC单季信息 +message PGCSeason { + // 是否完结 + int32 is_finish = 1; + // 标题 + string title = 2; + // 类型 + int32 type = 3; +} + +// 动态红点接口-请求 +message DynRedReq { + // 动态红点接口各tab offset信息 + repeated TabOffset tab_offset = 1; +} + +// 动态红点接口各tab offset信息 +message TabOffset { + // 1:综合页 2:视频页 + int32 tab = 1; + // 上一次对应列表页offset + string offset = 2; +} + +// 红点接口-响应 +message DynRedReply { + // 类型 + // count:数字红点 point:普通红点 no_point:没有红点 + string red_type = 1; + // 红点具体信息 + DynRedItem dyn_red_item = 2; + // 默认tab 值对应tab接口下发的anchor + string default_tab = 3; +} + +// 红点接口物料 +message DynRedItem { + // 数字红点有效 更新数 + uint64 count = 1; +} + +// 直播信息 +message MixUpListLiveItem { + // 直播状态 + // 0:未直播 1:直播中 + bool status = 1; + // 房间号 + int64 room_id = 2; + // 跳转地址 + string uri = 3; +} + +// 查看更多-列表单条数据 +message MixUpListItem { + // 用户mid + int64 uid = 1; + // 特别关注 + // 0:否 1:是 + int32 special_attention = 2; + // 小红点状态 + // 0:没有 1:有 + int32 reddot_state = 3; + // 直播信息 + MixUpListLiveItem live_info = 4; + // 昵称 + string name = 5; + // 头像 + string face = 6; + // 认证信息 + OfficialVerify official = 7; + // 大会员信息 + VipInfo vip = 8; + // 关注状态 + Relation relation = 9; +} + +// 查看更多-列表-响应 +message DynMixUpListViewMoreReply { + // 关注up主列表信息 + repeated MixUpListItem items = 1; + // 默认搜索文案 + string search_default_text = 2; +} + +// 查看更多-搜索-请求 +message DynMixUpListSearchReq { + // + string name = 1; +} + +// 查看更多-搜索-响应 +message DynMixUpListSearchReply { + // + repeated MixUpListItem items = 1; +} + +// 关注关系 +message Relation { + // 关注状态 + RelationStatus status = 1; + // 关注 + int32 is_follow = 2; + // 被关注 + int32 is_followed = 3; + // 文案 + string title = 4; +} + +// 关注状态 +enum RelationStatus { + relation_status_none = 0; + // 未关注 + relation_status_nofollow = 1; + // 关注 + relation_status_follow = 2; + // 被关注 + relation_status_followed = 3; + // 互相关注 + relation_status_mutual_concern = 4; + // 特别关注 + relation_status_special = 5; +} + +// 动态同城点击上报-请求 +message OurCityClickReportReq { + // 动态ID + string dynamic_id = 1; + // 城市ID + int64 city_id = 2; + // 纬度 + double lat = 3; + // 经度 + double lng = 4; +} + +// 动态同城点击上报-响应 +message OurCityClickReportReply {} + +// 位置定位-请求 +message GeoCoderReq { + // 纬度 + double lat = 1; + // 经度 + double lng = 2; + // 页面来源 + string from = 3; +} + +// 位置定位-响应 +message GeoCoderReply { + // 以行政区划+道路+门牌号等信息组成的标准格式化地址 + string address = 1; + // 地址部件,address不满足需求时可自行拼接 + AddressComponent address_component = 2; + // 行政区划信息 + AdInfo ad_info = 3; +} + +// 地址部件 +message AddressComponent { + // 国家 + string nation = 1; + // 省 + string province = 2; + // 市 + string city = 3; + // 区,可能为空字串 + string district = 4; + // 街道,可能为空字串 + string street = 5; + // 门牌,可能为空字串 + string street_number = 6; +} + +// 行政区划信息 +message AdInfo { + // 国家代码(ISO3166标准3位数字码) + string nation_code = 1; + // 行政区划代码,规则详见:行政区划代码说明 + string adcode = 2; + // 城市代码,由国家码+行政区划代码(提出城市级别)组合而来,总共为9位 + string city_code = 3; + // 行政区划名称 + string name = 4; + // 行政区划中心点坐标 + Gps gps = 5; +} + +// 行政区划中心点坐标 +message Gps { + // 纬度 + double lat = 1; + // 经度 + double lng = 2; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/dynamic/v2/dynamic.proto b/src/Models/Models.gRPC/bilibili/app/dynamic/v2/dynamic.proto new file mode 100644 index 0000000000000000000000000000000000000000..215d3577c82de89e97c3b9f2319893c52203e12d --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/dynamic/v2/dynamic.proto @@ -0,0 +1,3313 @@ +syntax = "proto3"; + +package bilibili.app.dynamic.v2; + +import "google/protobuf/any.proto"; +import "bilibili/app/archive/middleware/v1/preload.proto"; + +// v2动态 +service Dynamic { + // 动态视频页 + rpc DynVideo(DynVideoReq) returns (DynVideoReply); + // 动态综合页 + rpc DynAll(DynAllReq) returns (DynAllReply); + // 批量动态id获取动态详情 + rpc DynDetails(DynDetailsReq) returns (DynDetailsReply); + // 视频页最近访问 - 个人feed流 + rpc DynVideoPersonal(DynVideoPersonalReq) returns (DynVideoPersonalReply); + // 视频页最近访问 - 标记已读 + rpc DynVideoUpdOffset(DynVideoUpdOffsetReq) returns (NoReply); + // 动态通用附加卡-follow/取消follow + rpc DynAdditionCommonFollow(DynAdditionCommonFollowReq) returns(DynAdditionCommonFollowReply); + // 动态点赞 + rpc DynThumb(DynThumbReq) returns(NoReply); + // 动态发布生成临时卡 + rpc DynFakeCard(DynFakeCardReq) returns(DynFakeCardReply); + // 关注推荐up主换一换 + rpc DynRcmdUpExchange(DynRcmdUpExchangeReq) returns(DynRcmdUpExchangeReply); + // 综合页最近访问 - 个人feed流 + rpc DynAllPersonal(DynAllPersonalReq) returns (DynAllPersonalReply); + // 综合页最近访问 - 标记已读 + rpc DynAllUpdOffset(DynAllUpdOffsetReq) returns (NoReply); + // 投票操作接口 + rpc DynVote(DynVoteReq) returns (DynVoteReply); + // 网关调用 - 查看更多-列表 + rpc DynMixUpListViewMore(DynMixUpListViewMoreReq) returns (DynMixUpListViewMoreReply); + // 轻浏览 + rpc DynLight(DynLightReq) returns (DynLightReply); + // 动态详情页 + rpc DynDetail(DynDetailReq) returns (DynDetailReply); + // 点赞列表 + rpc LikeList(LikeListReq) returns (LikeListReply); + // 转发列表 + rpc RepostList(RepostListReq) returns (RepostListRsp); + // 空间页动态 + rpc DynSpace(DynSpaceReq) returns (DynSpaceRsp); + // 未登录页分区UP主推荐 + rpc DynUnLoginRcmd(DynRcmdReq) returns (DynRcmdReply); +} + +// 空请求 +message NoReq {} + +// 空响应 +message NoReply {} + +// 动态视频页-请求 +message DynVideoReq { + // 透传 update_baseline + string update_baseline = 1; + // 透传 history_offset + string offset = 2; + // 向下翻页数 + int32 page = 3; + // 刷新方式 + // 1:向上刷新 2:向下翻页 + Refresh refresh_type = 4; + // 秒开参数 新版本废弃,统一使用player_args + PlayurlParam playurl_param = 5; + // 综合页当前更新的最大值 + string assist_baseline = 6; + // 客户端时区 兼容UTC-14和Etc/GMT+12,时区区间[-12,14] 东八区为8 + int32 local_time = 7; + // 来源 + string from = 8; + // 秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 9; +} + +// 刷新方式 +enum Refresh { + // 刷新列表 + refresh_new = 0; + // 请求历史 + refresh_history = 1; +} + +// 秒开通用参数 +message PlayurlParam { + // 清晰度 + int32 qn = 1; + // 流版本 + int32 fnver = 2; + // 流类型 + int32 fnval = 3; + // 是否强制使用域名 + int32 force_host = 4; + // 是否4k + int32 fourk = 5; +} + +// 动态视频页-响应 +message DynVideoReply { + // 卡片列表 + CardVideoDynList dynamic_list = 1; + // 动态卡片 + CardVideoUpList video_up_list = 2; + // 视频页-我的追番 + CardVideoFollowList video_follow_list = 3; +} + +// 动态卡片列表 +message CardVideoDynList { + // 动态列表 + repeated DynamicItem list = 1; + // 更新的动态数 + int64 update_num = 2; + // 历史偏移 + string history_offset = 3; + // 更新基础信息 + string update_baseline = 4; + // 是否还有更多数据 + bool has_more = 5; +} + +// 动态卡片 +message DynamicItem { + // 动态卡片类型 + DynamicType card_type = 1; + // 转发类型下,源卡片类型 + DynamicType item_type = 2; + // 模块内容 + repeated Module modules = 3; + // 操作相关字段 + Extend extend = 4; + // 该卡片下面是否含有折叠卡 + int32 has_fold = 5; + // 透传到客户端的埋点字段。 + string server_info = 6; +} + +// DynamicType 枚举-动态类型 +enum DynamicType { + // 占位 + dyn_none = 0; + // 转发 + forward = 1; + // 稿件: ugc、小视频、短视频、UGC转PGC + av = 2; + // pgc:番剧、PGC番剧、PGC电影、PGC电视剧、PGC国创、PGC纪录片 + pgc = 3; + // 付费更新批次 + courses = 4; + // 折叠 + fold = 5; + // 纯文字 + word = 6; + // 图文 + draw = 7; + // 专栏 原仅phone端 + article = 8; + // 音频 原仅phone端 + music = 9; + // 通用卡 方形 + common_square = 10; + // 通用卡 竖形 + common_vertical = 11; + // 直播卡 只有转发态 + live = 12; + // 播单 原仅phone端 只有转发态 + medialist = 13; + // 付费更新批次 只有转发态 + courses_season = 14; + // 广告卡 + ad = 15; + // 小程序卡 + applet = 16; + // 订阅卡 + subscription = 17; + // 直播推荐卡 + live_rcmd = 18; + // 通栏 + banner = 19; + // 合集卡 + ugc_season = 20; + // 新订阅卡 + subscription_new = 21; +} + +// Module 动态模块 +message Module { + // 类型 + DynModuleType module_type = 1; + oneof module_item { + // 用户模块 1 + ModuleAuthor module_author = 2; + // 争议黄条模块 2 + ModuleDispute module_dispute = 3; + // 动态正文模块 3 + ModuleDesc module_desc = 4; + // 动态卡模块 4 + ModuleDynamic module_dynamic = 5; + // 点赞外露(废弃) + ModuleLikeUser module_likeUser = 6; + // 小卡模块 6 + ModuleExtend module_extend = 7; + // 大卡模块 5 + ModuleAdditional module_additional = 8; + // 计数模块 8 + ModuleStat module_stat = 9; + // 折叠模块 9 + ModuleFold module_fold = 10; + // 评论外露(废弃) + ModuleComment module_comment = 11; + // 外露交互模块(点赞、评论) 7 + ModuleInteraction module_interaction = 12; + // 转发卡-原卡用户模块 + ModuleAuthorForward module_author_forward = 13; + // 广告卡 + ModuleAd module_ad = 14; + // 通栏 + ModuleBanner module_banner = 15; + // 获取物料失败 + ModuleItemNull module_item_null = 16; + // 分享组件 + ModuleShareInfo module_share_info = 17; + // 相关推荐模块 + ModuleRecommend module_recommend = 18; + // 顶部模块 + ModuleTop module_top = 19; + // 底部模块 + ModuleButtom module_buttom = 20; + // 转发卡计数模块 + ModuleStat module_stat_forward = 21; + } +} + +// 动态-发布人模块 +message ModuleAuthor { + // 用户mid + int64 mid = 1; + // 时间标签 + string ptime_label_text = 2; + // 用户详情 + UserInfo author = 3; + // 装扮卡片 + DecorateCard decorate_card = 4; + // 点击跳转链接 + string uri = 5; + // 右侧操作区域 - 三点样式 + repeated ThreePointItem tp_list = 6; + // 右侧操作区域样式枚举 + ModuleAuthorBadgeType badge_type = 7; + // 右侧操作区域 - 按钮样式 + ModuleAuthorBadgeButton badge_button = 8; + // 是否关注 + // 1:关注 0:不关注 默认0,注:点赞列表使用,其他场景不使用该字段 + int32 attend = 9; + // 关注状态 + Relation relation = 10; + // 右侧操作区域 - 提权样式 + Weight weight = 11; + // 是否展示关注 + bool show_follow = 12; + // 是否置顶 + bool is_top = 13; +} + +// 用户信息 +message UserInfo { + // 用户mid + int64 mid = 1; + // 用户昵称 + string name = 2; + // 用户头像 + string face = 3; + // 认证信息 + OfficialVerify official = 4; + // 大会员信息 + VipInfo vip = 5; + // 直播信息 + LiveInfo live = 6; + // 空间页跳转链接 + string uri = 7; + // 挂件信息 + UserPendant pendant = 8; + // 认证名牌 + Nameplate nameplate = 9; + // 用户等级 + int32 level = 10; + // 用户简介 + string sign = 11; +} + +// 认证信息 +message OfficialVerify { + // 127:未认证 0:个人 1:机构 + int32 type = 1; + // 认证描述 + string desc = 2; + // 是否关注 + int32 is_atten = 3; +} + +// 大会员信息 +message VipInfo { + // 大会员类型 + int32 Type = 1; + // 大会员状态 + int32 status = 2; + // 到期时间 + int64 due_date = 3; + // 标签 + VipLabel label = 4; + // 主题 + int32 theme_type = 5; + // 大会员角标 + // 0:无角标 1:粉色大会员角标 2:绿色小会员角标 + int32 avatar_subscript = 6; + // 昵称色值,可能为空,色值示例:#FFFB9E60 + string nickname_color = 7; +} + +// 大会员标签 +message VipLabel { + // 图片地址 + string path = 1; + // 文本值 + string text = 2; + // 对应颜色类型 + string label_theme = 3; +} + +// 直播信息 +message LiveInfo { + // 是否在直播 + // 0:未直播 1:正在直播 (废弃) + int32 is_living = 1; + // 跳转链接 + string uri = 2; + // 直播状态 + LiveState live_state = 3; +} + +// 直播状态 +enum LiveState { + // 未直播 + live_none = 0; + // 直播中 + live_live = 1; + // 轮播中 + live_rotation = 2; +} + +// 头像挂件信息 +message UserPendant { + // pid + int64 pid = 1; + // 名称 + string name = 2; + // 图片链接 + string image = 3; + // 有效期 + int64 expire = 4; +} + +// 认证名牌 +message Nameplate { + // nid + int64 nid = 1; + // 名称 + string name = 2; + // 图片地址 + string image = 3; + // 小图地址 + string image_small = 4; + // 等级 + string level = 5; + // 获取条件 + string condition = 6; +} + +// 装扮卡片 +message DecorateCard { + // 装扮卡片id + int64 id = 1; + // 装扮卡片链接 + string card_url = 2; + // 装扮卡片点击跳转链接 + string jump_url = 3; + // 粉丝样式 + DecoCardFan fan = 4; +} + +// 装扮卡片-粉丝勋章信息 +message DecoCardFan { + // 是否是粉丝 + int32 is_fan = 1; + // 数量 + int32 number = 2; + // 数量 str + string number_str = 3; + // 颜色 + string color = 4; +} + +// 动态-争议小黄条模块 +message ModuleDispute { + // 标题 + string title = 1; + // 描述内容 + string desc = 2; + // 跳转链接 + string uri = 3; +} + +// 动态-描述文字模块 +message ModuleDesc { + // 描述信息(已按高亮拆分) + repeated Description desc = 1; + // 点击跳转链接 + string jump_uri = 2; + // 文本原本 + string text = 3; +} + +// Description 文本描述 +message Description { + // 文本内容 + string text = 1; + // 文本类型 + DescType type = 2; + // 点击跳转链接 + string uri = 3; + // emoji类型 + EmojiType emoji_type = 4; + // 商品类型 + string goods_type = 5; + // 前置Icon + string icon_url = 6; + // icon_name + string icon_name = 7; + // 资源ID + string rid = 8; + // 商品卡特殊字段 + ModuleDescGoods goods = 9; + // 文本原始文案 + string orig_text = 10; +} + +// 文本类型 +enum DescType { + // 占位 + desc_type_none = 0; + // 文本 + desc_type_text = 1; + // @ + desc_type_aite = 2; + // 抽奖 + desc_type_lottery = 3; + // 投票 + desc_type_vote = 4; + // 话题 + desc_type_topic = 5; + // 商品 + desc_type_goods = 6; + // bv + desc_type_bv = 7; + // av + desc_type_av = 8; + // 表情 + desc_type_emoji = 9; + // 外露用户 + desc_type_user = 10; + // 专栏 + desc_type_cv = 11; + // 小视频 + desc_type_vc = 12; + // 网址 + desc_type_web = 13; + // 淘宝 + desc_type_taobao = 14; + // 邮箱 + desc_type_mail = 15; + // 番剧season + desc_type_ogv_season = 16; + // 番剧ep + desc_type_ogv_ep = 17; +} + +// 表情包类型 +enum EmojiType { + // 占位 + emoji_none = 0; + // emoji旧类型 + emoji_old = 1; + // emoji新类型 + emoji_new = 2; + // 大会员表情 + vip = 3; +} + +// 正文商品卡参数 +message ModuleDescGoods { + // 商品类型 + // 1:淘宝 2:会员购 + int32 source_type = 1; + // 跳转链接 + string jump_url = 2; + // schema_url + string schema_url = 3; + // item_id + int64 item_id = 4; + // open_white_list + repeated string open_white_list = 5; + // use_web_v2 + bool user_web_v2 = 6; + // ad mark + string ad_mark = 7; + // schemaPackageName(Android用) + string schema_package_name = 8; +} + +// 动态-详情模块 +message ModuleDynamic { + // 类型 + ModuleDynamicType type = 1; + oneof module_item { + //稿件 + MdlDynArchive dyn_archive = 2; + //pgc + MdlDynPGC dyn_pgc = 3; + //付费课程-系列 + MdlDynCourSeason dyn_cour_season = 4; + //付费课程-批次 + MdlDynCourBatch dyn_cour_batch = 5; + //转发卡 + MdlDynForward dyn_forward = 6; + //图文 + MdlDynDraw dyn_draw = 7; + //专栏 + MdlDynArticle dyn_article = 8; + //音频 + MdlDynMusic dyn_music = 9; + //通用卡方 + MdlDynCommon dyn_common = 10; + //直播卡 + MdlDynLive dyn_common_live = 11; + //播单 + MdlDynMedialist dyn_medialist = 12; + //小程序卡 + MdlDynApplet dyn_applet = 13; + //订阅卡 + MdlDynSubscription dyn_subscription = 14; + //直播推荐卡 + MdlDynLiveRcmd dyn_live_rcmd = 15; + //UGC合集 + MdlDynUGCSeason dyn_ugc_season = 16; + //订阅卡 + MdlDynSubscriptionNew dyn_subscription_new = 17; + } +} + +// 动态详情模块类型 +enum ModuleDynamicType { + // 稿件 + mdl_dyn_archive = 0; + // pgc + mdl_dyn_pgc = 1; + // 付费课程-系列 + mdl_dyn_cour_season = 2; + // 付费课程-批次 + mdl_dyn_cour_batch = 3; + // 转发卡 + mdl_dyn_forward = 4; + // 图文 + mdl_dyn_draw = 5; + // 专栏 + mdl_dyn_article = 6; + // 音频 + mdl_dyn_music = 7; + // 通用卡方 + mdl_dyn_common = 8; + // 直播卡 + mdl_dyn_live = 9; + // 播单 + mdl_dyn_medialist = 10; + // 小程序卡 + mdl_dyn_applet = 11; + // 订阅卡 + mdl_dyn_subscription = 12; + // 直播推荐卡 + mdl_dyn_live_rcmd = 13; + // UGC合集 + mdl_dyn_ugc_season = 14; + // 订阅卡 + mdl_dyn_subscription_new = 15; +} + +// 动态-详情模块-稿件 +message MdlDynArchive { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 秒开地址 + string uri = 3; + // 视频封面展示项 1 + string cover_left_text_1 = 4; + // 视频封面展示项 2 + string cover_left_text_2 = 5; + // 封面视频展示项 3 + string cover_left_text_3 = 6; + // avid + int64 avid = 7; + // cid + int64 cid = 8; + // 视频源类型 + MediaType media_type = 9; + // 尺寸信息 + Dimension dimension = 10; + // 角标,多个角标之前有间距 + repeated VideoBadge badge = 11; + // 是否能够自动播放 + bool can_play= 12; + // stype + VideoType stype = 13; + // 是否PGC + bool isPGC = 14; + // inline播放地址 + string inlineURL = 15; + // PGC的epid + int64 EpisodeId = 16; + // 子类型 + int32 SubType = 17; + // PGC的ssid + int64 PgcSeasonId = 18; + // 播放按钮 + string play_icon = 19; + // 时长 + int64 duration = 20; + // 跳转地址 + string jump_url = 21; + // 番剧是否为预览视频 + bool is_preview = 22; + // 新角标,多个角标之前没有间距 + repeated VideoBadge badge_category = 23; + // 当前是否是pgc正片 + bool is_feature = 24; + // 是否是预约召回 + ReserveType reserve_type = 25; + // bvid + string bvid = 26; + // 播放数 + int32 view = 27; +} + +// 播放器类型 +enum MediaType { + // 本地 + MediaTypeNone = 0; + // UGC + MediaTypeUGC = 1; + // PGC + MediaTypePGC = 2; + // 直播 + MediaTypeLive = 3; + // 小视频 + MediaTypeVCS = 4; +} + +enum ReserveType { + // 占位 + reserve_none = 0; + // 预约召回 + reserve_recall = 1; +} + +// Dimension 尺寸信息 +message Dimension { + // + int64 height = 1; + // + int64 width = 2; + // + int64 rotate = 3; +} + +// 角标信息 +message VideoBadge { + // 文案 + string text = 1; + // 文案颜色-日间 + string text_color = 2; + // 文案颜色-夜间 + string text_color_night = 3; + // 背景颜色-日间 + string bg_color = 4; + // 背景颜色-夜间 + string bg_color_night = 5; + // 边框颜色-日间 + string border_color = 6; + // 边框颜色-夜间 + string border_color_night = 7; + // 样式 + int32 bg_style = 8; + // 背景透明度-日间 + int32 bg_alpha = 9; + // 背景透明度-夜间 + int32 bg_alpha_night = 10; +} + +// 视频类型 +enum VideoType { + //普通视频 + video_type_general = 0; + //动态视频 + video_type_dynamic = 1; + //直播回放视频 + video_type_playback = 2; +} + +// MdlDynPGC 动态-详情模块-pgc +message MdlDynPGC { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 秒开地址 + string uri = 3; + // 视频封面展示项 1 + string cover_left_text_1 = 4; + // 视频封面展示项 2 + string cover_left_text_2 = 5; + // 封面视频展示项 3 + string cover_left_text_3 = 6; + // cid + int64 cid = 7; + // season_id + int64 season_id = 8; + // epid + int64 epid = 9; + // aid + int64 aid = 10; + // 视频源类型 + MediaType media_type = 11; + // 番剧类型 + VideoSubType sub_type = 12; + // 番剧是否为预览视频 + bool is_preview = 13; + // 尺寸信息 + Dimension dimension = 14; + // 角标,多个角标之前有间距 + repeated VideoBadge badge = 15; + // 是否能够自动播放 + bool can_play= 16; + // season + PGCSeason season = 17; + // 播放按钮 + string play_icon = 18; + // 时长 + int64 duration = 19; + // 跳转地址 + string jump_url = 20; + // 新角标,多个角标之前没有间距 + repeated VideoBadge badge_category = 21; + // 当前是否是pgc正片 + bool is_feature = 22; +} + +// 番剧类型 +enum VideoSubType { + // 没有子类型 + VideoSubTypeNone = 0; + // 番剧 + VideoSubTypeBangumi = 1; + // 电影 + VideoSubTypeMovie = 2; + // 纪录片 + VideoSubTypeDocumentary = 3; + // 国创 + VideoSubTypeDomestic = 4; + // 电视剧 + VideoSubTypeTeleplay = 5; +} + +// PGC单季信息 +message PGCSeason { + // 是否完结 + int32 is_finish = 1; + // 标题 + string title = 2; + // 类型 + int32 type = 3; +} + +// 动态-详情模块-付费课程系列 +message MdlDynCourSeason { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 跳转地址 + string uri = 3; + // 展示项 1(更新信息) + string text_1 = 4; + // 描述信息 + string desc = 5; + // 角标 + VideoBadge badge = 6; + // 播放按钮 + string play_icon = 7; +} + +// 动态-详情模块-付费课程批次 +message MdlDynCourBatch { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 跳转地址 + string uri = 3; + // 展示项 1(本集标题) + string text_1 = 4; + // 展示项 2(更新了多少个视频) + string text_2 = 5; + // 角标 + VideoBadge badge = 6; + // 播放按钮 + string play_icon = 7; +} + +// 动态列表渲染部分-详情模块-转发模块 +message MdlDynForward { + // 动态转发核心模块 套娃 + DynamicItem item = 1; + // 透传类型 + // 0:分享 1:转发 + int32 rtype = 2; +} + +// 动态列表渲染部分-详情模块-图文模块 +message MdlDynDraw { + // 图片 + repeated MdlDynDrawItem items = 1; + // 跳转地址 + string uri = 2; + // 图文ID + int64 id = 3; +} + +// MdlDynDrawItem 动态列表渲染部分-详情模块-图文 +message MdlDynDrawItem { + // 图片链接 + string src = 1; + // 图片宽度 + int64 width = 2; + // 图片高度 + int64 height = 3; + // 图片大小 + float size = 4; + // 图片标签 + repeated MdlDynDrawTag tags = 5; +} + +// 动态列表渲染部分-详情模块-图文-标签 +message MdlDynDrawTag { + // 标签类型 + MdlDynDrawTagType type = 1; + // 标签详情 + MdlDynDrawTagItem item = 2; +} + +// 图文标签类型 +enum MdlDynDrawTagType { + // 占位 + mdl_draw_tag_none = 0; + // 普通标签 + mdl_draw_tag_common = 1; + // 商品标签 + mdl_draw_tag_goods = 2; + // 用户昵称 + mdl_draw_tag_user = 3; + // 话题名称 + mdl_draw_tag_topic = 4; + // lbs标签 + mdl_draw_tag_lbs = 5; +} + +// 动态列表部分-详情模块-图文-标签详情 +message MdlDynDrawTagItem { + // 跳转链接 + string url = 1; + // 标签内容 + string text = 2; + // 坐标-x + int64 x = 3; + // 坐标-y + int64 y = 4; + // 方向 + int32 orientation = 5; + // 来源 + // 0:未知 1:淘宝 2:自营 + int32 source = 6; + // 商品id + int64 item_id = 7; + // 用户mid + int64 mid = 8; + // 话题id + int64 tid = 9; + // lbs信息 + string poi = 10; + // 商品标签链接 + string schema_url = 11; +} + +// 动态列表渲染部分-详情模块-专栏模块 +message MdlDynArticle { + // 专栏id + int64 id = 1; + // 跳转地址 + string uri = 2; + // 标题 + string title = 3; + // 文案部分 + string desc = 4; + // 配图 + repeated string covers = 5; + // 阅读量标签 + string label = 6; + // 模板类型 + int32 templateID = 7; +} + +// 动态列表渲染部分-详情模块-音频模块 +message MdlDynMusic { + // 音频id + int64 id = 1; + // 跳转地址 + string uri = 2; + // upId + int64 up_id = 3; + // 歌名 + string title = 4; + // 专辑封面 + string cover = 5; + // 展示项1 + string label1 = 6; + // upper + string upper = 7; +} + +// 动态列表渲染部分-详情模块-通用 +message MdlDynCommon { + // 物料id + int64 oid = 1; + // 跳转地址 + string uri = 2; + // 标题 + string title = 3; + // 描述 漫画卡标题下第一行 + string desc = 4; + // 封面 + string cover = 5; + // 标签1 漫画卡标题下第二行 + string label = 6; + // 所属业务类型 + int32 bizType = 7; + // 镜像数据ID + int64 sketchID = 8; + // 卡片样式 + MdlDynCommonType style = 9; + // 角标 + repeated VideoBadge badge = 10; +} + +// +enum MdlDynCommonType { + // + mdl_dyn_common_none = 0; + // + mdl_dyn_common_square = 1; + // + mdl_dyn_common_vertica = 2; +} + +// 动态列表渲染部分-详情模块-直播 +message MdlDynLive { + // 房间号 + int64 id = 1; + // 跳转地址 + string uri = 2; + // 直播间标题 + string title = 3; + // 直播间封面 + string cover = 4; + // 标题1 例: 陪伴学习 + string cover_label = 5; + // 标题2 例: 54.6万人气 + string cover_label2 = 6; + // 直播状态 + LiveState live_state = 7; + // 直播角标 + VideoBadge badge = 8; + // 是否是预约召回 + ReserveType reserve_type = 9; +} + +// 动态列表渲染部分-详情模块-播单 +message MdlDynMedialist { + // 播单id + int64 id = 1; + // 跳转地址 + string uri = 2; + // 主标题 + string title = 3; + // 副标题 + string sub_title = 4; + // 封面图 + string cover = 5; + // 封面类型 + int32 cover_type = 6; + // 角标 + VideoBadge badge = 7; +} + +// 动态列表渲染部分-详情模块-小程序/小游戏 +message MdlDynApplet { + // 小程序id + int64 id = 1; + // 跳转地址 + string uri = 2; + // 主标题 + string title = 4; + // 副标题 + string sub_title = 5; + // 封面图 + string cover = 6; + // 小程序icon + string icon = 7; + // 小程序标题 + string label = 8; + // 按钮文案 + string button_title = 9; +} + +// 动态列表渲染部分-详情模块-订阅卡 +message MdlDynSubscription { + // 卡片物料id + int64 id = 1; + // 广告创意id + int64 ad_id = 2; + // 跳转地址 + string uri = 3; + // 标题 + string title = 4; + // 封面图 + string cover = 5; + // 广告标题 + string ad_title = 6; + // 角标 + VideoBadge badge = 7; + // 小提示 + string tips = 8; +} + +// 动态列表渲染部分-详情模块-直播推荐 +message MdlDynLiveRcmd { + // 直播数据 + string content = 1; + // 是否是预约召回 + ReserveType reserve_type = 2; +} + +// 动态列表渲染部分-UGC合集 +message MdlDynUGCSeason { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 秒开地址 + string uri = 3; + // 视频封面展示项 1 + string cover_left_text_1 = 4; + // 视频封面展示项 2 + string cover_left_text_2 = 5; + // 封面视频展示项 3 + string cover_left_text_3 = 6; + // 卡片物料id + int64 id = 7; + // inline播放地址 + string inlineURL = 8; + // 是否能够自动播放 + bool can_play= 9; + // 播放按钮 + string play_icon = 10; + // avid + int64 avid = 11; + // cid + int64 cid = 12; + // 尺寸信息 + Dimension dimension = 13; + // 时长 + int64 duration = 14; + // 跳转地址 + string jump_url = 15; +} + +// 动态新附加卡 +message MdlDynSubscriptionNew { + //样式类型 + MdlDynSubscriptionNewStyle style = 1; + // 新订阅卡数据 + oneof item { + // + MdlDynSubscription dyn_subscription = 2; + // 直播推荐 + MdlDynLiveRcmd dyn_live_rcmd = 3; + } +} + +// +enum MdlDynSubscriptionNewStyle { + // 占位 + mdl_dyn_subscription_new_style_nont = 0; + // 直播 + mdl_dyn_subscription_new_style_live = 1; + // 图文 + mdl_dyn_subscription_new_style_draw = 2; +} + +// 动态-附加卡模块 +message ModuleAdditional { + // 类型 + AdditionalType type = 1; + oneof item { + // 废弃 + AdditionalPGC pgc = 2; + // + AdditionGoods goods = 3; + // 废弃 + AdditionVote vote = 4; + // + AdditionCommon common = 5; + // + AdditionEsport esport = 6; + // 投票 + AdditionVote2 vote2 = 8; + // + AdditionUgc ugc = 9; + // up主预约发布卡 + AdditionUP up = 10; + } + // 附加卡物料ID + int64 rid = 7; +} + +// 枚举-动态附加卡 +enum AdditionalType { + // 占位 + additional_none = 0; + // 附加卡-追番 + additional_type_pgc = 1; + // 附加卡-商品 + additional_type_goods = 2; + // 附加卡投票 + additional_type_vote = 3; + // 附加通用卡 + additional_type_common = 4; + // 附加电竞卡 + additional_type_esport = 5; + // 附加UP主推荐卡 + additional_type_up_rcmd = 6; + // 附加卡-ugc + additional_type_ugc = 7; + // UP主预约卡 + additional_type_up_reservation = 8; +} + +// 动态-附加卡-番剧卡 +message AdditionalPGC { + // 头部说明文案 + string head_text = 1; + // 标题 + string title = 2; + // 展示图 + string image_url = 3; + // 描述文字1 + string desc_text_1 = 4; + // 描述文字2 + string desc_text_2 = 5; + // 点击跳转链接 + string url = 6; + // 按钮 + AdditionalButton button = 7; + // 头部icon + string head_icon = 8; + // style + ImageStyle style = 9; + // 动态本身的类型 type + string type = 10; +} + +// 枚举-附加卡样式 +enum ImageStyle { + // + add_style_vertical = 0; + // + add_style_square = 1; +} + +// 动态-附加卡-按钮 +message AdditionalButton { + // 按钮类型 + AddButtonType type = 1; + // jump-跳转样式 + AdditionalButtonStyle jump_style = 2; + // jump-跳转链接 + string jump_url = 3; + // button-未点样式 + AdditionalButtonStyle uncheck = 4; + // button-已点样式 + AdditionalButtonStyle check = 5; + // button-当前状态 + AdditionalButtonStatus status = 6; + // 按钮点击样式 + AdditionalButtonClickType click_type = 7; +} + +// 按钮类型 +enum AddButtonType { + // 占位 + bt_none = 0; + // 跳转 + bt_jump = 1; + // 按钮 + bt_button = 2; +} + +// 附加卡按钮状态 +enum AdditionalButtonStatus { + // + none = 0; + // + uncheck = 1; + // + check = 2; +} + +// 附加卡按钮点击类型 +enum AdditionalButtonClickType { + // 通用按钮 + click_none = 0; + // 预约卡按钮 + click_up = 1; +} + +// 动态-附加卡-按钮样式 +message AdditionalButtonStyle { + // icon + string icon = 1; + // 文案 + string text = 2; + // 按钮点击交互 + AdditionalButtonInteractive interactive = 3; + // 当前按钮填充样式 + AddButtonBgStyle bg_style = 4; + // toast文案, 当disable=1时有效 + string toast = 5; + // 当前按钮样式, + // 0:高亮 1:置灰(按钮不可点击) + DisableState disable = 6; +} + +enum DisableState { + // 高亮 + highlight = 0; + // 置灰(按钮不可点击) + gary = 1; +} + +enum AddButtonBgStyle { + // 默认填充 + fill = 0; + // 描边 + stroke = 1; + // 置灰 + gray = 2; +} + +message AdditionalButtonInteractive { + // 是否弹窗 + string popups = 1; + // 弹窗确认文案 + string confirm = 2; + // 弹窗取消文案 + string cancel = 3; +} + +// 动态-附加卡-商品卡 +message AdditionGoods { + // 推荐文案 + string rcmd_desc = 1; + // 商品信息 + repeated GoodsItem goods_items = 2; + // 附加卡类型 + string card_type = 3; + // 头部icon + string icon = 4; + // 商品附加卡整卡跳转 + string uri = 5; + // 商品类型 + // 1:淘宝 2:会员购,注:实际是获取的goods_items里面的第一个source_type + int32 source_type = 6; +} + +// 动态-附加卡-商品卡-商品 +message GoodsItem { + // 图片 + string cover = 1; + // schemaPackageName(Android用) + string schema_package_name = 2; + // 商品类型 + // 1:淘宝 2:会员购 + int32 source_type = 3; + // 跳转链接 + string jump_url = 4; + // 跳转文案 + string jump_desc = 5; + // 标题 + string title = 6; + // 摘要 + string brief = 7; + // 价格 + string price = 8; + // item_id + int64 item_id = 9; + // schema_url + string schema_url = 10; + // open_white_list + repeated string open_white_list = 11; + // use_web_v2 + bool user_web_v2 = 12; + // ad mark + string ad_mark = 13; +} + +// 动态-附加卡-投票 +message AdditionVote { + // 封面图 + string image_url = 1; + // 标题 + string title = 2; + // 展示项1 + string text_1 = 3; + // button文案 + string button_text = 4; + // 点击跳转链接 + string url = 5; +} + +// 动态-附加卡-UGC视频附加卡 +message AdditionUgc { + // 说明文案 + string head_text = 1; + // 稿件标题 + string title = 2; + // 封面 + string cover = 3; + // 描述文字1 + string desc_text_1 = 4; + // 描述文字2 + string desc_text_2 = 5; + // 接秒开 + string uri = 6; + // 时长 + string duration = 7; + // 标题支持换行-标题支持单行和双行,本期不支持填充up昵称,支持双行展示,字段默认为true + bool line_feed = 8; + // 附加卡类型 + string card_type = 9; +} + +// 动态-附加卡-通用卡 +message AdditionCommon { + // 头部说明文案 + string head_text = 1; + // 标题 + string title = 2; + // 展示图 + string image_url = 3; + // 描述文字1 + string desc_text_1 = 4; + // 描述文字2 + string desc_text_2 = 5; + // 点击跳转链接 + string url = 6; + // 按钮 + AdditionalButton button = 7; + // 头部icon + string head_icon = 8; + // style + ImageStyle style = 9; + // 动态本身的类型 type + string type = 10; + // 附加卡类型 + string card_type = 11; // ogv manga +} + +// 动态-附加卡-电竞卡 +message AdditionEsport { + // 电竞类型 + EspaceStyle style = 1; + oneof item { + // moba类 + AdditionEsportMoba addition_esport_moba = 2; + } + // 动态本身的类型 type + string type = 3; + // 附加卡类型 + string card_type = 4; // ogv manga +} + +// 附加大卡-电竞卡样式 +enum EspaceStyle { + // moba类 + moba = 0; +} + +// 动态-附加卡-电竞卡-moba类 +message AdditionEsportMoba { + // 头部说明文案 + string head_text = 1; + // 标题 + string title = 2; + // 战队列表 + repeated MatchTeam match_team = 3; + // 比赛信息 + AdditionEsportMobaStatus addition_esport_moba_status = 4; + // 卡片跳转 + string uri = 5; + // 按钮 + AdditionalButton button = 6; + // 副标题 + string sub_title = 7; + // 动态本身的类型 type + string type = 10; + // 附加卡类型 + string card_type = 11; + // 附加卡图标 + string head_icon = 12; +} + +// 动态-附加卡-电竞卡-moba类-比赛信息 +message AdditionEsportMobaStatus { + // 文案类 + repeated AdditionEsportMobaStatusDesc addition_esport_moba_status_desc = 1; + // 比赛状态文案 + string title = 2; + // 比赛状态状态 + int32 status = 3; + // 日间色值 + string color = 4; + // 夜间色值 + string night_color = 5; +} + +// 动态-附加卡-电竞卡-moba类-比赛信息-文案类 +message AdditionEsportMobaStatusDesc { + // 文案 + string title = 1; + // 日间色值 + string color = 2; + // 夜间色值 + string night_color = 3; +} + +// 动态-附加卡-电竞卡-战队 +message MatchTeam { + // 战队ID + int64 id = 1; + // 战队名 + string name = 2; + // 战队图标 + string cover = 3; + // 日间色值 + string color = 4; + // 夜间色值 + string night_color = 5; +} + +// up主预约发布卡 +message AdditionUP { + // 标题 + string title = 1; + // 高亮文本,描述文字1 + HighlightText desc_text_1 = 2; + // 描述文字2 + string desc_text_2 = 3; + // 点击跳转链接 + string url = 4; + // 按钮 + AdditionalButton button = 5; + // 附加卡类型 + string card_type = 6; + // 预约人数(用于预约人数变化) + int64 reserve_total = 7; + // 活动皮肤 + AdditionalActSkin act_skin = 8; + // 预约id + int64 rid = 9; +} + +// 活动皮肤 +message AdditionalActSkin { + // 动画SVGA资源 + string svga = 1; + // 动画SVGA最后一帧图片资源 + string last_image = 2; + // 动画播放次数 + int64 play_times = 3; +} + +// 高亮文本 +message HighlightText { + // 展示文本 + string text = 1; + // 高亮类型 + HighlightTextStyle text_style = 2; +} + +// 文本高亮枚举 +enum HighlightTextStyle { + // 默认 + style_none = 0; + // 高亮 + style_highlight = 1; +} + +// 动态-小卡模块 +message ModuleExtend { + // 详情 + repeated ModuleExtendItem extend = 1; + // 模块整体跳转uri + string uri = 2; // 废弃 +} + +// 动态-拓展小卡模块 +message ModuleExtendItem { + // 类型 + DynExtendType type = 1; + // 卡片详情 + oneof extend { + // 废弃 + ExtInfoTopic ext_info_topic = 2; + // 废弃 + ExtInfoLBS ext_info_lbs = 3; + // 废弃 + ExtInfoHot ext_info_hot = 4; + // 废弃 + ExtInfoGame ext_info_game = 5; + // + ExtInfoCommon ext_info_common = 6; + // + ExtInfoOGV ext_info_ogv = 7; + } +} + +// 动态小卡类型 +enum DynExtendType { + // 占位 + dyn_ext_type_none = 0; + // 话题小卡 + dyn_ext_type_topic = 1; + // lbs小卡 + dyn_ext_type_lbs = 2; + // 热门小卡 + dyn_ext_type_hot = 3; + // 游戏小卡 + dyn_ext_type_game = 4; + // 通用小卡 + dyn_ext_type_common = 5; + // 必剪小卡 + dyn_ext_type_biliCut = 6; + // ogv小卡 + dyn_ext_type_ogv = 7; + // 自动附加ogv小卡 + dyn_ext_type_auto_ogv = 8; +} + +// 动态-拓展小卡模块-话题小卡 +message ExtInfoTopic { + // 标题-话题名 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; +} + +// 动态-拓展小卡模块-lbs小卡 +message ExtInfoLBS { + // 标题 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; + // poiType + int32 poi_type = 4; +} + +// 动态-拓展小卡模块-热门小卡 +message ExtInfoHot { + // 标题 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; +} + +// 动态-拓展小卡模块-游戏小卡 +message ExtInfoGame { + // 标题 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; +} + +// 动态-拓展小卡模块-通用小卡 +message ExtInfoCommon { + // 标题 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; + // poiType + int32 poi_type = 4; + // 类型 + DynExtendType type = 5; + // 客户端埋点用 + string sub_module = 6; + // 行动点文案 + string action_text = 7; + // 行动点链接 + string action_url = 8; + // 资源rid + int64 rid = 9; + // 轻浏览是否展示 + bool is_show_light = 10; +} + +// 动态-拓展小卡模块-ogv小卡 +message ExtInfoOGV { + // ogv小卡 + repeated InfoOGV info_ogv = 1; +} + +// 动态-拓展小卡模块-ogv小卡-(one of 片单、榜单、分区) +message InfoOGV { + // 标题 + string title = 1; + // 跳转地址 + string uri = 2; + // 小图标 + string icon = 3; + // 客户端埋点用 + string sub_module = 4; +} + +// 外露交互模块 +message ModuleInteraction { + // 外露交互模块 + repeated InteractionItem interactionItem = 1; +} + +// 外露交互模块 +message InteractionItem { + // 外露模块类型 + LocalIconType icon_type = 1; + // 外露模块文案 + repeated Description desc = 2; + // 外露模块uri相关 根据type不同用法不同 + string uri = 3; + // 动态id + string dynamic_id = 4; + // 评论mid + int64 comment_mid = 6; +} + +// 外露模块类型 +enum LocalIconType { + // + local_icon_comment = 0; + // + local_icon_like = 1; +} + +// DynUriType +enum DynUriType { + // + dyn_uri_type_none = 0; + // 直接跳转对应uri + dyn_uri_type_direct = 1; + // 作为后缀拼接 + dyn_uri_type_suffix = 2; +} + +// 动态-计数模块 +message ModuleStat { + // 转发数 + int64 repost = 1; + // 点赞数 + int64 like = 2; + // 评论数 + int64 reply = 3; + // 点赞拓展信息 + LikeInfo like_info = 4; + // 禁评 + bool no_comment = 5; + // 禁转 + bool no_forward = 6; + // 点击评论跳转链接 + string reply_url = 7; + // 禁评文案 + string no_comment_text = 8; + // 禁转文案 + string no_forward_text = 9; +} + +// 动态-折叠模块 +message ModuleFold { + // 折叠分类 + FoldType fold_type = 1; + // 折叠文案 + string text = 2; + // 被折叠的动态 + string fold_ids = 3; + // 被折叠的用户信息 + repeated UserInfo fold_users = 4; +} + +// 折叠类型 +enum FoldType { + // 占位 + FoldTypeZore = 0; + // 用户发布折叠 + FoldTypePublish = 1; + // 转发超频折叠 + FoldTypeFrequent = 2; + // 联合投稿折叠 + FoldTypeUnite = 3; + // 动态受限折叠 + FoldTypeLimit = 4; +} + +// 动态综合页-请求 +message DynAllReq { + // 透传 update_baseline + string update_baseline = 1; + // 透传 history_offset + string offset = 2; + // 向下翻页数 + int32 page = 3; + // 刷新方式 1向上刷新 2向下翻页 + Refresh refresh_type = 4; + // 秒开参数 新版本废弃,统一使用player_args + PlayurlParam playurl_param = 5; + // 综合页当前更新的最大值 + string assist_baseline = 6; + // 客户端时区 兼容UTC-14和Etc/GMT+12,时区区间[-12,14] 东八区为8 + int32 local_time = 7; + // 推荐up主入参(new的时候传) + RcmdUPsParam rcmd_ups_param = 8; + // 广告参数 + AdParam ad_param = 9; + // 是否冷启 + int32 cold_start = 10; + // 来源 + string from = 11; + // 秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 12; +} + +// 推荐up主入参 +message RcmdUPsParam { + int64 dislike_ts = 1; +} + +// 综合页请求广告所需字段,由客户端-网关透传 +message AdParam { + //综合页请求广告所需字段,由客户端-网关透传 + string ad_extra = 1; + // request_id + string request_id = 2; +} + +// 动态综合页-响应 +message DynAllReply { + // 卡片列表 + DynamicList dynamic_list = 1; + // 顶部up list + CardVideoUpList up_list = 2; + // 话题广场 + TopicList topic_list = 3; + // 无关注推荐 + Unfollow unfollow = 4; + // 分区UP推荐 + DynRegionRcmd region_rcmd = 5; +} + +//动态卡片列表 +message DynamicList { + // 动态列表 + repeated DynamicItem list = 1; + // 更新的动态数 + int64 update_num = 2; + // 历史偏移 + string history_offset = 3; + // 更新基础信息 + string update_baseline = 4; + // 是否还有更多数据 + bool has_more = 5; +} + +// 综合页-话题广场 +message TopicList { + // 模块标题 + string title = 1; + // 话题列表 + repeated TopicListItem topic_list_item = 2; + // 发起活动 + TopicButton act_button = 3; + // 查看更多 + TopicButton more_button = 4; + // 透传服务端上报 + string server_info = 5; +} + +// 综合页-话题广场-话题 +message TopicListItem { + // 前置图标 + string icon = 1; + // 前置图标文案 + string icon_title = 2; + // 话题id + int64 topic_id = 3; + // 话题名 + string topic_name = 4; + // 跳转链接 + string url = 5; + // 卡片位次 + int64 pos = 6; + // 透传服务端上报 + string server_info = 7; +} + +// 话题广场操作按钮 +message TopicButton { + // 按钮图标 + string icon = 1; + // 按钮文案 + string title = 2; + // 跳转 + string jump_uri = 3; +} + +// 综合页-无关注列表 +message Unfollow { + // 标题展示文案 + string title = 1; + // 无关注列表 + repeated UnfollowUserItem list = 2; + // trackID + string TrackId = 3; +} + +// 综合页-无关注列表 +message UnfollowUserItem { + // 是否有更新 + bool has_update = 1; + // up主头像 + string face = 2; + // up主昵称 + string name = 3; + // up主uid + int64 uid = 4; + // 排序字段 从1开始 + int32 pos = 5; + // 直播状态 + LiveState live_state = 6; + // 认证信息 + OfficialVerify official = 7; + // 大会员信息 + VipInfo vip = 8; + // up介绍 + string sign = 9; + // 标签信息 + string label = 10; + // 按钮 + AdditionalButton button = 11; + // 跳转地址 + string uri = 12; +} + +// 批量动态id获取动态详情-请求 +message DynDetailsReq { + // 动态id + string dynamic_ids = 1; + // 秒开参数 新版本废弃,统一使用player_args + PlayurlParam playurl_param = 2; + // 客户端时区 兼容UTC-14和Etc/GMT+12,时区区间[-12,14] 东八区为8 + int32 local_time = 3; + // 秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 4; +} + +// 批量动态id获取动态详情-响应 +message DynDetailsReply { + // 动态列表 + repeated DynamicItem list = 1; +} + +// 最近访问-个人feed流列表-请求 +message DynVideoPersonalReq { + // 被访问者的 UID + int64 host_uid = 1; + // 偏移量 第一页可传空 + string offset = 2; + // 标明下拉几次 + int32 page = 3; + // 是否是预加载 + int32 is_preload = 4; + // 秒开参数 新版本废弃,统一使用player_args + PlayurlParam playurl_param = 5; + // 客户端时区 兼容UTC-14和Etc/GMT+12,时区区间[-12,14] 东八区为8 + int32 local_time = 6; + // 服务端生成的透传上报字段 + string footprint = 7; + // 来源 + string from = 8; + // 秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 9; +} + +// 最近访问-个人feed流列表-响应 +message DynVideoPersonalReply { + // 动态列表 + repeated DynamicItem list = 1; + // 偏移量 + string offset = 2; + // 是否还有更多数据 + bool has_more = 3; + // 已读进度 + string read_offset = 4; + // 关注状态 + Relation relation = 5; + // 顶部预约卡 + TopAdditionUP addition_up = 6; +} + +// 最近访问-标记已读-请求 +message DynVideoUpdOffsetReq { + // 被访问者的UID + int64 host_uid = 1; + // 用户已读进度 + string read_offset = 2; + // 服务端生成的透传上报字段 + string footprint = 3; +} + +// 视频页-最近访问 +message CardVideoUpList { + // 标题展示文案 + string title = 1; + // up主列表 + repeated UpListItem list = 2; + // 服务端生成的透传上报字段 + string footprint = 3; + // 直播数 + int32 show_live_num = 4; + // 跳转label + UpListMoreLabel more_label = 5; + // 标题开关(综合页) + int32 title_switch = 6; + // 是否展示右上角查看更多label + bool show_more_label = 7; + // 是否在快速消费页查看更多按钮 + bool show_in_personal = 8; + // 是否展示右侧查看更多按钮 + bool show_more_button = 9; +} + +// 最常访问-查看更多 +message UpListMoreLabel { + // 文案 + string title = 1; + // 跳转地址 + string uri = 2; +} + +// 动态顶部up列表-up主信息 +message UpListItem { + // 是否有更新 + bool has_update = 1; + // up主头像 + string face = 2; + // up主昵称 + string name = 3; + // up主uid + int64 uid = 4; + // 排序字段 从1开始 + int64 pos = 5; + // 用户类型 + UserItemType user_item_type = 6; + // 直播头像样式-日 + UserItemStyle display_style_day = 7; + // 直播头像样式-夜 + UserItemStyle display_style_night = 8; + // 直播埋点 + int64 style_id = 9; + // 直播状态 + LiveState live_state = 10; + // 分割线 + bool separator = 11; + // 跳转 + string uri = 12; + // UP主预约上报使用 + bool is_recall = 13; +} + +// 用户类型 +enum UserItemType { + // + user_item_type_none = 0; + // + user_item_type_live = 1; + // + user_item_type_live_custom = 2; + // + user_item_type_normal = 3; + // + user_item_type_extend = 4; +} + +// 直播头像样式 +message UserItemStyle { + // + string rect_text = 1; + // + string rect_text_color = 2; + // + string rect_icon = 3; + // + string rect_bg_color = 4; + // + string outer_animation = 5; +} + +// 视频页-我的追番 +message CardVideoFollowList { + // 查看全部(跳转链接) + string view_all_link = 1; + // 追番列表 + repeated FollowListItem list = 2; +} + +// 视频页-我的追番-番剧信息 +message FollowListItem { + // season_id + int64 season_id = 1; + // 标题 + string title = 2; + // 封面图 + string cover = 3; + // 跳转链接 + string url = 4; + // new_ep + NewEP new_ep = 5; + // 子标题 + string sub_title = 6; + // 卡片位次 + int64 pos = 7; +} + +// 最新ep +message NewEP { + // 最新话epid + int32 id = 1; + // 更新至XX话 + string index_show = 2; + // 更新剧集的封面 + string cover = 3; +} + +// 扩展字段,用于动态部分操作使用 +message Extend { + // 动态id + string dyn_id_str = 1; + // 业务方id + string business_id = 2; + // 源动态id + string orig_dyn_id_str = 3; + // 转发卡:用户名 + string orig_name = 4; + // 转发卡:图片url + string orig_img_url = 5; + // 转发卡:文字内容 + repeated Description orig_desc = 6; + // 填充文字内容 + repeated Description desc = 7; + // 被转发的源动态类型 + DynamicType orig_dyn_type = 8; + // 分享到站外展示类型 + string share_type = 9; + // 分享的场景 + string share_scene = 10; + // 是否快速转发 + bool is_fast_share = 11; + // r_type 分享和转发 + int32 r_type = 12; + // 数据源的动态类型 + int64 dyn_type = 13; + // 用户id + int64 uid = 14; + // 卡片跳转 + string card_url = 15; + // 透传字段 + google.protobuf.Any source_content = 16; + // 转发卡:用户头像 + string orig_face = 17; + // 评论跳转 + ExtendReply reply = 18; +} + +// 评论扩展 +message ExtendReply { + // 基础跳转地址 + string uri = 1; + // 参数部分 + repeated ExtendReplyParam params = 2; +} + +// 评论扩展参数部分 +message ExtendReplyParam { + // 参数名 + string key = 1; + // 参数值 + string value = 2; +} + +// 动态模块类型 +enum DynModuleType { + // 占位 + module_none = 0; + // 发布人模块 + module_author = 1; + // 争议小黄条 + module_dispute = 2; + // 描述文案 + module_desc = 3; + // 动态卡片 + module_dynamic = 4; + // 转发模块 + module_forward = 5; + // 点赞用户(废弃) + module_likeUser = 6; + // 小卡模块 + module_extend = 7; + // 附加卡 + module_additional = 8; + // 计数信息 + module_stat = 9; + // 折叠 + module_fold = 10; + // 评论外露(废弃) + module_comment = 11; + // 外露交互模块(点赞、评论) + module_interaction = 12; + // 转发卡的发布人模块 + module_author_forward = 13; + // 广告卡模块 + module_ad = 14; + // 通栏模块 + module_banner = 15; + // 获取物料失败模块 + module_item_null = 16; + // 分享组件 + module_share_info = 17; + // 相关推荐模块 + module_recommend = 18; + // 转发卡计数信息 + module_stat_forward = 19; + // 顶部模块 + module_top = 20; + // 底部模块 + module_bottom = 21; +} + +// 动态列表-用户模块-转发模板 +message ModuleAuthorForward { + // 展示标题 + repeated ModuleAuthorForwardTitle title = 1; + // 源卡片跳转链接 + string url = 2; + // 用户uid + int64 uid = 3; + // 时间标签 + string ptime_label_text = 4; + // 是否展示关注 + bool show_follow = 5; + // 源up主头像 + string face_url = 6; + // 双向关系 + Relation relation = 7; + // 右侧操作区域 - 三点样式 + repeated ThreePointItem tp_list = 8; +} + +// 动态列表-用户模块-转发模板-title部分 +message ModuleAuthorForwardTitle { + // 文案 + string text = 1; + // 跳转链接 + string url = 2; +} + +// 动态列表-用户模块-广告卡 +message ModuleAd { + // 广告透传信息 + google.protobuf.Any source_content = 1; + // 用户模块 + ModuleAuthor module_author = 2; +} + +// 动态列表-通栏 +message ModuleBanner { + // 模块标题 + string title = 1; + // 卡片类型 + ModuleBannerType type = 2; + // 卡片 + oneof item{ + ModuleBannerUser user = 3; + } + // 不感兴趣文案 + string dislike_text = 4; + // 不感兴趣图标 + string dislike_icon = 5; +} + +// 动态模块-投票 +message AdditionVote2 { + // 投票类型 + AdditionVoteType addition_vote_type = 1; + // 投票ID + int64 vote_id = 2; + // 标题 + string title = 3; + // 已过期: xxx人参与· 投票已过期。button 展示去查看 + // 未过期: xxx人参与· 剩xx天xx时xx分。button展示去投票 + string label = 4; + // 剩余时间 + int64 deadline = 5; + // 生效文案 + string open_text = 6; + // 过期文案 + string close_text = 7; + // 已投票 + string voted_text = 8; + // 投票状态 + AdditionVoteState state = 9; + // 投票信息 + oneof item { + // + AdditionVoteWord addition_vote_word = 10; + // + AdditionVotePic addition_vote_pic = 11; + // + AdditionVoteDefaule addition_vote_defaule = 12; + } + // 业务类型 + // 0:动态投票 1:话题h5组件 + int32 biz_type = 13; + // 投票总人数 + int64 total = 14; + // 附加卡类型 + string card_type = 15; + // 异常提示 + string tips = 16; + // 跳转地址 + string uri = 17; + // 是否投票 + bool is_voted = 18; + // 投票最多多选个数,单选为1 + int32 choice_cnt = 19; + // 是否默认选中分享到动态 + bool defaule_select_share = 20; +} + +// 投票类型 +enum AdditionVoteType { + // + addition_vote_type_none = 0; + // + addition_vote_type_word = 1; + // + addition_vote_type_pic = 2; + // + addition_vote_type_default = 3; +} + +// 外露文字类型 +message AdditionVoteWord { + // 外露文字投票详情 + repeated AdditionVoteWordItem item = 1; +} + +// 外露文字投票详情 +message AdditionVoteWordItem { + // 选项索引,从1开始 + int32 opt_idx = 1; + // 文案 + string title = 2; + // 选中状态 + bool is_vote = 3; + // 人数 + int32 total = 4; + // 占比 + double persent = 5; + // 是否投票人数最多的选项 + bool is_max_option = 6; +} + +// 外露图片类型 +message AdditionVotePic { + // 图片投票详情 + repeated AdditionVotePicItem item = 1; +} + +// 图片投票详情 +message AdditionVotePicItem { + // 选项索引,从1开始 + int32 opt_idx = 1; + // 图片 + string cover = 2; + // 选中状态 + bool is_vote = 3; + // 人数 + int32 total = 4; + // 占比 + double persent = 5; + // 标题文案 + string title = 6; + // 是否投票人数最多的选项 + bool is_max_option = 7; +} + +// 外露投票 +message AdditionVoteDefaule { + // 图片 多张 + repeated string cover = 1; +} + +// 投票状态 +enum AdditionVoteState { + // + addition_vote_state_none = 0; + // + addition_vote_state_open = 1; + // + addition_vote_state_close = 2; +} + +// 动态列表-通栏类型 +enum ModuleBannerType { + // + module_banner_type_none = 0; + // + module_banner_type_user = 1; +} + +// 获取物料失败模块 +message ModuleItemNull { + // 图标 + string icon = 1; + // 文案 + string text = 2; +} + +// 动态通栏-用户 +message ModuleBannerUser { + // 卡片列表 + repeated ModuleBannerUserItem list = 1; +} + +// 动态通栏-推荐用户卡 +message ModuleBannerUserItem { + // up主头像 + string face = 1; + // up主昵称 + string name = 2; + // up主uid + int64 uid = 3; + // 直播状态 + LiveState live_state = 4; + // 认证信息 + OfficialVerify official = 5; + // 大会员信息 + VipInfo vip = 6; + // 标签信息 + string label = 7; + // 按钮 + AdditionalButton button = 8; + // 跳转地址 + string uri = 9; +} + +// 动态-点赞用户模块 +message ModuleLikeUser { + // 点赞用户 + repeated LikeUser like_users = 1; + // 文案 + string display_text = 2; +} + +// 点赞用户 +message LikeUser { + // 用户mid + int64 uid = 1; + // 用户昵称 + string uname = 2; + // 点击跳转链接 + string uri = 3; +} + +// 点赞拓展信息 +message LikeInfo { + // 点赞动画 + LikeAnimation animation = 1; + // 是否点赞 + bool is_like = 2; +} + +// 点赞动画 +message LikeAnimation { + // 开始动画 + string begin = 1; + // 过程动画 + string proc = 2; + // 结束动画 + string end = 3; + // id + int64 like_icon_id = 4; +} + +// 右侧操作区域样式枚举 +enum ModuleAuthorBadgeType { + // 占位 + module_author_badge_type_none = 0; + // 三点 + module_author_badge_type_threePoint = 1; + // 按钮类型 + module_author_badge_type_button = 2; + // 提权 + module_author_badge_type_weight = 3; +} + +// 三点Item +message ThreePointItem { + //类型 + ThreePointType type = 1; + oneof item { + // 默认结构 + ThreePointDefault default = 2; + // 自动播放 + ThreePointAutoPlay auto_player = 3; + // 分享 + ThreePointShare share = 4; + // 关注 + ThreePointAttention attention = 5; + // 稍后在看 + ThreePointWait wait = 6; + // 不感兴趣 + ThreePointDislike dislike = 7; + // 收藏 + ThreePointFavorite favorite = 8; + // 置顶 + ThreePointTop top = 9; + // 评论 + ThreePointComment comment = 10; + } +} + +// 三点类型 +enum ThreePointType { + // 占位 + tp_none = 0; + // 使用此背景 + background = 1; + // 自动播放 + auto_play = 2; + // 分享 + share = 3; + // 稍后再播 + wait = 4; + // 关注 + attention = 5; + // 举报 + report = 6; + // 删除 + delete = 7; + // 不感兴趣 + dislike = 8; + // 收藏 + favorite = 9; + // 置顶 + top = 10; + // 评论 + comment = 11; +} + +// 动态列表渲染部分-用户模块-按钮 +message ModuleAuthorBadgeButton { + // 图标 + string icon = 1; + // 文案 + string title = 2; + // 状态 + int32 state = 3; + // 物料ID + int64 id = 4; +} + +// 三点-默认结构(使用此背景、举报、删除) +message ThreePointDefault { + // icon + string icon = 1; + // 标题 + string title = 2; + // 跳转链接 + string uri = 3; + // id + string id = 4; +} + +// 三点-自动播放 旧版不维护 +message ThreePointAutoPlay { + // open icon + string open_icon = 1; + // 开启时显示文案 + string open_text = 2; + // close icon + string close_icon = 3; + // 关闭时显示文案 + string close_text = 4; + // 开启时显示文案v2 + string open_text_v2 = 5; + // 关闭时显示文案v2 + string close_text_v2 = 6; + // 仅wifi/免流 icon + string only_icon = 7; + // 仅wifi/免流 文案 + string only_text = 8; + // open icon v2 + string open_icon_v2 = 9; + // close icon v2 + string close_icon_v2 = 10; +} + +// 三点-分享 +message ThreePointShare { + // icon + string icon = 1; + // 标题 + string title = 2; + // 分享渠道 + repeated ThreePointShareChannel channel = 3; + // 分享渠道名 + string channel_name = 4; + // 预约卡分享图信息,仅分享有预约信息的动态时存在 + ShareReserve reserve = 5; +} + +// 三点-分享渠道 +message ThreePointShareChannel { + // icon + string icon = 1; + // 名称 + string title = 2; +} + +// 三点-关注 +message ThreePointAttention { + // attention icon + string attention_icon = 1; + // 关注时显示的文案 + string attention_text = 2; + // not attention icon + string not_attention_icon = 3; + // 未关注时显示的文案 + string not_attention_text = 4; + // 当前关注状态 + ThreePointAttentionStatus status = 5; +} + +// 枚举-三点关注状态 +enum ThreePointAttentionStatus { + tp_not_attention = 0; + tp_attention = 1; +} + +// 三点-稍后在看 +message ThreePointWait { + // addition icon + string addition_icon = 1; + // 已添加时的文案 + string addition_text = 2; + // no addition icon + string no_addition_icon = 3; + // 未添加时的文案 + string no_addition_text = 4; + // avid + int64 id = 5; +} + +// 三点-不感兴趣 +message ThreePointDislike { + // icon + string icon = 1; + // 标题 + string title = 2; +} + +// 三点-收藏 +message ThreePointFavorite { + // icon + string icon = 1; + // 标题 + string title = 2; + // 物料ID + int64 id = 3; + // 是否订阅 + bool is_favourite = 4; + // 取消收藏图标 + string cancel_icon = 5; + // 取消收藏文案 + string cancel_title = 6; +} + +// 三点-置顶 +message ThreePointTop { + // icon + string icon = 1; + // 标题 + string title = 2; + // 状态 + TopType type = 3; +} + +// 状态 +enum TopType { + // 默认 置顶 + top_none = 0; + // 取消置顶 + top_cancel = 1; +} + +// 三点-评论 +message ThreePointComment { + // 精选评论区功能 + CommentDetail up_selection = 1; + // up关闭评论区功能 + CommentDetail up_close = 2; + // icon + string icon = 3; + // 标题 + string title = 4; +} + +// 精选评论区 +message CommentDetail { + // 该功能能不能用 + bool can_modify = 1; + // up关闭评论区功能 1允许关闭 0允许开放 + // 精选评论区功能 1允许停止评论精选 0允许评论精选 + int64 status = 2; +} + +// 提权样式 +message Weight { + // 提权展示标题 + string title = 1; + // 下拉框内容 + repeated WeightItem items = 2; + // icon + string icon = 3; +} + +// 提权样式 +message WeightItem { + // 类型 + WeightType type = 1; + oneof item { + // 热门默认跳转按钮 + WeightButton button = 2; + // 提权不感兴趣 + WeightDislike dislike = 3; + } +} + +// WeightType 枚举-提权类型 +enum WeightType { + // 默认 占位 + weight_none = 0; + // 不感兴趣 + weight_dislike = 1; + // 跳链 + weight_jump = 2; +} + +// 提权不感兴趣 +message WeightDislike { + // 负反馈业务类型 作为客户端调用负反馈接口的参数 + string feed_back_type = 1; + // 展示文案 + string title = 2; +} + +// 热门默认跳转按钮 +message WeightButton { + string jump_url = 1; + // 展示文案 + string title = 2; +} + +// 评论外露模块 +message ModuleComment { + // 评论外露展示项 + repeated CmtShowItem cmtShowItem = 1; +} + +// 评论外露展示项 +message CmtShowItem { + // 用户mid + int64 uid = 1; + // 用户昵称 + string uname = 2; + // 点击跳转链接 + string uri = 3; + // 评论内容 + string comment = 4; +} + +// 动态通用附加卡-follow/取消follow-请求 +message DynAdditionCommonFollowReq { + // + AdditionalButtonStatus status = 1; + // + string dyn_id = 2; + // + string card_type = 3; +} + +// +enum FollowType { + // + ft_not_follow = 0; + // + ft_follow = 1; +} + +// 动态通用附加卡-follow/取消follow-响应 +message DynAdditionCommonFollowReply { + // + AdditionalButtonStatus status = 1; +} + +// 动态点赞-请求 +message DynThumbReq { + // 用户uid + int64 uid = 1; + // 动态id + string dyn_id = 2; + // 动态类型(透传extend中的dyn_type) + int64 dyn_type = 3; + // 业务方资源id + string rid = 4; + // 点赞类型 + ThumbType type = 5; +} + +// +enum ThumbType { + // + cancel = 0; + // + thumb = 1; +} + +// 动态发布生成临时卡-请求 +message DynFakeCardReq { + //卡片内容json string + string content = 1; +} + +// 动态发布生成临时卡-响应 +message DynFakeCardReply { + // 动态卡片 + DynamicItem item = 1; +} + +// 关注推荐up主换一换-请求 +message DynRcmdUpExchangeReq { + // 登录用户id + int64 uid = 1; + // 上一次不感兴趣的ts,单位:秒;该字段透传给搜索 + int64 dislikeTs = 2; + // 需要与服务端确认或参照客户端现有参数 + string from = 3; +} + +// 关注推荐up主换一换-响应 +message DynRcmdUpExchangeReply { + // 无关注推荐 + Unfollow unfollow = 1; +} + +// 最近访问-个人feed流列表-请求 +message DynAllPersonalReq { + // 被访问者的 UID + int64 host_uid = 1; + // 偏移量 第一页可传空 + string offset = 2; + // 标明下拉几次 + int32 page = 3; + // 是否是预加载 默认是1;客户端预加载。1:是预加载,不更新已读进度,不会影响小红点;0:非预加载,更新已读进度 + int32 is_preload = 4; + // 秒开参数 新版本废弃,统一使用player_args + PlayurlParam playurl_param = 5; + // 客户端时区 兼容UTC-14和Etc/GMT+12,时区区间[-12,14] 东八区为8 + int32 local_time = 6; + // 服务端生成的透传上报字段 + string footprint = 7; + // 来源 + string from = 8; + // 秒开用 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 9; +} + +// 最近访问-个人feed流列表-返回 +message DynAllPersonalReply { + // 动态列表 + repeated DynamicItem list = 1; + // 偏移量 + string offset = 2; + // 是否还有更多数据 + bool has_more = 3; + // 已读进度 + string read_offset = 4; + // 关注状态 + Relation relation = 5; + // 顶部预约卡 + TopAdditionUP addition_up = 6; +} + +// 顶部预约卡 +message TopAdditionUP { + // 预约卡 + repeated AdditionUP up = 1; + // 折叠数量,大于多少个进行折叠 + int32 has_fold = 2; +} + +// 最近访问-标记已读-请求 +message DynAllUpdOffsetReq { + // 被访问者的UID + int64 host_uid = 1; + // 用户已读进度 + string read_offset = 2; + // 服务端生成的透传上报字段 + string footprint = 3; +} + +// 投票操作-请求 +message DynVoteReq { + // 投票ID + int64 vote_id = 1; + // 选项索引数组 + repeated int64 votes = 2; + // 状态 + VoteStatus status = 3; + // 动态ID + string dynamic_id = 4; + // 是否分享 + bool share = 5; +} + +// 状态 +enum VoteStatus { + // 正常 + normal = 0; + // 匿名 + anonymous = 1; +} + +// 投票操作-响应 +message DynVoteReply { + // 投票详情 + AdditionVote2 item = 1; + // 投票操作返回状态 + string toast = 2; +} + +// 关注关系 +message Relation { + // 关注状态 + RelationStatus status = 1; + // 关注 + int32 is_follow = 2; + // 被关注 + int32 is_followed = 3; + // 文案 + string title = 4; +} + +// 关注关系 枚举 +enum RelationStatus { + // 1-未关注 2-关注 3-被关注 4-互相关注 5-特别关注 + relation_status_none = 0; + relation_status_nofollow = 1; + relation_status_follow = 2; + relation_status_followed = 3; + relation_status_mutual_concern = 4; + relation_status_special = 5; +} + +message MixUpListLiveItem { + // 直播状态 + // 0:未直播 1:直播中 + bool status = 1; + // 房间号 + int64 room_id = 2; + // 跳转地址 + string uri = 3; +} + +// 查看更多-列表单条数据 +message MixUpListItem { + // 用户mid + int64 uid = 1; + // 特别关注 + // 0:否 1:是 + int32 special_attention = 2; + // 小红点状态 + // 0:没有 1:有 + int32 reddot_state = 3; + // 直播信息 + MixUpListLiveItem live_info = 4; + // 昵称 + string name = 5; + // 头像 + string face = 6; + // 认证信息 + OfficialVerify official = 7; + // 大会员信息 + VipInfo vip = 8; + // 关注状态 + Relation relation = 9; +} + +// 查看更多-请求 +message DynMixUpListViewMoreReq { + // 排序策略 + // 1:推荐排序 2:最常访问 3:最近关注,其他值为默认排序 + int32 sort_type = 1; +} + +// 排序类型 +message SortType { + // 排序策略 + // 1:推荐排序 2:最常访问 3:最近关注 + int32 sort_type = 1; + // 排序策略名称 + string sort_type_name = 2; +} + +// 查看更多-列表-响应 +message DynMixUpListViewMoreReply { + // + repeated MixUpListItem items = 1; + // + string search_default_text = 2; + // 排序类型列表 + repeated SortType sort_types = 3; + // 是否展示更多的排序策略 + bool show_more_sort_types = 4; + // 默认排序策略 + int32 default_sort_type = 5; +} + +// 轻浏览-请求 +message DynLightReq { + // 透传 history_offset + string history_offset = 1; + // 向下翻页数 + int32 page = 2; + // 来源 + string from = 3; + // 秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 4; + // 客户端时区 兼容UTC-14和Etc/GMT+12,时区区间[-12,14] 东八区为8 + int32 local_time = 5; +} + +// 轻浏览-响应 +message DynLightReply { + // 卡片列表 + DynamicList dynamic_list = 1; +} + +// 动态详情页-请求 +message DynDetailReq { + // up主uid + int64 uid = 1; + // 动态ID + string dynamic_id = 2; + // 动态类型 + int64 dyn_type = 3; + // 业务方资源id + int64 rid = 4; + // 广告参数 + AdParam ad_param = 5; + // From来源 + string from = 6; + // 秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 7; + // 分享id + string share_id = 8; + // 分享类型 + // 1:文字 2:图片 3:链接 4:视频 5:音频 + int32 share_mode = 9; + // 客户端时区 兼容UTC-14和Etc/GMT+12,时区区间[-12,14] 东八区为8 + int32 local_time = 10; + // pattern + string pattern = 11; +} + +// 动态详情页-响应 +message DynDetailReply { + // 动态详情 + DynamicItem item = 1; +} + +// 点赞列表-请求 +message LikeListReq { + // 动态ID + string dynamic_id = 1; + // 动态类型 + int64 dyn_type = 2; + // 业务方资源id + int64 rid = 3; + //上一页最后一个uid + int64 uid_offset = 4; + // 下拉页数 + int32 page = 5; +} + +// 点赞列表-响应 +message LikeListReply { + // 用户模块列表 + repeated ModuleAuthor list = 1; + // 是否还有更多数据 + bool has_more = 2; + // 点赞总数 + int64 total_count = 3; +} + +// 转发列表-请求 +message RepostListReq { + // 动态ID + string dynamic_id = 1; + // 动态类型 + int64 dyn_type = 2; + // 业务方资源id + int64 rid = 3; + // 偏移,使用上一页回包中的offset字段;第一页不传。 + string offset = 4; + // 来源 + string from = 5; + // 评论类型 + RepostType repost_type = 6; +} + +// 转发列表-响应 +message RepostListRsp { + // 列表 + repeated DynamicItem list = 1; + // 偏移 + string offset = 2; + // 是否还有更多 + bool has_more = 3; + // 转发总数 + int64 total_count = 4; + // 评论类型 + RepostType repost_type = 5; +} + +// 评论类型 +enum RepostType { + // 热门评论 + repost_hot = 0; + // 普通评论 + repost_general = 1; +} + +// 分享模块 +message ModuleShareInfo { + // 展示标题 + string title = 1; + // 分享组件列表 + repeated ShareChannel share_channels = 2; + // share_origin + string share_origin = 3; + // 业务id + string oid = 4; + // sid + string sid = 5; +} + +// 分享渠道组件 +message ShareChannel { + // 分享名称 + string name = 1; + // 分享按钮图片 + string image = 2; + // 分享渠道 + string channel = 3; + // 预约卡分享图信息,仅分享有预约信息的动态时存在 + ShareReserve reserve = 4; +} + +// 预约卡分享图信息 +message ShareReserve { + // 展示标题 + string title = 1; + // 描述(时间+类型) + string desc = 2; + // 二维码附带icon + string qr_code_icon = 3; + // 二维码附带文本 + string qr_code_text = 4; + // 二维码url + string qr_code_url = 5; +} + +// 相关推荐模块 +message ModuleRecommend { + // 模块标题 + string module_title = 1; + // 图片 + string image = 2; + // 标签 + string tag = 3; + // 标题 + string title = 4; + // 跳转链接 + string jump_url = 5; + // 序列化的广告信息 + repeated google.protobuf.Any ad = 6; +} + +// 空间页动态-请求 +message DynSpaceReq { + // 被访问者,也就是空间主人的uid + int64 host_uid = 1; + // 动态偏移history_offset + string history_offset = 2; + // 秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 3; + // 客户端时区 兼容UTC-14和Etc/GMT+12,时区区间[-12,14] 东八区为8 + int32 local_time = 4; + // 向下翻页数,默认从1开始 + int64 page = 5; + // 来源,空间页:space,直播tab:live + string from = 6; +} + +// 空间页动态-响应 +message DynSpaceRsp { + // 卡片列表 + repeated DynamicItem list = 1; + // 历史偏移 + string history_offset = 2; + // 是否还有更多数据 + bool has_more = 3; +} + +// 顶部模块 +message ModuleTop { + // 三点模块 + repeated ThreePointItem tp_list = 1; +} + +// 底部模块 +message ModuleButtom { + // 计数模块 + ModuleStat module_stat = 1; +} + +// 推荐页-请求 +message DynRcmdReq { + // 秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs player_args = 1; + // 客户端时区 兼容UTC-14和Etc/GMT+12,时区区间[-12,14] 东八区为8 + int32 local_time = 2; +} + +// 推荐页-响应 +message DynRcmdReply { + // 推荐页返回参数 + DynRegionRcmd region_rcmd = 1; +} + +// 推荐页返回参数 +message DynRegionRcmd { + // 分区推荐项目列表 + repeated DynRegionRcmdItem items = 1; + // 分区聚类推荐选项 + RcmdOption opts = 2; +} + +// 分区聚类推荐选项 +message RcmdOption{ + // 视频是否展示标题 + bool show_title = 1; +} + +// 分区推荐项目 +message DynRegionRcmdItem { + // 分区id + int64 rid = 1; + // 标题 + string title = 2; + // 推荐模块 + repeated ModuleRcmd items = 3; +} + +// 推荐模块 +message ModuleRcmd { + // 用户头像 + RcmdAuthor author = 1; + // 推荐卡片列表 + repeated RcmdItem items = 2; + // 透传到客户端的埋点字段 + string server_info = 3; +} + +// 推荐UP主用户模块 +message RcmdAuthor { + // 用户详情 + UserInfo author = 1; + // 描述:粉丝数、推荐理由 + string desc = 2; + // 关注状态 + Relation relation = 3; +} + +// 推荐卡片列表 +message RcmdItem { + // 卡片类型 + RcmdType type = 1; + // 卡片列表 + oneof rcmd_item { + // + RcmdArchive rcmd_archive = 2; + } +} + +// 推荐模块数据类型 +enum RcmdType { + // 稿件 + rcmd_archive = 0; +} + +// +message RcmdArchive { + // 标题 + string title = 1; + // 封面图 + string cover = 2; + // 视频封面展示项 1 + CoverIcon cover_left_icon_1 = 3; + // 视频封面展示项 1 + string cover_left_text_1 = 4; + // 秒开地址 + string uri = 5; + // 是否PGC + bool is_pgc = 6; + // aid + int64 aid = 7; +} + +// +enum CoverIcon { + // 占位 啥都不展示 + cover_icon_none = 0; + // 播放icon + cover_icon_play = 1; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/interfaces/v1.proto b/src/Models/Models.gRPC/bilibili/app/interfaces/v1.proto new file mode 100644 index 0000000000000000000000000000000000000000..70afc719a120181e14def9203f4b17dce44e9670 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/interfaces/v1.proto @@ -0,0 +1,594 @@ +syntax = "proto3"; + +package bilibili.app.interfaces.v1; + +import "bilibili/app/playurl/v1/playurl.proto"; + +//历史记录接口 +service History { + //搜索历史记录 + //https://app.bilibili.com/bilibili.app.interface.v1.History/Search + rpc search (SearchReq) returns (SearchReply); + + //? + //https://app.bilibili.com/bilibili.app.interface.v1.History/LatestHistory + rpc latestHistory (LatestHistoryReq) returns (LatestHistoryReply); + + //获取历史记录业务类型 + //https://app.bilibili.com/bilibili.app.interface.v1.History/HistoryTab + rpc historyTab (HistoryTabReq) returns (HistoryTabReply); + + //删除历史记录 + //https://app.bilibili.com/bilibili.app.interface.v1.History/Delete + rpc delete (DeleteReq) returns (NoReply); + + //获取历史记录列表v2接口 + //https://app.bilibili.com/bilibili.app.interface.v1.History/CursorV2 + rpc cursorV2 (CursorV2Req) returns (CursorV2Reply); + + //获取历史记录列表v1接口 + //https://app.bilibili.com/bilibili.app.interface.v1.History/Cursor + rpc cursor (CursorReq) returns (CursorReply); + + //清空历史记录 + //https://app.bilibili.com/bilibili.app.interface.v1.History/Clear + rpc clear (ClearReq) returns (NoReply); +} + +//搜索接口 +service Search { + //获取搜索建议 + //https://app.bilibili.com/bilibili.app.interface.v1.Search/Suggest3 + rpc suggest3 (SuggestionResult3Req) returns (SuggestionResult3Reply); +} + +//搜索历史记录-请求 +message SearchReq { + //关键词 + string keyword = 1; + + //页码 + int64 pn = 2; + + //业务选择 + string business = 3; +} + +//搜索历史记录-回复 +message SearchReply { + //历史记录条目列表 + repeated CursorItem items = 1; + + //是否未拉取完 + bool hasMore = 2; + + //页面信息 + Page page = 3; +} + +//?-请求 +message LatestHistoryReq { + //业务选择 + string business = 1; + + //视频预加载配置 + PlayerPreloadParams playerPreload = 2; +} + +//?-回复 +message LatestHistoryReply { + //历史记录条目 + CursorItem items = 1; + + // + string scene = 2; +} + +//获取历史记录业务类型-请求 +message HistoryTabReq { + // + string business = 1; + + // + HistorySource source = 2; + + // + string keyword = 3; +} + +//获取历史记录业务类型-回复 +message HistoryTabReply { + // + repeated CursorTab tab = 1; +} + +//删除历史记录-请求 +message DeleteReq { + //历史记录信息 + HisInfo hisInfo = 1; +} + +//获取历史记录列表v2接口-请求 +message CursorV2Req { + //游标信息 + Cursor cursor = 1; + + //业务选择 + string business = 2; + + //视频预加载配置 + PlayerPreloadParams playerPreload = 3; + + // + bilibili.app.playurl.v1.PlayerArgs playerArgs = 4; +} + +//获取历史记录列表v2接口-回复 +message CursorV2Reply { + //历史记录条目列表 + repeated CursorItem items = 1; + + //游标信息 + Cursor cursor = 2; + + //是否未拉取完 + bool hasMore = 3; +} + +//获取历史记录列表v1接口-请求 +message CursorReq { + //游标信息 + Cursor cursor = 1; + + //业务选择 + string business = 2; + + //视频预加载配置 + PlayerPreloadParams playerPreload = 3; +} + +//获取历史记录列表v1接口-回复 +message CursorReply { + //历史记录条目列表 + repeated CursorItem items = 1; + + //业务类型表 + repeated CursorTab tab = 2; + + //游标信息 + Cursor cursor = 3; + + //是否未拉取完 + bool hasMore = 4; +} + +//清空历史记录-请求 +message ClearReq { + //业务选择 + string business = 1; +} + +//空回复 +message NoReply { + +} + +//获取搜索建议-请求 +message SuggestionResult3Req { + //关键字 + string keyword = 1; + + //是否语法高亮 + int32 highlight = 2; + + //是否青少年模式 + int32 teenagersMode = 3; +} + +//获取搜索建议-回复 +message SuggestionResult3Reply { + //搜索追踪id + string trackid = 1; + + //搜索建议条目列表 + repeated ResultItem list = 2; + + // + string expStr = 3; +} + +//专栏条目类型 +message CardArticle { + //封面uel + repeated string covers = 1; + + //作者昵称 + string name = 2; + + //作者UID + int64 mid = 3; + + // + bool displayAttention = 4; + + //标志名 + string badge = 5; + + // + Relation relation = 6; +} + +//课程条目类型 +message CardCheese { + //封面url + string cover = 1; + + //观看进度 + int64 progress = 2; + + //总计时长 + int64 duration = 3; + + //单集标题 + string subtitle = 4; +} + +//直播条目类型 +message CardLive { + //封面url + string cover = 1; + + //主播昵称 + string name = 2; + + //主播UID + int64 mid = 3; + + //直播分区名 + string tag = 4; + + // + int32 ststus = 5; + + // + bool displayAttention = 6; + + // + Relation relation = 7; +} + +//pgc稿件条目类型 +message CardOGV { + //封面url + string cover = 1; + + //观看进度 + int64 progress = 2; + + //总计时长 + int64 duration = 3; + + //单集标题 + string subtitle = 4; +} + +//ugc稿件条目类型 +message CardUGC { + //封面url + string cover = 1; + + //观看进度 + int64 progress = 2; + + //视频长度 + int64 duration = 3; + + //UP主昵称 + string name = 4; + + //UP主UID + int64 mid = 5; + + // + bool displayAttention = 6; + + //观看视频cid + int64 cid = 7; + + //观看视频分P + int32 page = 8; + + // + string subtitle = 9; + + // + Relation relation = 10; + + //稿件bvid + string bvid = 11; + + //总分P数 + int64 videos = 12; + + //短链接 + string shortLink = 13; + + //副标题文案 + string shareSubtitle = 14; + + //播放数 + int64 view = 15; +} + +//游标信息 +message Cursor { + //起始时间戳 + int64 max = 1; + + // + int32 maxTp = 2; +} + +//历史记录条目 +message CursorItem { + //主体数据 + oneof cardItemCase { + //ugc稿件 + CardUGC cardUGC = 1; + + //pgc稿件 + CardOGV cardOGV = 2; + + //专栏 + CardArticle cardArticle = 3; + + //直播 + CardLive cardLive = 4; + + //课程 + CardCheese cardCheese = 5; + } + + //标题 + string title = 6; + + //目标uri/url + string uri = 7; + + //观看时间 + int64 viewAt = 8; + + //历史记录id + int64 kid = 9; + + //对象id + int64 oid = 10; + + //业务类型 + string business = 11; + + //业务类型代码 + int32 tp = 12; + + //设备标识 + DeviceType dt = 13; + + // + bool hasShare = 14; +} + +//业务分类表 +message CursorTab { + //业务名 + string business = 1; + + //名称 + string name = 2; + + //路由uri + string router = 3; + + // + bool focus = 4; +} + +//设备标识代码 +enum DT { + //未知 + Unknown_VALUE = 0; + + //手机端 + Phone_VALUE = 1; + + //ipad端 + Pad_VALUE = 2; + + //web端 + PC_VALUE = 3; +} + +//设备标识 +message DeviceType { + //设备标识代码 + DT type = 1; + + //图标url + string icon = 2; +} + +//历史记录信息 +message HisInfo { + //业务选择 + string business = 1; + + //历史记录id + int64 kid = 2; +} + +// +enum HistorySource { + // + history_VALUE = 0; + + // + shopping_VALUE = 1; +} + +// +message OfficialVerify { + // + int32 type = 1; + + // + string desc = 2; +} + +//页面信息 +message Page { + //当前页码 + int64 pn = 1; + + //总计条目数 + int64 total = 2; +} + +//视频预加载配置 +message PlayerPreloadParams { + //清晰度 + int64 qn = 1; + + // + int64 fnver = 2; + + //流类型 + int64 fnval = 3; + + //强制域名 + int64 forceHost = 4; + + //是否4K + int64 fourk = 5; +} + +// +message ReasonStyle { + // + string text = 1; + + // + string textColor = 2; + + // + string textColorNight = 3; + + // + string bgColor = 4; + + // + string bgColorNight = 5; + + // + string borderColor = 6; + + // + string borderColorNight = 7; + + // + int32 bgStyle = 8; +} + +// +message Relation { + // + int32 status = 1; + + // + int32 isFollow = 2; + + // + int32 isFollowed = 3; +} + +//搜索建议条目 +message ResultItem { + //来源 + string from = 1; + + //显示结果(语法高亮) + string title = 2; + + //结果 + string keyword = 3; + + //序号 + int32 position = 4; + + // + string cover = 5; + + // + double coverSize = 6; + + // + string sugType = 7; + + // + int32 termType = 8; + + // + string goto = 9; + + // + string uri = 10; + + // + OfficialVerify officialVerify = 11; + + // + string param = 12; + + // + int64 mid = 13; + + // + int32 fans = 14; + + // + int32 level = 15; + + // + int32 archives = 16; + + // + int64 ptime = 17; + + // + string seasonTypeName = 18; + + // + string area = 19; + + // + string style = 20; + + // + string label = 21; + + // + double rating = 22; + + // + int32 vote = 23; + + // + repeated ReasonStyle badges = 24; + + // + string styles = 25; + + // + int64 moduleId = 26; + + // + string liveLink = 27; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/playurl/v1/playurl.proto b/src/Models/Models.gRPC/bilibili/app/playurl/v1/playurl.proto new file mode 100644 index 0000000000000000000000000000000000000000..2b10b2a7a0925cf7fd06f0fe5091997e825cc440 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/playurl/v1/playurl.proto @@ -0,0 +1,739 @@ +syntax = "proto3"; + +package bilibili.app.playurl.v1; + +//视频url +service PlayURL { + // 获取视频url + rpc PlayURL (PlayURLReq) returns (PlayURLReply); + // 获取投屏url + rpc Project (ProjectReq) returns (ProjectReply); + // 获取视频url及播放界面配置 + rpc PlayView (PlayViewReq) returns (PlayViewReply); + // 编辑播放界面配置 + rpc PlayConfEdit (PlayConfEditReq) returns (PlayConfEditReply); + // 获取播放界面配置 + rpc PlayConf (PlayConfReq) returns (PlayConfReply); +} + +// 获取视频url-请求 +message PlayURLReq { + // 稿件avid + int64 aid = 1; + // 视频cid + int64 cid = 2; + // 清晰度 + int64 qn = 3; + // 视频流版本 + int32 fnver = 4; + // 视频流格式 + int32 fnval = 5; + // 下载模式 + // 0:播放 1:flv下载 2:dash下载 + uint32 download = 6; + // 流url强制是用域名 + // 0:允许使用ip 1:使用http 2:使用https + int32 forceHost = 7; + // 允许4K + bool fourk = 8; + // 当前页spm + string spmid = 9; + // 上一页spm + string fromSpmid = 10; +} + +// 视频url-回复 +message PlayURLReply { + // 清晰的 + uint32 quality = 1; + // 格式 + string format = 2; + // 总时长(单位为ms) + uint64 timelength = 3; + // 编码id + uint32 videoCodecid = 4; + // 视频流版本 + uint32 fnver = 5; + // 视频流格式 + uint32 fnval = 6; + // 是否支持投影 + bool videoProject = 7; + // 分段视频流 + repeated ResponseUrl durl = 8; + // dash视频流 + ResponseDash dash = 9; + // 是否非全二压 + int32 noRexcode = 10; + // + UpgradeLimit upgradeLimit = 11; + // + repeated FormatDescription supportFormats = 12; + // 视频格式 + VideoType type = 13; +} + +//获取播放界面配置-请求 +message PlayConfReq { + +} + +//获取播放界面配置-回复 +message PlayConfReply { + //播放控件用户自定义配置 + PlayAbilityConf playConf = 1; +} + +//-请求 +message PlayConfEditReq { + // + repeated PlayConfState playConf = 1; +} + +//-回复 +message PlayConfEditReply { + +} + + + + + +//获取视频播放业务数据-请求 +message PlayViewReq { + //稿件avid + int64 aid = 1; + + //视频cid + int64 cid = 2; + + //清晰度 + int64 qn = 3; + + //流类型 + int32 fnver = 4; + + // + int32 fnval = 5; + + //下载模式 + //0:播放 1:flv下载 2:dash下载 + uint32 download = 6; + + //流url强制是用域名 + //0:允许使用ip 1:使用http 2:使用https + int32 forceHost = 7; + + //允许4K + bool fourk = 8; + + // + string spmid = 9; + + // + string fromSpmid = 10; + + // + int32 teenagersMode = 11; + + // + CodeType preferCodecType = 12; +} + +//获取视频播放业务数据-回复 +message PlayViewReply { + //视频流信息 + VideoInfo info = 1; + + //播放控件用户自定义配置 + PlayAbilityConf PlayConf = 2; + + //互动视频升级提示 + UpgradeLimit upgradeLimit = 3; + + // + Chronos chronos = 4; + + //播放控件稿件配置 + PlayArcConf playArc = 5; + + //事件 + Event event = 6; +} + +//-请求 +message ProjectReq { + //稿件avid + int64 aid = 1; + + //视频cid + int64 cid = 2; + + //清晰度 + int64 qn = 3; + + //流类型 + int32 fnver = 4; + + // + int32 fnval = 5; + + //下载模式 + //0:播放 1:flv下载 2:dash下载 + uint32 download = 6; + + //流url强制是用域名 + //0:允许使用ip 1:使用http 2:使用https + int32 forceHost = 7; + + //允许4K + bool fourk = 8; + + // + string spmid = 9; + + // + string fromSpmid = 10; + + // + int32 protocol = 11; + + // + int32 deviceType = 12; +} + +//-回复 +message ProjectReply { + // + PlayURLReply project = 1; +} + +//配置项 +message ArcConf { + //是否开启 + bool isSupport=1; +} + +// +message Chronos { + // + string md5=1; + + // + string file=2; +} + +// +message CloudConf { + // + bool show = 1; + + // + ConfType confType = 2; + + // + FieldValue fieldValue = 3; +} + +// 编码类型 +enum CodeType { + // 默认 + NOCODE = 0; + // H.264 + CODE264 = 1; + // H.265 + CODE265 = 2; +} + +// +enum ConfType { + // + NoType_VALUE = 0; + // + FLIPCONF_VALUE = 1; + // + CASTCONF_VALUE = 2; + // + FEEDBACK_VALUE = 3; + // + SUBTITLE_VALUE = 4; + // + PLAYBACKRATE_VALUE = 5; + // + TIMEUP_VALUE = 6; + // + PLAYBACKMODE_VALUE = 7; + // + SCALEMODE_VALUE = 8; + // + BACKGROUNDPLAY_VALUE = 9; + // + LIKE_VALUE = 10; + // + DISLIKE_VALUE = 11; + // + COIN_VALUE = 12; + // + ELEC_VALUE = 13; + // + SHARE_VALUE = 14; + // + SCREENSHOT_VALUE = 15; + // + LOCKSCREEN_VALUE = 16; + // + RECOMMEND_VALUE = 17; + // + PLAYBACKSPEED_VALUE = 18; + // + DEFINITION_VALUE = 19; + // + SELECTIONS_VALUE = 20; + // + NEXT_VALUE = 21; + // + EDITDM_VALUE = 22; + // + SMALLWINDOW_VALUE = 23; + // + SHAKE_VALUE = 24; + // + OUTERDM_VALUE = 25; + // + INNERDM_VALUE = 26; + // + PANORAMA_VALUE = 27; + // + DOLBY_VALUE = 28; +} + +// +message DashItem { + // + uint32 id=1; + //主线流 + string baseUrl=2; + //备用流 + repeated string backupUrl=3; + //带宽 + uint32 bandwidth=4; + // + uint32 codecid=5; + //md5 + string md5=6; + //大小 + uint64 size=7; +} + +//dash视频流 +message DashVideo { + //主线流 + string baseUrl=1; + + //备用流 + repeated string backupUrl=2; + + //带宽 + uint32 bandwidth=3; + + // + uint32 codecid=4; + + //md5 + string md5=5; + + //大小 + uint64 size=6; + + // + uint32 audioId=7; + + //是否非全二压 + bool noRexcode=8; +} + +//杜比音频信息 +message DolbyItem { + // + int32 type=1; + + //音频流 + DashItem audio=2; +} + +//事件 +message Event { + //震动 + Shake shake=1; +} + +// +message FieldValue { + // + oneof valueCase { + // + bool value = 1; + } +} + +// +message FormatDescription { + // + int32 quality = 1; + + // + string format = 2; + + // + string description = 3; + + // + string newDescription = 4; + + // + string displayDesc = 5; + + // + string superscript = 6; +} + +//禁用功能配置 +message PlayAbilityConf { + //后台播放 + bool backgroundPlayDisable=1; + + //镜像反转 + bool flipDisable=2; + + //投屏 + bool castDisable=3; + + //反馈 + bool feedbackDisable=4; + + //字幕 + bool subtitleDisable=5; + + //播放速度 + bool playbackRateDisable=6; + + //定时停止 + bool timeUpDisable=7; + + //播放方式 + bool playbackModeDisable=8; + + //画面尺寸 + bool scaleModeDisable=9; + + //赞 + bool likeDisable=10; + + //踩 + bool dislikeDisable=11; + + //投币 + bool coinDisable=12; + + //充电 + bool elecDisable=13; + + //分享 + bool shareDisable=14; + + //截图 + bool screenShotDisable=15; + + //锁定 + bool lockScreenDisable=16; + + //相关推荐 + bool recommendDisable=17; + + //播放速度 + bool playbackSpeedDisable=18; + + //清晰度 + bool definitionDisable=19; + + //选集 + bool selectionsDisable=20; + + //下一集 + bool nextDisable=21; + + //编辑弹幕 + bool editDmDisable=22; + + //小窗 + bool smallWindowDisable=23; + + //震动 + bool shakeDisable=24; + + // + bool outerDmDisable=25; + + // + bool innerDmDisable=26; + + // + bool freyaEnterDisable=27; + + //杜比音效 + bool dolbyDisable=28; +} + +//播放控件稿件配置 +message PlayArcConf { + //后台播放 + ArcConf backgroundPlayConf=1; + //镜像反转 + ArcConf flipConf=2; + //投屏 + ArcConf castConf=3; + //反馈 + ArcConf feedbackConf=4; + //字幕 + ArcConf subtitleConf=5; + //播放速度 + ArcConf playbackRateConf=6; + //定时停止 + ArcConf timeUpConf=7; + //播放方式 + ArcConf playbackModeConf=8; + //画面尺寸 + ArcConf scaleModeConf=9; + //赞 + ArcConf likeConf=10; + //踩 + ArcConf dislikeConf=11; + //投币 + ArcConf coinConf=12; + //充电 + ArcConf elecConf=13; + //分享 + ArcConf shareConf=14; + //截图 + ArcConf screenShotConf=15; + //锁定 + ArcConf lockScreenConf=16; + //相关推荐 + ArcConf recommendConf=17; + //播放速度 + ArcConf playbackSpeedConf=18; + //清晰度 + ArcConf definitionConf=19; + //选集 + ArcConf selectionsConf=20; + //下一集 + ArcConf nextConf=21; + //编辑弹幕 + ArcConf editDmConf=22; + //小窗 + ArcConf smallWindowConf=23; + //震动 + ArcConf shakeConf=24; + // + ArcConf outerDmConf=25; + // + ArcConf innerDmConf=26; + // + ArcConf freyaEnterConf=27; + //杜比音效 + ArcConf dolbyConf=28; +} + +// +message PlayConfState { + // + ConfType confType = 1; + + // + bool show = 2; + + // + FieldValue fieldValue = 3; +} + +// +enum PlayErr { + // + NoErr_VALUE = 0; + + // + WithMultiDeviceLoginErr_VALUE = 1; +} + +// +message PlayerArgs { + // + int64 qn = 1; + + // + int64 fnver = 2; + + // + int64 fnval = 3; + + // + int64 forceHost = 4; +} + +// +message ResponseDash { + // + repeated DashItem video = 1; + + // + repeated DashItem audio = 2; +} + +//分段流条目 +message ResponseUrl { + //分段序号 + uint32 order = 1; + + //分段时长 + uint64 length = 2; + + //分段大小 + uint64 size = 3; + + //主线流 + string url = 4; + + //备用流 + repeated string backupUrl = 5; + + //md5 + string md5 = 6; +} + +//分段视频流 +message SegmentVideo { + //分段视频流列表 + repeated ResponseUrl segment=1; +} + +//震动 +message Shake { + // + string file=1; +} + +//视频流信息 +message Stream { + //元数据 + StreamInfo info=1; + + // + oneof contentCase { + //dash流 + DashVideo dashvideo=2; + + //分段流 + SegmentVideo segmentvideo=3; + } +} + +//流媒体元数据 +message StreamInfo { + //清晰度 qn + uint32 quality=1; + //格式 + string format=2; + //格式描述 + string description=3; + //错误码 + uint32 errCode=4; + //不满足条件信息 + Limit limit=5; + //是否需要vip + bool needVip=6; + //是否需要登录 + bool needLogin=7; + //是否完整 + bool intact=8; + //是否非全二压 + bool noRexcode=9; + // + int64 attribute=10; + //新版格式描述 + string newDescription=11; + //格式文字 + string displayDesc=12; + //新版格式描述备注 + string superscript=13; +} + +//不满足条件信息 +message Limit { + // + string title=1; + + // + string uri=2; + + // + string msg=3; +} + +// +message UpgradeButton { + // + string title = 1; + + // + string link = 2; +} + +//互动视频升级提示 +message UpgradeLimit { + //错误码 + int32 code =1; + + //错误信息 + string message =2; + + //图片url + string image =3; + + //按钮信息 + UpgradeButton button=4; +} + +//视频url信息 +message VideoInfo { + //视频清晰度 + uint32 quality=1; + + //视频格式 + string format=2; + + //视频时长 + uint64 timelength=3; + + // + uint32 videoCodecid=4; + + //视频流 + repeated Stream streamList=5; + + //伴音流 + repeated DashItem audio=6; + + //杜比伴音流 + DolbyItem dolby=7; +} + +// 视频类型 +enum VideoType { + // + Unknown_VALUE = 0; + // flv格式 + FLV_VALUE = 1; + // dash格式 + DASH_VALUE = 2; + // mp4格式 + MP4_VALUE = 3; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/show/gateway/v1/gateway.proto b/src/Models/Models.gRPC/bilibili/app/show/gateway/v1/gateway.proto new file mode 100644 index 0000000000000000000000000000000000000000..d9d98106b423122d92b61ffde250999180a1e233 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/show/gateway/v1/gateway.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package bilibili.app.show.gateway.v1; + +import "bilibili/broadcast/message/main.proto"; + +// +service AppShow { + // 获取Native页进度数据 + rpc GetActProgress (GetActProgressReq) returns (GetActProgressReply); +} + +// 获取Native页进度数据-请求 +message GetActProgressReq { + // Native页id + int64 pageID = 1; + // 用户mid + int64 mid = 2; +} + +// 获取Native页进度数据-响应 +message GetActProgressReply { + // 进度数据 + bilibili.broadcast.message.main.NativePageEvent event = 1; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/show/popular/v1/popular.proto b/src/Models/Models.gRPC/bilibili/app/show/popular/v1/popular.proto new file mode 100644 index 0000000000000000000000000000000000000000..cffe40e655a434c0e99ac0b23d5101a445cdbcca --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/show/popular/v1/popular.proto @@ -0,0 +1,108 @@ +syntax = "proto3"; + +package bilibili.app.show.v1; + +import "bilibili/app/card/v1/card.proto"; +import "bilibili/app/archive/middleware/v1/preload.proto"; + +// 热门 +service Popular { + // 热门列表 + rpc Index (PopularResultReq) returns (PopularReply); +} + +// 热门列表-请求 +message PopularResultReq { + // 排位索引id,为上此请求末尾项的idx + int64 idx = 1; + // 登录标识 + // 1:未登陆用户第一页 2:登陆用户第一页 + int32 loginEvent = 2; + // 清晰度(旧版) + int32 qn = 3; + // 视频流版本(旧版) + int32 fnver = 4; + // 视频流功能(旧版) + int32 fnval = 5; + // 是否强制使用域名(旧版) + int32 forceHost = 6; + // 是否4K(旧版) + int32 fourk = 7; + // 当前页面spm + string spmid = 8; + // 上此请求末尾项的param + string lastParam = 9; + // 上此请求的ver + string ver = 10; + // 分品类热门的入口ID + int64 entranceId = 11; + // 热门定位id集合 + string locationIds = 12; + // 0:tag页 1:中间页 + int32 sourceId = 13; + // 数据埋点上报 + // 0:代表手动刷新 1:代表自动刷新 + int32 flush = 14; + // 视频秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs playerArgs = 15; +} + +// 热门列表-响应 +message PopularReply { + // 卡片列表 + repeated bilibili.app.card.v1.Card items = 1; + // 配置信息 + Config config = 2; + // 版本 + string ver = 3; +} + +// 配置信息 +message Config { + // 标题 + string itemTitle = 1; + // 底部文案 + string bottomText = 2; + // 底部图片url + string bottomTextCover = 3; + // 底部跳转页url + string bottomTextUrl = 4; + // 顶部按钮信息列表 + repeated EntranceShow topItems = 5; + // 头图url + string headImage = 6; + // 当前页按钮信息 + repeated EntranceShow pageItems = 7; + // + int32 hit = 8; +} + +// 按钮信息 +message EntranceShow { + // 按钮图标url + string icon = 1; + // 按钮名 + string title = 2; + // 入口模块id + string moduleId = 3; + // 跳转uri + string uri = 4; + // 气泡信息 + Bubble bubble = 5; + // 入口id + int64 entranceId = 6; + // 头图url + string topPhoto = 7; + // 入口类型 + int32 entranceType = 8; +} + +// 气泡信息 +message Bubble { + // 文案 + string bubbleContent = 1; + // 版本 + int32 version = 2; + // 起始时间 + int64 stime = 3; +} diff --git a/src/Models/Models.gRPC/bilibili/app/show/rank/v1/rank.proto b/src/Models/Models.gRPC/bilibili/app/show/rank/v1/rank.proto new file mode 100644 index 0000000000000000000000000000000000000000..61dd39451be6684af28e85c424adfc74b5801996 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/show/rank/v1/rank.proto @@ -0,0 +1,120 @@ +syntax = "proto3"; + +package bilibili.app.show.v1; + +// 排行榜 +service Rank { + // 全站排行榜 + rpc RankAll (RankAllResultReq) returns (RankListReply); + // 分区排行榜 + rpc RankRegion (RankRegionResultReq) returns (RankListReply); +} + +// 全站排行榜-请求 +message RankAllResultReq { + // 必须为"all" + string order = 1; + // 页码 + // 默认1页 + int32 pn = 2; + // 每页项数 + // 默认100项,最大100 + int32 ps = 3; +} + +// 分区排行榜-请求 +message RankRegionResultReq { + // 一级分区tid(二级分区不可用) + // 0:全站 + int32 rid = 1; + // 页码 + // 默认1页 + int32 pn = 2; + // 每页项数 + // 默认100项,最大100 + int32 ps = 3; +} + +// 排行榜信息-响应 +message RankListReply { + // 排行榜列表 + repeated RankItem items = 1; +} + +// 排行榜列表项 +message RankItem { + // 标题 + string title = 1; + // 封面url + string cover = 2; + // 参数(稿件avid) + string param = 3; + // 跳转uri + string uri = 4; + // 重定向url + string redirectUrl = 5; + // 跳转类型 + // av:视频稿件 + string goto = 6; + // 播放数 + int32 play = 7; + // 弹幕数 + int32 danmaku = 8; + // UP主mid + int64 mid = 9; + // UP主昵称 + string name = 10; + // UP主头像url + string face = 11; + // 评论数 + int32 reply = 12; + // 收藏数 + int32 favourite = 13; + // 发布时间 + int64 pubDate = 14; + // 分区tid + int32 rid = 15; + // 子分区名 + string rname = 16; + // 视频总时长 + int64 duration = 17; + // 点赞数 + int32 like = 18; + // 1P cid + int64 cid = 19; + // 综合评分 + int64 pts = 20; + // 合作视频文案 + string cooperation = 21; + // 属性位 + // 0:未关注 1:已关注 + int32 attribute = 22; + // UP主粉丝数 + int64 follower = 23; + // UP主认证信息 + OfficialVerify officialVerify = 24; + // 同一UP收起子项列表 + repeated RankItem children = 25; + // 关系信息 + Relation relation = 26; +} + +// 认证信息 +message OfficialVerify { + // 认证类型 + // -1:无认证 0:个人认证 1:机构认证 + int32 type = 1; + // 认证描述 + string desc = 2; +} + +// 关系信息 +message Relation { + // 关系状态id + // 1:未关注 2:已关注 3:被关注 4:互相关注 + int32 status = 1; + // 是否关注 + int32 isFollow = 2; + // 是否粉丝 + int32 isFollowed = 3; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/show/region/v1/region.proto b/src/Models/Models.gRPC/bilibili/app/show/region/v1/region.proto new file mode 100644 index 0000000000000000000000000000000000000000..4c6aba5303cfa910398c8e7d55b4b1eebcdfa87a --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/show/region/v1/region.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; + +package bilibili.app.show.region.v1; + +// +service Region { + // + rpc Region (RegionReq) returns (RegionReply); +} + +// +message RegionReq { + // + string lang = 1; +} + +// +message RegionReply { + // + repeated RegionInfo regions = 1; +} + +// +message RegionConfig { + // + string scenesName = 1; + // + string scenesType = 2; +} + +// +message RegionInfo { + // + int32 tid = 1; + // + int32 reid = 2; + // + string name = 3; + // + string logo = 4; + // + string goto = 5; + // + string param = 6; + // + string uri = 7; + // + int32 type = 8; + // + int32 isBangumi = 9; + // + repeated RegionInfo children = 10; + // + repeated RegionConfig config = 11; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/space/v1/space.proto b/src/Models/Models.gRPC/bilibili/app/space/v1/space.proto new file mode 100644 index 0000000000000000000000000000000000000000..173e45d2797c03e9870d5534a52e3a6dc8700efc --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/space/v1/space.proto @@ -0,0 +1,107 @@ +syntax = "proto3"; + +package bilibili.app.space.v1; + +// +service Space { + // + rpc Archive (ArchiveReq) returns (ArchiveReply); +} + +//-请求 +message ArchiveReq { + // + int64 vmid = 1; + // + int32 pn = 2; + // + int32 ps = 3; + // + string order = 4; +} + +//-响应 +message ArchiveReply { + // + repeated BiliSpaceVideo item = 1; + // + int32 count = 2; + // + EpisodicButton episodicButton = 3; + // + repeated OrderConfig order = 4; +} + +// +message Badge { + // + string text = 1; + // + string textColor = 2; + // + string textColorNight = 3; + // + string bgColor = 4; + // + string bgColorNight = 5; + // + string borderColor = 6; + // + string borderColorNight = 7; + // + int32 bgStyle = 8; +} + +// +message BiliSpaceVideo { + // + string title = 1; + // + string tname = 2; + // + int64 duration = 3; + // + string cover = 4; + // + string uri = 5; + // + string param = 6; + // + string danmaku = 7; + // + int32 play = 8; + // + int64 ctime = 9; + // + bool state = 10; + // + bool isPopular = 11; + // + repeated Badge badges = 12; + // + string coverRight = 13; + // + string bvid = 14; + // + bool isSteins = 15; + // + bool isUgcpay = 16; + // + bool isCooperation = 17; +} + +// +message EpisodicButton { + // + string text = 1; + // + string uri = 2; +} + +// +message OrderConfig { + // + string title = 1; + // + string value = 2; +} diff --git a/src/Models/Models.gRPC/bilibili/app/splash/v1/splash.proto b/src/Models/Models.gRPC/bilibili/app/splash/v1/splash.proto new file mode 100644 index 0000000000000000000000000000000000000000..342316af9791f3582ed8b4f7ae04eb271926a396 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/splash/v1/splash.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; + +package bilibili.app.splash.v1; + +import "google/protobuf/any.proto"; + +// +service Splash { + // + rpc List (SplashReq) returns (SplashReply); +} + +//-请求 +message SplashReq { + // + int32 width = 1; + // + int32 height = 2; + // + string birth = 3; + // + string adExtra = 4; + // + string network = 5; +} + +//-响应 +message SplashReply { + // + int32 maxTime = 1; + // + int32 minInterval = 2; + // + int32 pullInterval = 3; + // + repeated SplashItem list = 4; + // + repeated ShowStrategy show = 5; +} + +// +message ShowStrategy { + // + int32 id = 1; + // + int64 stime = 2; + // + int64 etime = 3; +} + +// +message SplashItem { + // + int32 id = 1; + // + int32 type = 2; + // + int32 cardType = 3; + // + int32 duration = 4; + // + int64 beginTime = 5; + // + int64 endTime = 6; + // + string thumb = 7; + // + string hash = 8; + // + string logoUrl = 9; + // + string logoHash = 10; + // + string videoUrl = 11; + // + string videoHash = 12; + // + int32 videoWidth = 13; + // + int32 videoHeight = 14; + // + string schema = 15; + // + string schemaTitle = 16; + // + string schemaPackageName = 17; + // + repeated string schemaCallupWhiteList = 18; + // + int32 skip = 19; + // + string uri = 20; + // + string uriTitle = 21; + // + int32 source = 22; + // + int32 cmMark = 23; + // + string adCb = 24; + // + int64 resourceId = 25; + // + string requestId = 26; + // + string clientIp = 27; + // + bool isAd = 28; + // + bool isAdLoc = 29; + // + google.protobuf.Any extra = 30; + // + int64 cardIndex = 31; + // + int64 serverType = 32; + // + int64 index = 33; + // + string clickUrl = 34; + // + string showUrl = 35; + // + int32 timeTarget = 36; + // + int32 encryption = 37; + // + bool enablePreDownload = 38; + // + bool enableBackgroundDownload = 39; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/app/view/v1/view.proto b/src/Models/Models.gRPC/bilibili/app/view/v1/view.proto new file mode 100644 index 0000000000000000000000000000000000000000..6a217e4984681082878572e055f75840aaa93b84 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/view/v1/view.proto @@ -0,0 +1,1454 @@ +syntax = "proto3"; +package bilibili.app.view.v1; + +import "google/protobuf/any.proto"; +import "bilibili/app/archive/middleware/v1/preload.proto"; +import "bilibili/app/archive/v1/archive.proto"; + +service View { + // 视频页详情页 + rpc View (ViewReq) returns (ViewReply); + // 视频播放过程中的数据 + rpc ViewProgress (ViewProgressReq) returns (ViewProgressReply); + // 短视频下载 + rpc ShortFormVideoDownload (ShortFormVideoDownloadReq) returns (ShortFormVideoDownloadReply); + // 点击播放器卡片事件 + rpc ClickPlayerCard (ClickPlayerCardReq) returns (NoReply); + // 点击大型活动页预约 + rpc ClickActivitySeason (ClickActivitySeasonReq) returns (NoReply); + // 合集详情页 + rpc Season (SeasonReq) returns (SeasonReply); + // 播放器卡片曝光 + rpc ExposePlayerCard (ExposePlayerCardReq) returns (NoReply); + // 点击签订契约 + rpc AddContract (AddContractReq) returns (NoReply); +} + +// 空回复 +message NoReply {} + +// 视频页详情页-请求 +message ViewReq { + // 稿件avid(av/bv任选其一) + int64 aid = 1; + // 稿件bvid(av/bv任选其一) + string bvid = 2; + // 来源 + string from = 3; + // AI trackid + string trackid = 4; + // 广告扩展数据 + string adExtra = 5; + // 清晰度(旧版) + int32 qn = 6; + // 流版本(旧版) + int32 fnver = 7; + // 流类型(旧版) + int32 fnval = 8; + // 是否强制使用域名(旧版) + int32 forceHost = 9; + // 是否允许4K(旧版) + int32 fourk = 10; + // 当前页面spm + string spmid = 11; + // 上一页面spm + string fromSpmid = 12; + // + int32 autoplay = 13; + // 视频秒开参数 + bilibili.app.archive.middleware.v1.PlayerArgs playerArgs = 14; +} + +// 视频页信息-响应 +message ViewReply { + // 稿件信息 + bilibili.app.archive.v1.Arc arc = 1; + // 分P信息 + repeated ViewPage pages = 2; + // UP主扩展信息 ("OnwerExt"为源码中拼写错误) + OnwerExt ownerExt = 3; + // 稿件用户操作状态 + ReqUser reqUser = 4; + // 稿件TAG + repeated Tag tag = 5; + // TAG对应的图标 + map tIcon = 6; + // 稿件映射的PGC剧集信息 + Season season = 7; + // 充电排行 + ElecRank elecRank = 8; + // 历史观看进度 + History history = 9; + // 视频相关推荐列表 + repeated Relate relates = 10; + // 不感兴趣原因 + Dislike dislike = 11; + // 播放图标动画配置档 + PlayerIcon playerIcon = 12; + // + string vipActive = 13; + // 稿件bvid + string bvid = 14; + // 获得荣誉信息 + Honor honor = 15; + // 相关推荐顶部tab + repeated RelateTab relateTab = 16; + // 参与的活动页面url + string activityUrl = 17; + // 稿件引用bgm列表 + repeated Bgm bgm = 18; + // 联合投稿成员列表 + repeated Staff staff = 19; + // 争议信息 + string argueMsg = 20; + // 短链接 + string shortLink = 21; + // 播放实验 + // 1:相关推荐自动播放 + int32 playParam = 22; + // 标签 + Label label = 23; + // UGC视频合集信息 + UgcSeason ugcSeason = 24; + // 配置信息 + Config config = 25; + // 分享副标题(已观看xxx次) + string shareSubtitle = 26; + // 互动视频信息 + Interaction interaction = 27; + // 错误码 + // DEFAULT:正常 CODE404:视频被UP主删除 + ECode ecode = 28; + // 404页信息 + CustomConfig customConfig = 29; + // 广告 + repeated CM cms = 30; + // 广告配置 + CMConfig cmConfig = 31; + // 播放页定制tab + Tab tab = 32; + // 排行榜 + Rank rank = 33; + // 免流面板定制 + TFPanelCustomized tfPanelCustomized = 34; + // UP主发起活动 + UpAct upAct = 35; + // 用户装扮 + UserGarb userGarb = 36; + // 大型活动合集 + ActivitySeason activitySeason = 37; + // 评论样式 + string badge_url = 38; + // 直播预约信息 + LiveOrderInfo live_order_info = 39; + // 稿件简介v2 + repeated DescV2 desc_v2 = 40; +} + +// 直播预约信息 +message LiveOrderInfo { + // 预约id + int64 sid = 1; + // 预约条文案 + string text = 2; + // 直播开始时间 + int64 live_plan_start_time = 3; + // 是否预约 + bool is_follow = 4; +} + +// 大型活动合集 +message ActivitySeason { + // 稿件信息 + bilibili.app.archive.v1.Arc arc = 1; + // 分P信息 + repeated ViewPage pages = 2; + //("OnwerExt"为源码中拼写错误) + OnwerExt ownerExt = 3; + // 稿件用户操作状态 + ReqUser reqUser = 4; + // 充电排行 + ElecRank elecRank = 5; + // 历史观看进度 + History history = 6; + // 稿件bvid + string bvid = 7; + // 获得荣誉信息 + Honor honor = 8; + // 联合投稿成员列表 + repeated Staff staff = 9; + // UGC视频合集信息 + UgcSeason ugcSeason = 10; + // 播放页定制tab + Tab tab = 11; + // 排行榜 + Rank rank = 12; + // 预约模块 + Order order = 13; + // 是否支持点踩 + bool supportDislike = 14; + // 相关推荐(运营配置+AI推荐) + OperationRelate operationRelate = 15; + // 活动页资源包 + ActivityResource activityResource = 16; + // 短链接 + string shortLink = 17; + // 标签 + Label label = 18; + // 不感兴趣原因 + Dislike dislike = 19; + // 播放图标动画配置档 + PlayerIcon playerIcon = 20; + // 分享副标题(已观看xxx次) + string shareSubtitle = 21; + // 广告配置 + CMConfig cmConfig = 22; + // 免流面板定制 + TFPanelCustomized tfPanelCustomized = 23; + // 争议信息 + string argueMsg = 24; + // 错误码 + // DEFAULT:正常 CODE404:视频被UP主删除 + ECode ecode = 25; + // 404页信息 + CustomConfig customConfig = 26; + // 评论样式 + string badge_url = 27; + // 稿件简介v2 + repeated DescV2 desc_v2 = 28; +} + +// 特殊稿件简介 +message DescV2 { + // 文本内容 + string text = 1; + // 文本类型 + DescType type = 2; + // 点击跳转链接 + string uri = 3; + // 资源ID + int64 rid = 4; +} + +// 枚举-文本类型 +enum DescType { + // 占位 + DescTypeUnknown = 0; + // 文本 + DescTypeText = 1; + // @ + DescTypeAt = 2; +} + +// 活动页资源包 +message ActivityResource { + // mod资源池名称 + string modPoolName = 1; + // mod资源名称 + string modResourceName = 2; + // 背景色 + string bgColor = 3; + // 选中背景色 + string selectedBgColor = 4; + // 文字颜色 + string textColor = 5; + // 浅字色 + string lightTextColor = 6; + // 深字色 + string darkTextColor = 7; + // 分割线色 + string dividerColor = 8; +} + +// 相关推荐(运营配置+AI推荐) +message OperationRelate { + // 模块标题 + string title = 1; + // 相关推荐模块内容 + repeated RelateItem relateItem = 2; + // AI相关推荐 + repeated Relate ai_relate_item = 3; +} + +// 相关推荐内容 +message RelateItem { + // 跳链 + string url = 1; + // 封面 + string cover = 2; +} + +// 预约模块 +message Order { + // 用户操作态 + bool status = 1; + // 模块标题 + string title = 2; + // 按钮文字 未操作 + string buttonTitle = 3; + // 按钮文字 已操作 + string buttonSelectedTitle = 4; + // 合集播放数 + int64 seasonStatView = 5; + // 合集弹幕数 + int64 seasonStatDanmaku = 6; + // 预约类型(点击时透传,直播开始前预约活动,直播开始后收藏合集) + BizType orderType = 7; + // 预约业务参数 + oneof orderParamCase { + // 预约活动参数 + BizReserveActivityParam bizReserveActivityParam = 8; + // 收藏合集参数 + BizFavSeasonParam bizFavSeasonParam = 9; + } + // 合集简介 + string intro = 10; +} + +// 业务类型 +enum BizType { + BizTypeNone = 0; + // 追番追剧 + BizTypeFollowVideo = 1; + // 预约活动 + BizTypeReserveActivity = 2; + // 跳转链接 + BizTypeJumpLink = 3; + // 收藏合集 + BizTypeFavSeason = 4; + // 预约游戏 + BizTypeReserveGame = 5; +} + +// 用户装扮信息 +message UserGarb { + // 点赞动画url + string urlImageAniCut = 1; +} + +// 排行榜 +message Rank { + // 排行榜icon + string icon = 1; + // 排行榜icon 夜间模式 + string iconNight = 2; + // 排行榜文案 + string text = 3; +} + +// TAB +message Tab { + // 背景图片 + string background = 1; + // 跳转类型 + TabOtype otype = 2; + // 类型id + int64 oid = 3; + // 跳转url + string uri = 4; + // 样式 + TabStyle style = 5; + // 文字 + string text = 6; + // 未选中态字色 + string textColor = 7; + // 选中态字色 + string textColorSelected = 8; + // 图片 + string pic = 9; + // 后台配置自增 + int64 id = 10; +} + +// TAB样式 +enum TabStyle { + // 未知样式 + UnknownStyle = 0; + // 文字样式 + Text = 1; + // 图片样式 + Pic = 2; +} + +// TAB跳转类型 +enum TabOtype { + // 未知类型 + UnknownOtype = 0; + // url链接 + URL = 1; + // native话题活动 + TopicNA = 2; +} + +// 错误代码 +enum ECode { + //正常 + DEFAULT = 0; + // 稿件被UP主删除 + CODE404 = 1; +} + +// 分P信息 +message ViewPage { + // 分P基本信息 + bilibili.app.archive.v1.Page page = 1; + // 分P对应的音频稿件 + Audio audio = 2; + // 分P弹幕信息 + DM dm =3; + // 下载文案 + string downloadTitle = 4; + // 分P完整标题(视频标题+分P标题) + string downloadSubtitle = 5; +} + +// 音频稿件信息 +message Audio { + // 音频标题 + string title = 1; + // 音频封面url + string coverUrl = 2; + // 音频auid + int64 songId = 3; + // 音频播放量 + int64 playCount = 4; + // 音频评论数 + int64 replyCount = 5; + // 音频作者UID + int64 upperId = 6; + // 进入按钮文案 + string entrance = 7; + // + int64 songAttr = 8; +} + +// 分P弹幕信息 +message DM { + // 分P是否关闭弹幕 + // 0:正常 1:关闭 + bool closed = 1; + // + bool realName = 2; + // 分P弹幕总数 + int64 count = 3; +} + +// UP主扩展信息 ("OnwerExt"为源码中拼写错误) +message OnwerExt { + // 认证信息 + OfficialVerify officialVerify = 1; + // 直播信息 + Live live = 2; + // 会员信息 + Vip vip = 3; + // + repeated int64 assists = 4; + // 粉丝数 + int64 fans = 5; + // 总投稿数 + string arcCount = 6; +} + +// 认证信息 +message OfficialVerify { + // 认证类型 + // 0:个人认证 1:官方认证 + int32 type = 1; + //认证名称 + string desc = 2; +} + +// 直播信息 +message Live { + // 主播UID + int64 mid = 1; + // 直播间id + int64 roomid = 2; + // 直播间url + string uri = 3; + // + string endpageUri = 4; +} + +// 会员信息 +message Vip { + //会员类型 + int32 type = 1; + //到期时间 + int64 dueDate = 2; + // + string dueRemark = 3; + // + int32 accessStatus = 4; + //会员状态 + int32 vipStatus = 5; + // + string vipStatusWarn = 6; + // + int32 themeType = 7; + // + VipLabel label = 8; +} + +// 会员类型标签 +message VipLabel { + // + string path = 1; + // + string text = 2; + // + string label_theme = 3; +} + +// 用户操作状态 +message ReqUser { + // 用户是否关注UP + int32 attention = 1; + // UP是否关注用户 + int32 guestAttention = 2; + // 是否收藏 + int32 favorite = 3; + // 是否点赞 + int32 like = 4; + // 是否点踩 + int32 dislike = 5; + // 是否投币 + int32 coin = 6; + // 关注等级 + int32 attentionLevel = 7; + // 是否收藏合集 + int32 favSeason = 8; +} + +// TAG信息 +message Tag { + // TAD id + int64 id = 1; + // TAG名 + string name = 2; + // + int64 likes = 3; + // + int64 hates = 4; + // + int32 liked = 5; + // + int32 hated = 6; + // TAG页面uri + string uri = 7; + // TAG类型 + // common:普通 new:话题 act:活动 + string tagType = 8; +} + +// TAG图标信息 +message TIcon { + // TAG图标url + string icon = 1; +} + +// 剧集信息 +message Season { + // + string allowDownload = 1; + // 剧集ssid + int64 seasonId = 2; + // 是否重定向跳转 + int32 isJump = 3; + // 剧集标题 + string title = 4; + // 剧集封面url + string cover = 5; + // 剧集是否完结 + int32 isFinish = 6; + // 最新一话epid + int64 newestEpId = 7; + // 最新一话标题 + string newestEpIndex = 8; + // 总集数 + int64 totalCount = 9; + // 更新星期日 + int32 weekday = 10; + // 用户追番标志 + UserSeason userSeason = 11; + // + SeasonPlayer player = 12; + // 单集页面url + string ogv_playurl = 13; +} + +// 用户追番标志 +message UserSeason { + // 关注状态 + // 0:未关注 1:已关注 + string attention = 1; +} + +// +message SeasonPlayer{ + // + int64 aid = 1; + // + string vid = 2; + // + int64 cid = 3; + // + string from = 4; +} + +// 充电排行信息 +message ElecRank { + // 充电排行列表 + repeated ElecRankItem list = 1; + // 充电用户数 + int64 count = 2; +} + +// 充电用户信息 +message ElecRankItem { + // 用户头像url + string avatar = 1; + // 用户昵称 + string nickname = 2; + // 充电留言 + string message = 3; + // 用户mid + int64 mid = 4; +} + +// 稿件观看进度 +message History { + // 播放进度分P cid + int64 cid = 1; + // 播放进度时间 + // 0:未观看 -1:已看完 正整数:播放时间进度 + int64 progress = 2; +} + +//相关推荐项 +message Relate { + // + int64 aid = 1; + // 封面url + string pic = 2; + // 标题 + string title = 3; + // UP主信息 + bilibili.app.archive.v1.Author author = 4; + // 稿件状态数 + bilibili.app.archive.v1.Stat stat = 5; + // 时长 + int64 duration = 6; + // 跳转类型 + // special:pgc视频 av:稿件视频 cm:广告 game:游戏 + string goto = 7; + // 参数(如av号等) + string param = 8; + // 跳转uri + string uri = 9; + // + string jumpUrl = 10; + // 评分 + double rating = 11; + // + string reserve = 12; + // 来源标识 + // operation:管理员添加 + string from = 13; + // 备注 + string desc = 14; + // + string rcmdReason = 15; + // 标志文字 + string badge = 16; + // 1P cid + int64 cid = 17; + // + int32 seasonType = 18; + // + int32 ratingCount = 19; + // 标签文案 + string tagName = 20; + // 游戏礼包信息 + PackInfo packInfo = 21; + // + Notice notice = 22; + // 按钮信息 + Button button = 23; + // spm追踪id + string trackid = 24; + // 游戏卡片新样式 + int32 newCard = 25; + // 推荐理由样式 + ReasonStyle rcmdReasonStyle = 26; + // + string coverGif = 27; + // 广告 + CM cm = 28; + // 游戏卡字段 + // 0:下载 1:预约(跳过详情) 2:预约 3:测试 4:测试+预约 5:跳过详情页 + int64 reserveStatus = 29; +} + +// 推荐理由样式 +message ReasonStyle { + // + string text = 1; + // 日间模式文字 + string textColor = 2; + // + string bgColor = 3; + // + string borderColor = 4; + // 夜间模式文字 + string textColorNight = 5; + // + string bgColorNight = 6; + // + string borderColorNight = 7; + // 1:填充 2:描边 3:填充 + 描边 4:背景不填充 + 背景不描边 + int32 bgStyle = 8; + // + int32 selected = 9; +} + +//游戏礼包信息 +message PackInfo { + // 礼包标题 + string title = 1; + // 礼包页uri + string uri = 2; +} + +// +message Notice { + // + string title = 1; + // + string desc = 2; +} + +// +message Button { + // 按钮文案 + string title = 1; + // 跳转uri + string uri = 2; +} + +// 不喜欢原因 +message Dislike { + // 标题 + string title = 1; + // + string subtitle = 2; + // 原因项列表 + repeated DislikeReasons reasons = 3; +} + +// 不喜欢原因项 +message DislikeReasons { + // 类型 + // 1:全部类型 3:TAG 4:UP主 + int64 id = 1; + // 相关UP主mid + int64 mid = 2; + // 相关分区tid + int32 rid = 3; + // 相关TAG id + int64 tagId = 4; + // 相关名称 + string name = 5; +} + +// 进度条动画配置 +message PlayerIcon { + // 拖动动画配置档url + string url1 = 1; + // 拖动动画配置档hash + string hash1 = 2; + // 松手动画配置档url + string url2 = 3; + // 松手动画配置档hash + string hash2 = 4; +} + +// 广告 +message CM { + // 广告数据(需要二次解包) + google.protobuf.Any sourceContent = 1; +} + +// +message AdInfo { + // + int64 creative_id = 1; + // + int64 creative_type = 2; + // + CreativeContent creative_content = 3; + // + string ad_cb = 4; + // + int32 card_type = 5; + // + bytes Extra = 6; +} + +// +message CreativeContent { + // + string title = 1; + // + string description = 2; + // + string button_title = 3; + // + int64 video_id = 4; + // + string username = 5; + // + string image_url = 6; + // + string image_md5 = 7; + // + string log_url = 8; + // + string log_md5 = 9; + // + string url = 10; + // + string click_url = 11; + // + string show_url = 12; +} + +// 广告配置 +message CMConfig { + // 广告配置数据(需要二次解包) + google.protobuf.Any adsControl = 1; +} + +// +message Asset { + // + int32 paid = 1; + // + int64 price = 2; + // + AssetMsg msg = 3; + // + AssetMsg preview_msg = 4; +} + +// +message AssetMsg { + // + string desc1 = 1; + // + string desc2 = 2; +} + +// 视频引用的bgm音频 +message Bgm { + // 音频auid + int64 sid = 1; + // 音频作者mid + int64 mid = 2; + // 音频标题 + string title = 3; + // 音频作者昵称 + string author = 4; + // bgm页面url + string jumpUrl = 5; + // 音频封面url + string cover = 6; +} + +// 合作成员信息 +message Staff { + // 成员mid + int64 mid = 1; + // 成员角色 + string title = 2; + // 成员头像url + string face = 3; + // 成员昵称 + string name = 4; + // 成员官方信息 + OfficialVerify officialVerify = 5; + // 成员会员信息 + Vip vip = 6; + // 是否关注该成员 + int32 attention = 7; + // + int32 labelStyle = 8; +} + +// +message Label { + // + int32 type = 1; + // + string uri = 2; +} + +// +enum SeasonType { + // + Unknown = 0; + // + Base = 1; + // + Good = 2; +} + +// UGC视频合集信息 +message UgcSeason { + // 合集id + int64 id = 1; + // 合集标题 + string title = 2; + // 合集封面url + string cover = 3; + // 合集简介 + string intro = 4; + // 小节列表 + repeated Section sections = 5; + // 合集状态数 + UgcSeasonStat stat = 6; + // + string labelText = 7; + // + string labelTextColor = 8; + // + string labelBgColor = 9; + // + string labelBgNightColor = 11; + // + string labelTextNightColor = 10; + // 按钮文案 + string descRight = 12; + // 分集总数 + int64 epCount = 13; +} + +//ugc视频合集状态数 +message UgcSeasonStat { + // 合集id + int64 seasonId = 1; + // 观看数 + int32 view = 2; + // 弹幕数 + int32 danmaku = 3; + // 评论数 + int32 reply = 4; + // 收藏数 + int32 fav = 5; + // 投币数 + int32 coin = 6; + // 分享数 + int32 share = 7; + // 当前排名 + int32 nowRank = 8; + // 历史最高排名 + int32 hisRank = 9; + // 总计点赞 + int32 like = 10; +} + +// 视频合集小节信息 +message Section { + // 小节id + int64 id = 1; + // 小节标题 + string title = 2; + // 小节类型 + // 0:其他 1:正片 + int64 type = 3; + // 单话列表 + repeated Episode episodes = 4; +} + +//视频合集单话信息 +message Episode { + // 合集单话id + int64 id = 1; + // 稿件avid + int64 aid = 2; + // 视频1P cid + int64 cid = 3; + // 稿件标题 + string title = 4; + // 稿件封面url + string cover = 5; + // 投稿时间显示文案 + string coverRightText = 6; + // 视频分P信息 + bilibili.app.archive.v1.Page page = 7; + // 视频状态数 + bilibili.app.archive.v1.Stat stat = 8; + // 稿件bvid + string bvid = 9; + // 稿件UP主信息 + bilibili.app.archive.v1.Author author = 10; +} + +// +message Config { + // 下方推荐项标题 + string relatesTitle = 1; + // + int32 relatesStyle = 2; + // + int32 relateGifExp = 3; + // + int32 endPageHalf = 4; + // + int32 endPageFull = 5; + // 退出是否自动小窗 + bool autoSwindow = 6; +} + +// +message Interaction { + // + Node historyNode = 1; + // + int64 graphVersion = 2; + // + string msg = 3; + // + string evaluation = 4; + // + int64 mark = 5; +} + +// 稿件获得荣誉信息 +message Honor { + // 荣誉栏图标url + string icon = 1; + // 荣誉栏图标url 夜间模式 + string iconNight = 2; + // 荣誉文案 + string text = 3; + // 荣誉副文案 + string textExtra = 4; + // 标题颜色 + string textColor = 5; + // 标题颜色 夜间模式 + string textColorNight = 6; + // 背景颜色 + string bgColor = 7; + // 背景颜色 夜间模式 + string bgColorNight = 8; + // 跳转uri + string url = 9; + // 跳转角标文案 + string urlText = 10; +} + +// +message RelateTab { + // + string id = 1; + // + string title = 2; +} + +// +message UpAct { + // + int64 sid = 1; + // + int64 mid = 2; + // + string title = 3; + // + string statement = 4; + // + string image = 5; + // + string url = 6; + // + string button = 7; +} + +// +message Node { + // + int64 nodeId = 1; + // + string title = 2; + // + int64 cid = 3; +} + +// 稿件播放中数据-请求 +message ViewProgressReq{ + // 稿件avid + int64 aid = 1; + // 视频cid + int64 cid = 2; + // UP主mid + int64 upMid = 3; +} + +// 稿件播放中数据-回复 +message ViewProgressReply{ + // 视频引导信息 + VideoGuide videoGuide = 1; + // Chronos灰度管理 + Chronos chronos = 2; +} + +// Chronos灰度管理 +message Chronos { + // 资源包md5 + string md5 = 1; + // 资源包 + string file = 2; +} + +// 视频引导信息 +message VideoGuide{ + // 关注按钮卡片 + repeated Attention attention = 1; + // 互动弹幕 + repeated CommandDm commandDms = 2; + // 运营卡片 + repeated OperationCard operationCard = 3; + // 运营卡片新版 + repeated OperationCardNew operationCardNew = 4; + // 契约卡 + ContractCard contractCard = 5; +} + +// 契约卡 +message ContractCard { + // 需要触发的播放进度百分比 + float displayProgress = 1; + // 触发位置的前后误差(单位ms) + int64 displayAccuracy = 2; + // 展示持续时间(单位ms) + int64 displayDuration = 3; + // 弹出模式 + // 0: 原有模式 1: 半屏弹出 2: 全屏、半屏均弹出 + int32 show_mode = 4; + // 提示页面 + // 0: 原有页面 1: 6.23版本新页面 + int32 page_type = 5; + // UP主信息 + UpperInfos upper = 6; +} + +// UP主信息 +message UpperInfos { + // 粉丝数 + int64 fans_count = 1; + // 近半年投稿数 + int64 arc_count_last_half_year = 2; + // 成为UP主时间 + int64 first_up_dates = 3; + // 总播放量 + int64 total_play_count = 4; +} + +//内嵌操作按钮卡片 +message OperationCardNew { + // 卡片id + int64 id = 1; + // 开始时间 + int32 from = 2; + // 结束时间 + int32 to = 3; + // 用户操作态 + // true已操作 false未操作 + bool status = 4; + // 卡片类型 + OperationCardType cardType = 5; + // 卡片渲染 + oneof renderCase { + // 标准卡 + StandardCard standardCard= 6; + // 老运营卡片(原B剪跳转卡) + OperationCard operationCard = 7; + } + // + BizType bizType = 8; + // + oneof paramCase { + // 追番追剧参数 + BizFollowVideoParam FollowVideoParam = 9; + // 预约活动参数 + BizReserveActivityParam ReserveActivityParam = 10; + // 跳转参数 + BizJumpLinkParam LinkParam = 11; + // 预约游戏参数 + BizReserveGameParam game = 12; + } +} + +// 卡片样式 +enum OperationCardType { + // + CardTypeNone = 0; + // 标准卡 + CardTypeStandard = 1; + // 原跳转卡 + CardTypeSkip = 2; +} + +// 标准卡 +message StandardCard{ + // 卡片文案 + string title = 1; + // 按钮文字 未操作 + string buttonTitle = 2; + // 按钮文字 已操作 + string buttonSelectedTitle = 3; + // 已操作态是否显示 + bool showSelected = 4; +} + +// 老运营卡片 +message OperationCard{ + // 开始时间(单位为秒) + int32 startTime = 1; + // 结束时间(单位为秒) + int32 endTime = 2; + // 图标 + string icon = 3; + // 标题 + string title = 4; + // 按钮文案 + string buttonText = 5; + // 跳转链接 + string url = 6; + // 内容描述 + string content = 7; +} + +// 互动弹幕条目信息 +message CommandDm{ + // 弹幕id + int64 id = 1; + // 对象视频cid + int64 oid = 2; + // 发送者mid + string mid = 3; + // 互动弹幕指令 + string command = 4; + // 互动弹幕正文 + string content = 5; + // 出现时间 + int32 progress = 6; + // 创建时间 + string ctime = 7; + // 发布时间 + string mtime = 8; + // 扩展json数据 + string extra = 9; + // 弹幕id str类型 + string idStr = 10; +} + +// 关注按钮卡片 +message Attention { + // 开始时间 + int32 startTime = 1; + // 结束时间 + int32 endTime = 2; + // 位置x坐标 + double posX = 3; + // 位置y坐标 + double posY = 4; +} + +// 404页信息 +message CustomConfig { + // 重定向页面url + string redirectUrl = 1; +} + +// 免流面板定制 +message TFPanelCustomized { + // 右侧按钮素材 + string rightBtnImg = 1; + // 右侧按钮文案 + string rightBtnText = 2; + // 右侧按钮字体颜色 + string rightBtnTextColor = 3; + // 右侧按钮跳转链接 + string rightBtnLink = 4; + // 中心主文案内容 + string mainLabel = 5; + // 运营商(cm ct cu) + string operator = 6; + // 子面板定制化配置 + map entry = 7; +} + +// 免流子面板定制化配置 +message subTFPanel { + // 右侧按钮素材 + string rightBtnImg = 1; + // 右侧按钮文案 + string rightBtnText = 2; + // 右侧按钮字体颜色 + string rightBtnTextColor = 3; + // 右侧按钮跳转链接 + string rightBtnLink = 4; + // 中心主文案内容 + string mainLabel = 5; + // 运营商 + string operator = 6; +} + +// 短视频下载-请求 +message ShortFormVideoDownloadReq{ + // 稿件avid + int64 aid = 1; + // 视频cid + int64 cid = 2; + // 用户mid + int64 mid = 3; + // 设备buvid + string buvid = 4; + // 移动端包类型 + string mobiApp = 5; + // 移动端版本号 + int64 build = 6; + // 运行设备 + string device = 7; + // 平台 + string platform = 8; + // 当前页面spm + string spmid = 9; +} + +// 短视频下载-响应 +message ShortFormVideoDownloadReply { + // 是否有下载分享按钮 + bool hasDownloadUrl = 1; + // 下载url + string downloadUrl = 2; + // 文件md5 + string md5 = 3; + // 文件大小(单位为Byte) + int64 size = 4; +} + +// 点击播放器卡片-请求 +message ClickPlayerCardReq { + // 卡片id + int64 id = 1; + // 稿件avid + int64 aid = 2; + // 视频cid + int64 cid = 3; + //操作 + //0:操作 1:取消操作 + int64 action = 4; + // 当前页面spm + string spmid = 5; +} + +// 点击大型活动页预约-请求 +message ClickActivitySeasonReq { + // 预约类型 + BizType orderType = 1; + // 当前页面spm + string spmid = 2; + // 业务参数 + oneof orderParamCase { + // 预约活动参数 + BizReserveActivityParam bizReserveActivityParam = 3; + // 收藏合集参数 + BizFavSeasonParam bizFavSeasonParam = 4; + } + // 操作 + //0:操作 1:取消操作 + int64 action = 5; +} + +// +message BizFollowVideoParam { + // + int64 seasonId = 1; +} + +// 预约活动参数 +message BizReserveActivityParam{ + // 活动id + int64 activityId = 1; + // 场景 + string from = 2; + // 类型 + string type = 3; + // 资源id + int64 oid = 4; +} + +// +message BizJumpLinkParam { + // 链接 + string url = 1; +} + +message BizReserveGameParam { + // 游戏id + int64 game_id = 1; +} + +// 收藏合集参数 +message BizFavSeasonParam { + // 合集id + int64 seasonId = 1; +} + +// 合集详情页-请求 +message SeasonReq { + // 合集id + int64 seasonId = 1; +} + +// 合集详情页-响应 +message SeasonReply { + // 合集信息 + UgcSeason season = 1; +} + +// 播放器卡片曝光-请求 +message ExposePlayerCardReq { + // 卡片类型 + PlayerCardType cardType = 1; + // 稿件avid + int64 aid = 2; + // 视频cid + int64 cid = 3; + // 当前页面spm + string spmid = 4; +} + +// 卡片类型 +enum PlayerCardType { + // + PlayerCardTypeNone_VALUE = 0; + // 关注卡 + PlayerCardTypeAttention_VALUE = 1; + // 运营卡 + PlayerCardTypeOperation_VALUE = 2; + // 契约卡 + PlayerCardTypeContract_VALUE = 3; +} + +// 点击签订契约-请求 +message AddContractReq { + // 稿件avid + int64 aid = 1; + // UP主mid + int64 upMid = 2; + // 当前页面spm + string spmid = 3; +} diff --git a/src/Models/Models.gRPC/bilibili/app/wall/v1/wall.proto b/src/Models/Models.gRPC/bilibili/app/wall/v1/wall.proto new file mode 100644 index 0000000000000000000000000000000000000000..23e158f02161b95b8a01f7a2ae91fa66258dcb39 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/app/wall/v1/wall.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package bilibili.app.wall.v1; + +// 免流规则 +service Wall { + // 获取免流规则信息 + rpc RuleInfo (RuleRequest) returns (RulesReply); +} + +// 获取免流规则信息-请求 +message RuleRequest {} + +// 获取免流规则信息-响应 +message RulesReply { + // 各ISP的免流规则信息组 + // ISP如: cu ct cm + map rulesInfo = 1; +} + +// 免流规则信息 +message RuleInfo { + // 是否支持免流 + bool tf = 1; + // 操作模式 + // break:无 replace:替换 proxy:代理 + string m = 2; + // 操作参数 + string a = 3; + // 匹配目标正则 + string p = 4; +} + +// 免流规则信息组 +message RulesInfo { + // 免流规则信息 + repeated RuleInfo rulesInfo = 1; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/broadcast/message/main.proto b/src/Models/Models.gRPC/bilibili/broadcast/message/main.proto new file mode 100644 index 0000000000000000000000000000000000000000..588a34a428d47e2dcf0a12b66b33e70e5c595da4 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/broadcast/message/main.proto @@ -0,0 +1,189 @@ +syntax = "proto3"; + +package bilibili.broadcast.message.main; + +import "google/protobuf/empty.proto"; + +// +service NativePage { + // + // + rpc watchNotify (google.protobuf.Empty) returns (NativePageEvent); +} + +// +service Resource { + // + // + rpc topActivity (google.protobuf.Empty) returns (TopActivityReply); +} +// +message NativePageEvent { + // + int64 pageID = 1; + + // + repeated EventItem items = 2; +} + +// +message TopActivityReply { + // + TopOnline online = 1; + + // + string hash = 2; +} + +// +message Animate { + // + string icon = 1; + + // + string json = 2; + + // + string svg = 3; + + // + int32 loop = 4; +} + +// +message CommandDm { + // + int64 id = 1; + + // + int64 oid = 2; + + // + int64 mid = 3; + + // + int32 type = 4; + + // + string command = 5; + + // + string content = 6; + + // + int32 state = 7; + + // + int32 progress = 8; + + // + string ctime = 9; + + // + string mtime = 10; + + // + string extra = 11; + + // + string idStr = 12; +} + +// +message DanmakuElem { + // + int64 id = 1; + + // + int32 progress = 2; + + // + int32 mode = 3; + + // + int32 fontsize = 4; + + // + uint32 color = 5; + + // + string midHash = 6; + + // + string content = 7; + + // + int64 ctime = 8; + + // + string action = 9; + + // + int32 pool = 10; + + // + string idStr = 11; +} + +// +message DanmukuEvent { + // + DanmakuElem elems = 1; +} + +// +message EventItem { + // + int64 itemID = 1; + + // + string type = 2; + + // + int64 num = 3; + + // + string displayNum = 4; + + // + string webKey = 5; + + // + int64 dimension = 6; +} + +// +message RedDot { + // + int32 type = 1; + + // + int32 number = 2; +} + +// +message TopOnline { + // + int32 type = 1; + + // + string icon = 2; + + // + string uri = 3; + + // + string uniqueId = 4; + + // + Animate animate = 5; + + // + RedDot redDot = 6; + + // + string name = 7; + + // + int64 interval = 8; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/cheese/gateway/player/v1.proto b/src/Models/Models.gRPC/bilibili/cheese/gateway/player/v1.proto new file mode 100644 index 0000000000000000000000000000000000000000..a1c4cedabfb547cb6ad544e27810119780133e20 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/cheese/gateway/player/v1.proto @@ -0,0 +1,163 @@ +syntax = "proto3"; + +package bilibili.cheese.gateway.player.v1; + +import "bilibili/app/playurl/v1/playurl.proto"; + +service PlayURL { + //课程播放url接口 + //https://app.bilibili.com/bilibili.cheese.gateway.player.v1.PlayURL/PlayView + rpc PlayView (playViewReq) returns (PlayViewReply); +} + +//获取播放url-请求 +message playViewReq { + //目标课程epid + int64 epid = 1; + + //目标视频cid + int64 cid = 2; + + //清晰度 + int64 qn = 3; + + //视频流版本 + int32 fnver = 4; + + //视频流功能 + int32 fnval = 5; + + //下载模式 + //0:播放 1:flv下载 2:dash下载 + uint32 download = 6; + + //流url强制是用域名 + //0:允许使用ip 1:使用http 2:使用https + int32 forceHost = 7; + + //允许4K + bool fourk = 8; + + // + string spmid = 9; + + // + string fromSpmid = 10; + + //青少年模式 + int32 teenagersMode = 11; + + //编码类型 + CodeType codetype = 12; + + //是否强制请求预览视频 + bool isPreview = 13; +} + +//获取播放url-回复 +message PlayViewReply { + //视频信息 + bilibili.app.playurl.v1.VideoInfo info = 1; + + //播放界面配置 + PlayAbilityConf PlayConf = 2; +} + +//编码类型 +enum CodeType { + //默认 + NOCODE = 0; + + //H.264 + CODE264 = 1; + + //H.265 + CODE265 = 2; +} + +//禁用功能配置 +message PlayAbilityConf { + //后台播放 + bool backgroundPlayDisable=1; + + //镜像反转 + bool flipDisable=2; + + //投屏 + bool castDisable=3; + + //反馈 + bool feedbackDisable=4; + + //字幕 + bool subtitleDisable=5; + + //播放速度 + bool playbackRateDisable=6; + + //定时停止 + bool timeUpDisable=7; + + //播放方式 + bool playbackModeDisable=8; + + //画面尺寸 + bool scaleModeDisable=9; + + //赞 + bool likeDisable=10; + + //踩 + bool dislikeDisable=11; + + //投币 + bool coinDisable=12; + + //充电 + bool elecDisable=13; + + //分享 + bool shareDisable=14; + + //截图 + bool screenShotDisable=15; + + //锁定 + bool lockScreenDisable=16; + + //相关推荐 + bool recommendDisable=17; + + //播放速度 + bool playbackSpeedDisable=18; + + //清晰度 + bool definitionDisable=19; + + //选集 + bool selectionsDisable=20; + + //下一集 + bool nextDisable=21; + + //编辑弹幕 + bool editDmDisable=22; + + //小窗 + bool smallWindowDisable=23; + + //震动 + bool shakeDisable=24; + + // + bool outerDmDisable=25; + + // + bool innerDmDisable=26; + + // + bool freyaEnterDisable=27; + + //杜比音效 + bool dolbyDisable=28; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/community/service/dm/v1.proto b/src/Models/Models.gRPC/bilibili/community/service/dm/v1.proto new file mode 100644 index 0000000000000000000000000000000000000000..a3cf44578276f44273c63ed352e43032d060fbea --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/community/service/dm/v1.proto @@ -0,0 +1,546 @@ +syntax = "proto3"; + +package bilibili.community.service.dm.v1; + +//弹幕 +service DM { + //修改弹幕配置 + //https://app.bilibili.com/bilibili.community.service.dm.v1.DM/DmPlayerConfig + rpc DmPlayerConfig (DmPlayerConfigReq) returns (Response); + + //获取分段弹幕 + // + rpc DmSegMobile (DmSegMobileReq) returns (DmSegMobileReply); + + //获取弹幕元数据 + //https://app.bilibili.com/bilibili.community.service.dm.v1.DM/DmView + rpc DmView (DmViewReq) returns (DmViewReply); +} + +//修改弹幕配置-请求 +message DmPlayerConfigReq{ + // + int64 ts = 1; + + // + PlayerDanmakuSwitch switch = 2; + + // + PlayerDanmakuSwitchSave switchSave = 3; + + // + PlayerDanmakuUseDefaultConfig useDefaultConfig = 4; + + // + PlayerDanmakuAiRecommendedSwitch aiRecommendedSwitch = 5; + + // + PlayerDanmakuAiRecommendedLevel aiRecommendedLevel = 6; + + // + PlayerDanmakuBlocktop blocktop = 7; + + // + PlayerDanmakuBlockscroll blockscroll = 8; + + // + PlayerDanmakuBlockbottom blockbottom = 9; + + // + PlayerDanmakuBlockcolorful blockcolorful = 10; + + // + PlayerDanmakuBlockrepeat blockrepeat = 11; + + // + PlayerDanmakuBlockspecial blockspecial = 12; + + // + PlayerDanmakuOpacity opacity = 13; + + // + PlayerDanmakuScalingfactor scalingfactor = 14; + + // + PlayerDanmakuDomain domain = 15; + + // + PlayerDanmakuSpeed speed = 16; + + // + PlayerDanmakuEnableblocklist enableblocklist = 17; + + // + InlinePlayerDanmakuSwitch inlinePlayerDanmakuSwitch = 18; +} + +//修改弹幕配置-回复 +message Response{ + // + int32 code = 1; + + // + string message = 2; +} + +//获取分段弹幕-请求 +message DmSegMobileReq{ + //稿件avid/漫画epid + int64 pid = 1; + + //视频cid/漫画cid + int64 oid = 2; + + //弹幕类型 + //1:视频 2:漫画 + int32 type = 3; + + //分段序号 + int64 segmentIndex = 4; + + //是否青少年模式 + int32 teenagersMode = 5; +} + +//获取分段弹幕-回复 +message DmSegMobileReply{ + //弹幕条目 + repeated DanmakuElem elems = 1; + + //是否已关闭弹幕 + //0:未关闭 1:已关闭 + int32 state = 2; + + // + DanmakuAIFlag aiFlag = 3; +} + +//获取弹幕元数据-请求 +message DmViewReq{ + //稿件avid/漫画epid + int64 pid = 1; + + //视频cid/漫画cid + int64 oid = 2; + + //弹幕类型 + //1:视频 2:漫画 + int32 type = 3; + + //页面spm + string spmid = 4; + + //是否冷启 + int32 isHardBoot = 5; +} + +//获取弹幕元数据-回复 +message DmViewReply{ + //是否已关闭弹幕 + //0:未关闭 1:已关闭 + bool closed = 1; + + //智能防挡弹幕蒙版信息 + VideoMask mask = 2; + + //视频字幕信息 + VideoSubtitle subtitle = 3; + + //高级弹幕专包url + repeated string specialDms = 4; + + //云屏蔽配置信息 + DanmakuFlagConfig aiFlag = 5; + + // + DanmuPlayerViewConfig playerConfig = 6; + + // + int32 sendBoxStyle = 7; + + //是否允许 + bool allow = 8; + + // + string checkBox = 9; + + // + string checkBoxShowMsg = 10; + + // + string textPlaceholder = 11; + + //弹幕输入框文案 + string inputPlaceholder = 12; + + // + repeated string reportFilterContent = 13; +} + +// +message DanmakuAIFlag{ + // + repeated DanmakuFlag dmFlags = 1; +} + +//弹幕条目 +message DanmakuElem{ + //弹幕dmid + int64 id = 1; + + //弹幕出现位置 + int32 progress = 2; + + //弹幕类型 + int32 mode = 3; + + //弹幕字号 + int32 fontsize = 4; + + //弹幕颜色 + uint32 color = 5; + + //发送着UID hash + string midHash = 6; + + //弹幕正文 + string content = 7; + + //发送时间 + int64 ctime = 8; + + //权重 + int32 weight = 9; + + //动作 + string action = 10; + + //弹幕池 + int32 pool = 11; + + //弹幕dmid-str + string idStr = 12; + + //弹幕属性 + //0:正常 4:高赞 16:? + int32 attr = 13; +} + +// +message DanmakuFlag{ + // + int64 dmid = 1; + + // + uint32 flag = 2; +} + +//云屏蔽配置信息 +message DanmakuFlagConfig{ + //云屏蔽等级 + int32 recFlag = 1; + + //云屏蔽文案 + string recText = 2; + + //云屏蔽开关 + int32 recSwitch = 3; +} + +// +message DanmuDefaultPlayerConfig{ + // + bool playerDanmakuUseDefaultConfig = 1; + + // + bool playerDanmakuAiRecommendedSwitch = 4; + + // + int32 playerDanmakuAiRecommendedLevel = 5; + + // + bool playerDanmakuBlocktop = 6; + + // + bool playerDanmakuBlockscroll = 7; + + // + bool playerDanmakuBlockbottom = 8; + + // + bool playerDanmakuBlockcolorful = 9; + + // + bool playerDanmakuBlockrepeat = 10; + + // + bool playerDanmakuBlockspecial = 11; + + // + float playerDanmakuOpacity = 12; + + // + float playerDanmakuScalingfactor = 13; + + // + float playerDanmakuDomain = 14; + + // + int32 playerDanmakuSpeed = 15; + + // + bool inlinePlayerDanmakuSwitch = 16; +} + +// +message DanmuPlayerConfig{ + // + bool playerDanmakuSwitch = 1; + + // + bool playerDanmakuSwitchSave = 2; + + // + bool playerDanmakuUseDefaultConfig = 3; + + // + bool playerDanmakuAiRecommendedSwitch = 4; + + // + int32 playerDanmakuAiRecommendedLevel = 5; + + // + bool playerDanmakuBlocktop = 6; + + // + bool playerDanmakuBlockscroll = 7; + + // + bool playerDanmakuBlockbottom = 8; + + // + bool playerDanmakuBlockcolorful = 9; + + // + bool playerDanmakuBlockrepeat = 10; + + // + bool playerDanmakuBlockspecial = 11; + + // + float playerDanmakuOpacity = 12; + + // + float playerDanmakuScalingfactor = 13; + + // + float playerDanmakuDomain = 14; + + // + int32 playerDanmakuSpeed = 15; + + // + bool playerDanmakuEnableblocklist = 16; + + // + bool inlinePlayerDanmakuSwitch = 17; + + // + int32 inlinePlayerDanmakuConfig = 18; +} + +// +message DanmuPlayerDynamicConfig{ + // + int32 progress = 1; + + // + float playerDanmakuDomain = 2; +} + +// +message DanmuPlayerViewConfig{ + // + DanmuDefaultPlayerConfig danmukuDefaultPlayerConfig = 1; + + // + DanmuPlayerConfig danmukuPlayerConfig = 2; + + // + repeated DanmuPlayerDynamicConfig danmukuPlayerDynamicConfig = 3; +} + +// +message InlinePlayerDanmakuSwitch{ + // + bool value = 1; +} + +// +message PlayerDanmakuAiRecommendedLevel{ + // + bool value = 1; +} + +// +message PlayerDanmakuAiRecommendedSwitch{ + // + bool value = 1; +} + +// +message PlayerDanmakuBlockbottom{ + // + bool value = 1; +} + +// +message PlayerDanmakuBlockcolorful{ + // + bool value = 1; +} + +// +message PlayerDanmakuBlockrepeat{ + // + bool value = 1; +} + +// +message PlayerDanmakuBlockscroll{ + // + bool value = 1; +} + +// +message PlayerDanmakuBlockspecial{ + // + bool value = 1; +} + +// +message PlayerDanmakuBlocktop{ + // + bool value = 1; +} + +// +message PlayerDanmakuDomain{ + // + float value = 1; +} + +// +message PlayerDanmakuEnableblocklist{ + // + bool value = 1; +} + +// +message PlayerDanmakuOpacity{ + // + float value = 1; +} + +// +message PlayerDanmakuScalingfactor{ + // + float value = 1; +} + +// +message PlayerDanmakuSpeed{ + // + int32 value = 1; +} + +// +message PlayerDanmakuSwitch{ + // + bool value = 1; +} + +// +message PlayerDanmakuSwitchSave{ + // + bool value = 1; +} + +// +message PlayerDanmakuUseDefaultConfig{ + // + bool value = 1; +} + +//单个字幕信息 +message SubtitleItem{ + //字幕id + int64 id = 1; + + //字幕id-str + string idStr = 2; + + //字幕语言代码 + string lan = 3; + + //字幕语言 + string lanDoc = 4; + + //字幕文件url + string subtitleUrl = 5; + + //字幕作者信息 + UserInfo author = 6; +} + +//字幕作者信息 +message UserInfo{ + //作者uid + int64 mid = 1; + + //作者昵称 + string name = 2; + + //作者性别 + string sex = 3; + + //作者头像url + string face = 4; + + //作者个人签名 + string sign = 5; + + // + int32 rank = 6; +} + +//智能防挡弹幕蒙版信息 +message VideoMask{ + //视频cid + int64 cid = 1; + + //平台 + //0:web端 1:app端 + int32 plat = 2; + + //帧率 + int32 fps = 3; + + //间隔时间 + int64 time = 4; + + //蒙版url + string maskUrl = 5; +} + +//视频字幕信息 +message VideoSubtitle{ + //视频原语言代码 + string lan = 1; + + //视频原语言 + string lanDoc = 2; + + //视频字幕列表 + repeated SubtitleItem subtitles = 3; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/im/interfaces/v1.proto b/src/Models/Models.gRPC/bilibili/im/interfaces/v1.proto new file mode 100644 index 0000000000000000000000000000000000000000..898324dfb14169d9b2f78e0914d3261fcdf39009 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/im/interfaces/v1.proto @@ -0,0 +1,440 @@ +syntax = "proto3"; + +import "bilibili/im/type.proto"; + +package bilibili.im.interfaces.v1; + +//私信 +service ImInterface { + //未读私信数 + rpc singleUnread (ReqSingleUnread) returns (RspSingleUnread); + + //会话详情 + rpc sessionDetail (ReqSessionDetail) returns (bilibili.im.type.SessionInfo); + + //拉取会话记录列表 + rpc getSessions (ReqGetSessions) returns (RspSessions); + + //拉取最近私信分享列表 + rpc shareList (ReqShareList) returns (RspShareList); + + //发送消息 + rpc sendMsg (ReqSendMsg) returns (RspSendMsg); + + //删除会话记录 + rpc removeSession (ReqRemoveSession) returns (DummyRsp); + + //置顶聊天 + rpc setTop (ReqSetTop) returns (DummyRsp); + + // + rpc ackAssisMsg (ReqAckAssisMsg) returns (DummyRsp); + + // + rpc ackSessions (ReqAckSessions) returns (RspSessions); + + // + rpc batchRmSessions (ReqBatRmSess) returns (DummyRsp); + + // + rpc batchSessDetail (ReqSessionDetails) returns (RspSessionDetails); + + // + rpc getSpecificSessions (ReqGetSpecificSessions) returns (RspSessions); + + // + rpc groupAssisMsg (ReqGroupAssisMsg) returns (RspSessionMsg); + + // + rpc myGroupUnread (DummyReq) returns (RspMyGroupUnread); + + // + rpc newSessions (ReqNewSessions) returns (RspSessions); + + // + rpc specificSingleUnread (ReqSpecificSingleUnread) returns (RspSpecificSingleUnread); + + // + rpc syncAck (ReqSyncAck) returns (RspSyncAck); + + // + rpc syncFetchSessionMsgs (ReqSessionMsg) returns (RspSessionMsg); + + // + rpc syncRelation (ReqRelationSync) returns (RspRelationSync); + + // + rpc updateAck (ReqUpdateAck) returns (DummyRsp); + + // + rpc updateUnflwRead (DummyReq) returns (DummyRsp); +} + +//发送消息-请求 +message ReqSendMsg { + // + bilibili.im.type.Msg msg = 1; + + // + string cookie = 2; + + // + string cookie2 = 3; + + // + int32 errorCode = 4; + + // + string devId = 5; +} + +//发送消息-回复 +message RspSendMsg { + // + uint64 msgKey = 1; + + // + repeated EmotionInfo eInfos = 2; + + // + string msgContent = 3; +} + +//-请求 +message DummyReq { + // + uint32 idl = 1; +} + +//-回复 +message DummyRsp { + +} + +//-请求 +message ReqAckAssisMsg { + // + uint64 ackSeqno = 1; +} + +//-请求 +message ReqAckSessions { + // + uint64 beginTs = 1; + + // + uint32 endTs = 2; + + // + uint32 size = 3; +} + +//-请求 +message ReqBatRmSess { + +} + +//拉取会话记录列表-请求 +message ReqGetSessions { + // + uint64 beginTs = 1; + + // + uint64 endTs = 2; + + // + uint32 size = 3; + + // + uint32 sessionType = 4; + + // + uint32 unfollowFold = 5; + + // + uint32 groupFold = 6; + + // + uint32 sortRule = 7; + + // + uint32 teenagerMode = 8; + + // + uint32 lessonsMode = 9; +} + +//拉取会话记录列表-回复 +message RspSessions { + // + repeated bilibili.im.type.SessionInfo sessionList = 1; + + // + uint32 hasMore = 2; + + // + bool antiDisturbCleaning = 3; + + // + int32 isAddressListEmpty = 4; +} + +//-请求 +message ReqGetSpecificSessions { + // + repeated SimpleSession talkerSessions = 1; +} + +//-请求 +message ReqGroupAssisMsg { + // + uint64 clientSeqno = 1; + + // + uint32 size = 2; +} + +//-请求 +message ReqNewSessions { + // + uint64 beginTs = 1; + + // + uint32 size = 2; + + // + uint32 teenagerMode = 3; + + // + uint32 lessonsMode = 4; +} + +//-请求 +message ReqRelationSync { + // + uint64 clientRelationOplogSeqno = 1; +} + +//删除会话记录-请求 +message ReqRemoveSession { + // + uint64 talkerId = 1; + + // + uint32 sessionType = 2; +} + +//会话详情-请求 +message ReqSessionDetail { + // + uint64 talkerId = 1; + + // + uint32 sessionType = 2; + + // + uint64 uid = 3; +} + +//-请求 +message ReqSessionDetails { + // + repeated ReqSessionDetail sessIds = 1; +} + +//-请求 +message ReqSessionMsg { + // + uint64 talkerId = 1; + + // + int32 sessionType = 2; + + // + uint64 endSeqno = 3; + + // + uint64 beginSeqno = 4; + + // + int32 size = 5; + + // + int32 order = 6; + + // + string devId = 7; +} + +//置顶聊天-请求 +message ReqSetTop { + // + uint64 talkerId = 1; + + // + uint32 sessionType = 2; + + // + uint32 opType = 3; +} + +//拉取最近私信分享列表-请求 +message ReqShareList { + // + int32 size = 1; +} + +//拉取最近私信分享列表-回复 +message RspShareList { + //最近会话列表 + repeated ShareSessionInfo sessionList = 1; + + // + int32 isAddressListEmpty = 2; +} + +//未读私信数-请求 +message ReqSingleUnread { + // + uint32 unreadType = 1; + + // + uint32 showUnfollowList = 2; +} + +//未读私信数-回复 +message RspSingleUnread { + //未关注用户私信数 + uint64 unfollowUnread = 1; + + //已关注用户私信数 + uint64 followUnread = 2; + + // + uint32 unfollowPushMsg = 3; +} + +//-请求 +message ReqSpecificSingleUnread { + // + repeated SimpleSession talkerSessions = 1; +} + +//-请求 +message ReqSyncAck { + // + uint64 clientSeqno = 1; +} + +//-请求 +message ReqUpdateAck { + // + uint64 talkerId = 1; + + // + uint32 sessionType = 2; + + // + uint64 ackSeqno = 3; +} + +//-回复 +message RspMyGroupUnread { + // + uint32 unreadCount = 1; +} + +//-回复 +message RspRelationSync { + // + int32 full = 1; + + // + repeated bilibili.im.type.RelationLog relationLogs = 2; + + // + repeated bilibili.im.type.FriendRelation friendList = 3; + + // + uint64 serverRelationOplogSeqno = 4; + + // + repeated bilibili.im.type.GroupRelation groupList = 5; +} + +//-回复 +message RspSessionDetails { + // + repeated bilibili.im.type.SessionInfo sessInfos = 1; +} + +//-回复 +message RspSessionMsg { + // + repeated bilibili.im.type.Msg messages = 1; + + // + int32 hasMore = 2; + + // + uint64 minSeqno = 3; + + // + uint64 maxSeqno = 4; + + // + repeated EmotionInfo eInfos = 5; +} + +//-回复 +message RspSpecificSingleUnread { + // + map talkerUnreadCnt = 1; + + // + uint64 allUnreadCnt = 2; +} + +//-回复 +message RspSyncAck { + +} + +//会话信息,用于私信分享 +message ShareSessionInfo { + // + uint64 talkerId = 1; + + // + string talkerUname = 2; + + // + string talkerIcon = 3; + + // + int32 officialType = 4; +} + +// +message SimpleSession { + // + uint64 talkerId = 1; + + // + uint32 sessionType = 2; +} + +// +message EmotionInfo { + // + string text = 1; + + // + string url = 2; + + // + int32 size = 3; + + // + string gifUrl = 4; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/im/type.proto b/src/Models/Models.gRPC/bilibili/im/type.proto new file mode 100644 index 0000000000000000000000000000000000000000..ac3c3a68abae93dab0e04ce70f8750db250f67ac --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/im/type.proto @@ -0,0 +1,244 @@ +syntax = "proto3"; + +package bilibili.im.type; + +//消息类型 +enum MsgType { + //基础消息类型 + EN_INVALID_MSG_TYPE = 0; //空空的~ + EN_MSG_TYPE_TEXT = 1; //文本消息 + EN_MSG_TYPE_PIC = 2; //图片消息 + EN_MSG_TYPE_AUDIO = 3; //语音消息 + EN_MSG_TYPE_SHARE = 4; //分享消息 + EN_MSG_TYPE_DRAW_BACK = 5; //撤回消息 + EN_MSG_TYPE_CUSTOM_FACE = 6; //自定义表情 + EN_MSG_TYPE_SHARE_V2 = 7; //分享v2消息 + EN_MSG_TYPE_SYS_CANCEL = 8; //系统撤销 + EN_MSG_TYPE_MINI_PROGRAM = 9; //小程序 + //扩展消息类型 + EN_MSG_TYPE_NOTIFY_MSG = 10; //业务通知 + EN_MSG_TYPE_VIDEO_CARD = 11; //视频卡片 + EN_MSG_TYPE_ARTICLE_CARD = 12; //专栏卡片 + EN_MSG_TYPE_PICTURE_CARD = 13; //图片卡 + EN_MSG_TYPE_COMMON_SHARE_CARD = 14; //异形卡 + EN_MSG_TYPE_BIZ_MSG_TYPE = 50; // + //功能类系统消息类型 + EN_MSG_TYPE_GROUP_MEMBER_CHANGED = 101; //群成员变更 + EN_MSG_TYPE_GROUP_STATUS_CHANGED = 102; //群状态变更 + EN_MSG_TYPE_GROUP_DYNAMIC_CHANGED = 103; //群动态变更 + EN_MSG_TYPE_GROUP_LIST_CHANGED = 104; //群列表变更 + EM_MSG_TYPE_FRIEND_LIST_CHANGED = 105; //好友列表变更 + EN_MSG_TYPE_GROUP_DETAIL_CHANGED = 106; //群详情发生变化 + EN_MSG_TYPE_GROUP_MEMBER_ROLE_CHANGED = 107; //群成员角色发生变化 + EN_MSG_TYPE_NOTICE_WATCH_LIST = 108; // + EN_MSG_TYPE_NOTIFY_NEW_REPLY_RECIEVED = 109; //消息系统,收到新的reply + EN_MSG_TYPE_NOTIFY_NEW_AT_RECIEVED = 110; // + EN_MSG_TYPE_NOTIFY_NEW_PRAISE_RECIEVED = 111; // + EN_MSG_TYPE_NOTIFY_NEW_UP_RECIEVED = 112; // + EN_MSG_TYPE_NOTIFY_NEW_REPLY_RECIEVED_V2 = 113; // + EN_MSG_TYPE_NOTIFY_NEW_AT_RECIEVED_V2 = 114; // + EN_MSG_TYPE_NOTIFY_NEW_PRAISE_RECIEVED_V2 = 115; // + EN_MSG_TYPE_GROUP_DETAIL_CHANGED_MULTI = 116; //群详情发生变化,多端同步版本需要即时消息,无需落地 + EN_MSG_TYPE_GROUP_MEMBER_ROLE_CHANGED_MULTI = 117; //群成员角色发生变化,多端同步版本需要即时消息,无需落地 + EN_MSG_TYPE_NOTIFY_ANTI_DISTURB = 118; // + //系统通知栏消息类型 + EN_MSG_TYPE_SYS_GROUP_DISSOLVED = 201; //群解散 + EN_MSG_TYPE_SYS_GROUP_JOINED = 202; //入群 + EN_MSG_TYPE_SYS_GROUP_MEMBER_EXITED = 203; //成员主动退群 + EN_MSG_TYPE_SYS_GROUP_ADMIN_FIRED = 204; //房管被撤 + EN_MSG_TYPE_SYS_GROUP_MEMBER_KICKED = 205; //成员被T + EN_MSG_TYPE_SYS_GROUP_ADMIN_KICK_OFF = 206; //管理T人 + EN_MSG_TYPE_SYS_GROUP_ADMIN_DUTY = 207; //管理上任 + EN_MSG_TYPE_SYS_GROUP_AUTO_CREATED = 208; //自动创建 + EN_MSG_TYPE_SYS_FRIEND_APPLY = 210; //好友申请 + EN_MSG_TYPE_SYS_FRIEND_APPLY_ACK = 211; //好友申请通过 + EN_MSG_TYPE_SYS_GROUP_APPLY_FOR_JOINING = 212; //用户加群申请 + EN_MSG_TYPE_SYS_GROUP_ADMIN_ACCEPTED_USER_APPLY = 213; //通知管理员,有其他管理员已经同意用户加群 + //聊天窗口通知消息类型 + EN_MSG_TYPE_CHAT_MEMBER_JOINED = 301; //入群 + EN_MSG_TYPE_CHAT_MEMBER_EXITED = 302; //退群 + EN_MSG_TYPE_CHAT_GROUP_FREEZED = 303; //冻结 + EN_MSG_TYPE_CHAT_GROUP_DISSOLVED = 304; //解散 + EN_MSG_TYPE_CHAT_GROUP_CREATED = 305; //开通应援团 + EN_MSG_TYPE_CHAT_POPUP_SESSION = 306; //弹出会话 +} + +// +message SessionInfo { + // + uint64 talkerId = 1; + + // + uint32 sessionType = 2; + + // + uint64 atSeqno = 3; + + // + uint64 topTs = 4; + + // + string groupName = 5; + + // + string groupCover = 6; + + // + uint32 isFollow = 7; + + // + uint32 isDnd = 8; + + // + uint64 ackSeqno = 9; + + // + uint64 ackTs = 10; + + // + uint64 sessionTs = 11; + + // + uint32 unreadCount = 12; + + // + Msg lastMsg = 13; + + // + uint32 groupType = 14; + + // + uint32 canFold = 15; + + // + uint32 status = 16; + + // + uint64 maxSeqno = 17; + + // + uint32 newPushMsg = 18; + + // + uint32 setting = 19; + + // + uint32 isGuardian = 20; +} + +// +message Msg { + // + uint64 senderUid = 1; + + // + int32 receiverType = 2; + + // + uint64 receiverId = 3; + + // + uint64 cliMsgId = 4; + + // + int32 msgType = 5; + + // + string content = 6; + + // + uint64 msgSeqno = 7; + + // + uint64 timestamp = 8; + + // + repeated uint64 atUids = 9; + + // + repeated uint64 recverIds = 10; + + // + uint64 msgKey = 11; + + // + uint32 msgStatus = 12; + + // + bool sysCancel = 13; + + // + string notifyCode = 14; + + // + uint32 msgSource = 15; + + // + int32 newFaceVersion = 16; +} + +// +message RelationLog { + // + int32 logType = 1; + + // + uint64 oplogSeqno = 2; + + // + FriendRelation friendRelation = 3; + + // + GroupRelation groupRelation = 4; +} + +// +message FriendRelation { + // + uint64 uid = 1; + + // + string userName = 2; + + // + string face = 3; + + // + uint32 vipLevel = 4; +} + +// +message GroupRelation { + // + uint64 groupId = 1; + + // + uint64 ownerUid = 2; + + // + uint32 groupType = 3; + + // + uint32 groupLevel = 4; + + // + string groupCover = 5; + + // + string groupName = 6; + + // + string groupNotice = 7; + + // + int32 status = 8; + + // + int32 memberRole = 9; + + // + string fansMedalName = 10; + + // + uint64 roomId = 11; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/main/community/reply/v1/reply.proto b/src/Models/Models.gRPC/bilibili/main/community/reply/v1/reply.proto new file mode 100644 index 0000000000000000000000000000000000000000..b6ad38f1124f22091d57ca2eef0735be55c172e8 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/main/community/reply/v1/reply.proto @@ -0,0 +1,660 @@ +syntax = "proto3"; + +package bilibili.main.community.reply.v1; + +import "google/protobuf/any.proto"; + +// 评论区 +service Reply { + // 主评论列表接口 + rpc MainList(MainListReq) returns (MainListReply); + // 二级评论明细接口 + rpc DetailList(DetailListReq) returns (DetailListReply); + // 对话评论树接口 + rpc DialogList(DialogListReq) returns (DialogListReply); + // 评论预览接口 + rpc PreviewList (PreviewListReq) returns (PreviewListReply); + // 评论搜索item前置发布接口 + rpc SearchItemPreHook(SearchItemPreHookReq) returns (SearchItemPreHookReply); + // 评论搜索插入项目接口 + rpc SearchItem(SearchItemReq) returns (SearchItemReply); +} + +// 广告 +message CM { + // 广告数据(需要二次解包) + google.protobuf.Any sourceContent = 1; +} + +// 对话评论树-请求 +message DialogListReq { + // 目标评论区id + int64 oid = 1; + // 目标评论区类型 + int64 type = 2; + // 根评论rpid + int64 root = 3; + // 对话评论rpid + int64 rpid = 4; + // 页面游标 + CursorReq cursor = 5; +} + +// 对话评论树-响应 +message DialogListReply { + // 页面游标 + CursorReply cursor = 1; + // 评论区显示控制字段 + SubjectControl subjectControl = 2; + // 子评论列表 + repeated ReplyInfo replies = 3; + // 评论区的活动 + Activity activity = 4; +} + +// 来源标识 +enum DetailListScene { + //评论区展开 + REPLY = 0; + //回复消息推送 + MSG_FEED = 1; +} + +// 二级评论明细-请求 +message DetailListReq { + // 目标评论区id + int64 oid = 1; + // 目标评论区类型 + int64 type = 2; + // 根评论rpid + int64 root = 3; + // 目标评论rpid + int64 rpid = 4; + // 页面游标 + CursorReq cursor = 5; + // 来源标识 + DetailListScene scene = 6; +} + +// 二级评论明细-响应 +message DetailListReply { + // 页面游标 + CursorReply cursor = 1; + // 评论区显示控制字段 + SubjectControl subjectControl = 2; + // 根评论信息(带二级评论) + ReplyInfo root = 3; + // 评论区的活动 + Activity activity = 4; +} + +// 主评论列表-请求 +message MainListReq { + // 目标评论区id + int64 oid = 1; + // 目标评论区类型 + int64 type = 2; + // 页面游标 + CursorReq cursor = 3; + // 扩展数据json + string extra = 4; + // 广告扩展json + string adExtra = 5; + // 目标评论rpid + int64 rpid = 6; +} + +// 评论区预览-请求 +message PreviewListReq { + // 目标评论区id + int64 oid = 1; + // 目标评论区类型 + int64 type = 2; + // 页面游标 + CursorReq cursor = 3; +} + +// +message ReplyExtra { + // + int64 season_id = 1; + // + int64 season_type = 2; + // + int64 ep_id = 3; + // + bool is_story = 4; +} + +// 评论区预览-回复 +message PreviewListReply { + // 页面游标 + CursorReply cursor = 1; + // 评论列表 + repeated ReplyInfo replies = 2; + // 评论区显示控制字段 + SubjectControl subjectControl = 3; + // UP置顶评论 + ReplyInfo upTop = 4; + // 管理员置顶评论 + ReplyInfo adminTop = 5; + // 投票置顶评论 + ReplyInfo voteTop = 6; +} + +// 主评论列表-响应 +message MainListReply { + // 页面游标 + CursorReply cursor = 1; + // 评论列表 + repeated ReplyInfo replies = 2; + // 评论区显示控制字段 + SubjectControl subjectControl = 3; + // UP置顶评论 + ReplyInfo upTop = 4; + // 管理员置顶评论 + ReplyInfo adminTop = 5; + // 投票置顶评论 + ReplyInfo voteTop = 6; + // 评论区提示 + Notice notice = 7; + // 抽奖评论 + Lottery lottery = 8; + // 活动 + Activity activity = 9; + // 精选评论区筛选后台信息 + UpSelection upSelection = 10; + // 广告 + CM cm = 11; + // 特效 + Effects effects = 12; +} + +// 特效 +message Effects { + // + string preloading = 1; +} + +// +message UpSelection { + // 待审评论数 + int64 pendingCount = 1; + // 忽略评论数 + int64 ignoreCount = 2; +} + +// +message Notice { + // + int64 id = 1; + // + string content = 2; + // + string link = 3; +} + +// 活动 +message Activity { + // 活动id + int64 activityId = 1; + // 活动状态 + // -1:待审 1:上线 + int64 activityState = 2; + // 参与活动的输入框文案 + string activityPlaceholder = 3; +} + +// 抽奖 +message Lottery { + // 抽奖id + int64 lotteryId = 1; + // 抽奖状态 + // 0:未开奖 1:开奖中 2:已开奖 + int64 lotteryStatus = 2; + // 抽奖人mid + int64 lotteryMid = 3; + // 开奖时间 + int64 lotteryTime = 4; + // + int64 oid = 5; + // + int64 type = 6; + // 发送时间 + int64 ctime = 7; + // 抽奖评论正文 + Content content = 8; + // 用户信息 + Member member = 9; + // 评论条目控制字段 + ReplyControl replyControl = 10; +} + +// 排序方式 +enum Mode { + // + DEFAULT = 0; + // + UNSPECIFIED = 1; + //按时间 + MAIN_LIST_TIME = 2; + //按热度 + MAIN_LIST_HOT = 3; +} + +// 页面游标请求 +message CursorReq { + // 下页数据 + int64 next = 1; + // 上页数据 + int64 prev = 2; + // 排序方式 + Mode mode = 4; +} + +// 页面游标回复 +message CursorReply { + // 下页数据 + int64 next = 1; + // 上页数据 + int64 prev = 2; + // 是否到顶 + bool isBegin = 3; + // 是否到底 + bool isEnd = 4; + // 排序方式 + // 2:时间 3:热度 + Mode mode = 5; + // 当前排序mode在切换按钮上的展示文案 + string mode_text = 6; +} + +// 评论区控制字段 +message SubjectControl { + // UP主mid + int64 upMid = 1; + // 自己是否为协管 + bool isAssist = 2; + // 是否只读 + bool readOnly = 3; + // 是否有发起投票权限 + bool hasVoteAccess = 4; + // 是否有发起抽奖权限 + bool hasLotteryAccess = 5; + // 是否有被折叠评论 + bool hasFoldedReply = 6; + // 空评论区背景文案 + string bgText = 7; + // 是否被UP拉黑 + bool upBlocked = 8; + // 是否有发起活动权限 + bool hasActivityAccess = 9; + // 标题展示控制 + bool showTitle = 10; + // 是否显示UP主操作标志 + bool showUpAction = 11; + // 是否显示评论区排序切换按钮 + int64 switcherType = 12; + // 是否禁止输入框 + bool inputDisable = 13; + // 根评论输入框背景文案 + string rootText = 14; + // 子评论输入框背景文案 + string childText = 15; + // 评论总数 + int64 count = 16; + // 评论区标题 + string title = 17; + // 离开态输入框的文案 + string giveup_text = 18; +} + +// 评论条目信息 +message ReplyInfo { + // 二级评论列表 + repeated ReplyInfo replies = 1; + // 评论rpid + int64 id = 2; + // 评论区对象id + int64 oid = 3; + // 评论区类型 + int64 type = 4; + // 发布者UID + int64 mid = 5; + // 根评论rpid + int64 root = 6; + // 父评论rpid + int64 parent = 7; + // 对话评论rpid + int64 dialog = 8; + // 点赞数 + int64 like = 9; + // 发布时间 + int64 ctime = 10; + // 回复数 + int64 count = 11; + // 评论主体信息 + Content content = 12; + // 发布者信息 + Member member = 13; + // 评论控制字段 + ReplyControl replyControl = 14; +} + +//评论主体信息 +message Content { + //评论文本 + string message = 1; + //at到的用户信息 + map menber = 2; + //需要渲染的表情转义 + map emote = 3; + //需要高亮的话题转义 + map topic = 4; + //需要高亮的超链转义 + map url = 5; + //投票信息 + Vote vote = 6; +} + +// 评论条目控制字段 +message ReplyControl { + // 操作行为标志 + // 0:无 1:已点赞 2:已点踩 + int64 action = 1; + // 是否UP觉得很赞 + bool upLike = 2; + // 是否存在UP回复 + bool upReply = 3; + // 是否显示关注按钮 + bool showFollowBtn = 4; + // 是否协管 + bool isAssist = 5; + // 是否展示标签 + string labelText = 6; + // 是否关注 + bool following = 7; + // 是否粉丝 + bool followed = 8; + // 是否被自己拉黑 + bool blocked = 9; + // 是否存在折叠的二级评论 + bool hasFoldedReply = 10; + // 是否折叠 + bool isFoldedReply = 11; + // 是否UP置顶 + bool isUpTop = 12; + // 是否管理置顶 + bool isAdminTop = 13; + // 是否置顶投票评论 + bool isVoteTop = 14; + // 最大收起显示行数 + int64 maxLine = 15; + // 该条评论可不可见 + bool invisible = 16; + // 是否和up签订契约 + bool is_contractor = 17; + // 是否是笔记评论 + bool is_note = 18; +} + +// 超链项 +message Url { + // 标题 + string title = 1; + // + int64 state = 2; + // 图标url + string prefixIcon = 3; + // + string appUrlSchema = 4; + // + string appName = 5; + // + string appPackageName = 6; + // 上报id + string clickReport = 7; +} + +// 话题项 +message Topic { + // 跳转url + string link = 1; + // 话题id + int64 id = 2; +} + +// 表情项 +message Emote { + // 表情大小 + // 1:小 2:大 + int64 size = 1; + // 表情url + string url = 2; +} + +// 投票信息 +message Vote { + // 投票id + int64 id = 1; + // 投票标题 + string title = 2; + // 参与人数 + int64 count = 3; +} + +// 用户信息 +message Member { + /**********基础信息**********/ + // 用户mid + int64 mid = 1; + // 昵称 + string name = 2; + // 性别 + string sex = 3; + // 头像url + string face = 4; + // 等级 + int64 level = 5; + // 认证类型 + int64 officialVerifyType = 6; + /**********VIP相关**********/ + // 会员类型 + // 0:不是大会员 1:月度会员 2:年度大会员 + int64 vipType = 7; + // 会员状态 + int64 vipStatus = 8; + // 会员样式 + int64 vipThemeType = 9; + // 会员铭牌样式url + string vipLabelPath = 10; + /**********装扮相关**********/ + // 头像框url + string garbPendantImage = 11; + // 装扮卡url + string garbCardImage = 12; + // 有关注按钮时的装扮卡url + string garbCardImageWithFocus = 13; + // 专属装扮页面url + string garbCardJumpUrl = 14; + // 专属装扮id + string garbCardNumber = 15; + // 专属装扮id显示颜色 + string garbCardFanColor = 16; + // 是否为专属装扮卡 + bool garbCardIsFan = 17; + /**********粉丝勋章相关**********/ + // 粉丝勋章名 + string fansMedalName = 18; + // 粉丝勋章等级 + int64 fansMedalLevel = 19; + // 粉丝勋章显示颜色 + int64 fansMedalColor = 20; + // 会员昵称颜色 + string vip_nickname_color = 21; + // 会员角标 + // 0:无角标 1:粉色大会员角标 2:绿色小会员角标 + int32 vip_avatar_subscript = 22; + // 会员标签文 + string vip_label_text = 23; + // 会员标颜色 + string vip_label_theme = 24; +} + +// +enum SearchItemType { + // + DEFAULT_ITEM_TYPE = 0; + // + GOODS_VALUE = 1; + // + VIDEO_VALUE = 2; + // + ARTICLE_VALUE = 3; +} + +// +enum SearchItemVideoSubType { + // + UGC = 0; + // + PGC = 1; +} + +// 评论搜索item前置发布-请求 +message SearchItemPreHookReq { + // 目标评论区id + int64 oid = 1; + // 目标评论区类型 + int64 type = 2; +} + +// 评论搜索item前置发布-响应 +message SearchItemPreHookReply { + // 输入框的文案 + string placeholderText = 1; + // 背景空白的时候的文案 + string backgroundText = 2; + // 有权限的tab栏的顺序 + repeated SearchItemType orderedType = 3; +} + +// 评论搜索插入项目-请求 +message SearchItemReq { + //页面游标 + SearchItemCursorReq cursor = 1; + //目标评论区id + int64 oid = 2; + //评论区类型 + int64 type = 3; + //搜索关键词 + string keyword = 4; +} + +// +message SearchItemReplyExtraInfo { + // + string eventId = 1; +} + +// 评论搜索插入项目-回复 +message SearchItemReply { + // + SearchItemCursorReply cursor = 1; + // 搜索的结果 + repeated SearchItem items = 2; + // 附加信息 + SearchItemReplyExtraInfo extra = 3; +} + +// 评论搜索插入项目请求游标 +message SearchItemCursorReq { + // 下一页 + int64 next = 1; + // tab类型 + SearchItemType itemType = 2; +} + +// 评论搜索插入项目响应游标 +message SearchItemCursorReply { + // 是否有下一页 + bool hasNext = 1; + // 下页 + int64 next = 2; +} + +// 评论搜索插入项目 +message SearchItem { + // + string url = 1; + // 项目 + oneof item { + // 商品 + GoodsSearchItem goods = 2; + // 视频 + VideoSearchItem video = 3; + // 专栏 + ArticleSearchItem article = 4; + } +} + +// 商品项目 +message GoodsSearchItem { + // 商品id + int64 id = 1; + // 商品名 + string name = 2; + // 价钱 + string price = 3; + // 收入 + string income = 4; + // 图片 + string img = 5; + // 标签 + string label = 6; +} + +// 视频项目 +message VideoSearchItem { + // + SearchItemVideoSubType type = 1; + // + oneof video_item { + // UGC视频 + UGCVideoSearchItem ugc = 2; + // PGC视频 + PGCVideoSearchItem pgc = 3; + } +} + +// UGC视频项目 +message UGCVideoSearchItem { + // 标题 + string title = 1; + // UP主昵称 + string upNickname = 2; + // 时长(单位为秒) + int64 duration = 3; + // 封面 + string cover = 4; +} + +// PGC视频项目 +message PGCVideoSearchItem { + // 标题 + string title = 1; + // 类别 + string category = 2; + // 封面 + string cover = 3; +} + +// 文章项目 +message ArticleSearchItem { + // 标题 + string title = 1; + // UP主昵称 + string upNickname = 2; + // 封面 + repeated string covers = 3; +} diff --git a/src/Models/Models.gRPC/bilibili/metadata/device/device.proto b/src/Models/Models.gRPC/bilibili/metadata/device/device.proto new file mode 100644 index 0000000000000000000000000000000000000000..45108e6cceb41d19c2f8e223d6a7c41297152aa3 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/metadata/device/device.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; + +package bilibili.metadata.device; + +// 设备信息 +// gRPC头部:x-bili-device-bin +message Device { + // 产品id + // 粉 白 蓝 直播姬 HD 海外 OTT 漫画 TV野版 小视频 网易漫画 网易漫画 网易漫画HD 国际版 + // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + int32 app_id = 1; + // 构建id + int32 build = 2; + // 设备buvid + string buvid = 3; + // 包类型 + string mobi_app = 4; + // 平台类型 + // ios android + string platform = 5; + // 设备类型 + string device = 6; + // 渠道 + string channel = 7; + // 手机品牌 + string brand = 8; + // 手机型号 + string model = 9; + // 系统版本 + string osver = 10; + // 本地设备指纹 + string fp_local = 11; + // 远程设备指纹 + string fp_remote = 12; + // APP版本号 + string version_name = 13; + // 设备指纹, 不区分本地或远程设备指纹,作为推送目标的索引 + string fp = 14; +} diff --git a/src/Models/Models.gRPC/bilibili/metadata/fawkes/fawkes.proto b/src/Models/Models.gRPC/bilibili/metadata/fawkes/fawkes.proto new file mode 100644 index 0000000000000000000000000000000000000000..8ce70901a8c75edcc6da29337be3220264fbc0ef --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/metadata/fawkes/fawkes.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package bilibili.metadata.fawkes; + +message FawkesReq { + // 客户端在fawkes系统的唯一名 + string appkey = 1; + // 客户端在fawkes系统中的环境参数 + string env = 2; + // 启动id + string session_id = 3; +} + +message FawkesReply { + // 客户端在fawkes系统中对应的已发布最新的config版本号 + string config = 1; + // 客户端在fawkes系统中对应的已发布最新的ff版本号 + string ff = 2; +} diff --git a/src/Models/Models.gRPC/bilibili/metadata/locale/locale.proto b/src/Models/Models.gRPC/bilibili/metadata/locale/locale.proto new file mode 100644 index 0000000000000000000000000000000000000000..878127857628deecd788f676263a1a9f0c601ea5 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/metadata/locale/locale.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package bilibili.metadata.locale; + +// Defined by https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html +message LocaleIds { + // A language designator is a code that represents a language. + string language = 1; + // Writing systems. + string script = 2; + // A region designator is a code that represents a country or an area. + string region = 3; +} + +// 区域标识 +// gRPC头部:x-bili-locale-bin +message Locale { + // App设置的locale + LocaleIds c_locale = 1; + // 系统默认的locale + LocaleIds s_locale = 2; + // sim卡的国家码+运营商码 + string sim_code = 3; + // 时区 + string timezone = 4; +} diff --git a/src/Models/Models.gRPC/bilibili/metadata/metadata.proto b/src/Models/Models.gRPC/bilibili/metadata/metadata.proto new file mode 100644 index 0000000000000000000000000000000000000000..dda7bcdb2c65c3c3e3452863e9a9a1956128f3e5 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/metadata/metadata.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package bilibili.metadata; + +// 请求元数据 +// gRPC头部:x-bili-metadata-bin +message Metadata { + // 登录Token + string access_key = 1; + // 包类型 + string mobi_app = 2; + // 运行设备 + string device = 3; + // 构建id + int32 build = 4; + // 渠道 + string channel = 5; + // 设备buvid + string buvid = 6; + // 平台类型 + string platform = 7; +} diff --git a/src/Models/Models.gRPC/bilibili/metadata/network/network.proto b/src/Models/Models.gRPC/bilibili/metadata/network/network.proto new file mode 100644 index 0000000000000000000000000000000000000000..5282e9f5fc6e0b21e417b71f4abe59107a171c14 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/metadata/network/network.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package bilibili.metadata.network; + +// 网络类型 +enum NetworkType { + NT_UNKNOWN = 0; // 未知 + WIFI = 1; // WIFI + CELLULAR = 2; // 移动网络 + OFFLINE = 3; // 未连接 + OTHERNET = 4; // 其他网络 + ETHERNET = 5; // 以太网 +} + +// 免流类型 +enum TFType { + TF_UNKNOWN = 0; // 正常计费 + U_CARD = 1; // 联通卡 + U_PKG = 2; // 联通包 + C_CARD = 3; // 移动卡 + C_PKG = 4; // 移动包 + T_CARD = 5; // 电信卡 + T_PKG = 6; // 电信包 +} + +// 网络类型标识 +// gRPC头部:x-bili-network-bin +message Network { + // 网络类型 + NetworkType type = 1; + // 免流类型 + TFType tf = 2; + // 运营商 + string oid = 3; +} diff --git a/src/Models/Models.gRPC/bilibili/metadata/restriction/restriction.proto b/src/Models/Models.gRPC/bilibili/metadata/restriction/restriction.proto new file mode 100644 index 0000000000000000000000000000000000000000..57ad552d11ad040571b559a5659d99261e8c00d1 --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/metadata/restriction/restriction.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package bilibili.metadata.restriction; + +// 模式类型 +enum ModeType { + NORMAL = 0; // 正常模式 + TEENAGERS = 1; // 青少年模式 + LESSONS = 2; // 课堂模式 +} + +// 限制条件 +message Restriction { + // 青少年模式开关状态 + bool teenagers_mode = 1; + // 课堂模式开关状态 + bool lessons_mode = 2; + // 模式类型(旧版) + ModeType mode = 3; + // app 审核review状态 + bool review = 4; +} diff --git a/src/Models/Models.gRPC/bilibili/pgc/gateway/player/v2.proto b/src/Models/Models.gRPC/bilibili/pgc/gateway/player/v2.proto new file mode 100644 index 0000000000000000000000000000000000000000..ab2a090bea95d3aa5d26c7540f8931b216f573cc --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/pgc/gateway/player/v2.proto @@ -0,0 +1,616 @@ +syntax = "proto3"; + +package bilibili.pgc.gateway.player.v2; + +import "google/protobuf/timestamp.proto"; + +//播放url +service PlayURL { + //获取播放url + //https://app.bilibili.com/bilibili.pgc.gateway.player.v2.PlayURL/PlayView + rpc PlayView (PlayViewReq) returns (PlayViewReply); +} + +//获取播放url-请求 +message PlayViewReq{ + //目标剧集epid + int64 epid = 1; + + //目标视频cid + int64 cid = 2; + + //清晰度 + int64 qn = 3; + + //视频流版本 + int32 fnver = 4; + + //视频流功能 + int32 fnval = 5; + + //下载模式 + //0:播放 1:flv下载 2:dash下载 + uint32 download = 6; + + // + int32 forceHost = 7; + + //是否允许4K + bool fourk = 8; + + // + string spmid = 9; + + // + string fromSpmid = 10; + + // + int32 teenagersMode = 11; + + //编码类型 + CodeType codetype = 12; + + // + bool isPreview = 13; + + // + int64 roomId = 14; + + // + bool isNeedViewInfo = 15; +} + +//获取播放url-回复 +message PlayViewReply{ + //视频流信息 + VideoInfo info = 1; + + //用户播放界面配置 + PlayAbilityConf PlayConf = 2; + + // + PlayViewBusinessInfo Business = 3; + + // + Event event = 4; + + // + ViewInfo viewInfo = 5; +} + +//编码类型 +enum CodeType { + //默认 + NOCODE = 0; + + //H.264 + CODE264 = 1; + + //H.265 + CODE265 = 2; +} + +//不满足条件信息 +message Limit { + // + string title = 1; + + // + string uri = 2; + + // + string msg = 3; +} + +//流媒体元数据 +message streamInfo { + //清晰度 qn + uint32 quality = 1; + + //格式 + string format = 2; + + //格式描述 + string description = 3; + + //错误码 + uint32 errCode = 4; + + //不满足条件信息 + Limit limit = 5; + + //是否需要vip + bool needVip = 6; + + //是否需要登录 + bool needLogin = 7; + + //是否完整 + bool intact = 8; + + //是否非全二压 + bool noRexcode = 9; + + // + int64 attribute = 10; + + //新版格式描述 + string newDescription = 11; + + //格式文字 + string displayDesc = 12; + + //新版格式描述备注 + string superscript = 13; +} + +//dash视频流 +message DashVideo { + //主线流 + string baseUrl = 1; + + //备用流 + repeated string backupUrl = 2; + + //带宽 + uint32 bandwidth = 3; + + // + uint32 codecid = 4; + + //md5 + string md5 = 5; + + //大小 + uint64 size = 6; + + // + uint32 audioId = 7; + + //是否非全二压 + bool noRexcode = 8; +} + +//分段流条目 +message ResponseUrl { + //分段序号 + uint32 order = 1; + + //分段时长 + uint64 length = 2; + + //分段大小 + uint64 size = 3; + + //主线流 + string url = 4; + + //备用流 + repeated string backupUrl = 5; + + //md5 + string md5 = 6; +} + +//分段视频流 +message SegmentVideo { + //分段视频流列表 + repeated ResponseUrl segment = 1; +} + +//视频流信息 +message stream { + //元数据 + streamInfo info = 1; + + //dash流 + DashVideo dashvideo = 2; + + //分段流 + SegmentVideo segmentvideo = 3; +} + +//dash音频流 +message DashAudio { + //音质id + uint32 id = 1; + + //主线流 + string baseUrl = 2; + + //备用流 + repeated string backupUrl = 3; + + //带宽 + uint32 bandwidth = 4; + + // + uint32 codecid = 5; + + //md5 + string md5 = 6; + + //大小 + uint64 size = 7; +} + +//杜比音频信息 +message DolbyItem { + // + int32 type = 1; + + //音频流 + DashAudio audio = 2; +} + +//视频url信息 +message VideoInfo { + //视频清晰度 + uint32 quality = 1; + + //视频格式 + string format = 2; + + //视频时长 + uint64 timelength = 3; + + // + uint32 videoCodecid = 4; + + //视频流 + repeated stream streamList = 5; + + //伴音流 + repeated DashAudio audio = 6; + + //杜比伴音流 + DolbyItem dolby = 7; +} + +//禁用功能配置 +message PlayAbilityConf{ + //后台播放 + bool backgroundPlayDisable = 1; + + //镜像反转 + bool flipDisable = 2; + + //投屏 + bool castDisable = 3; + + //反馈 + bool feedbackDisable = 4; + + //字幕 + bool subtitleDisable = 5; + + //播放速度 + bool playbackRateDisable = 6; + + //定时停止 + bool timeUpDisable = 7; + + //播放方式 + bool playbackModeDisable = 8; + + //画面尺寸 + bool scaleModeDisable = 9; + + //赞 + bool likeDisable = 10; + + //踩 + bool dislikeDisable = 11; + + //投币 + bool coinDisable = 12; + + //充电 + bool elecDisable = 13; + + //分享 + bool shareDisable = 14; + + //截图 + bool screenShotDisable = 15; + + //锁定 + bool lockScreenDisable = 16; + + //相关推荐 + bool recommendDisable = 17; + + //播放速度 + bool playbackSpeedDisable = 18; + + //清晰度 + bool definitionDisable = 19; + + //选集 + bool selectionsDisable = 20; + + //下一集 + bool nextDisable = 21; + + //编辑弹幕 + bool editDmDisable = 22; + + //小窗 + bool smallWindowDisable = 23; + + //震动 + bool shakeDisable = 24; + + // + bool outerDmDisable = 25; + + // + bool innerDmDisable = 26; + + // + bool freyaEnterDisable = 27; + + //杜比音效 + bool dolbyDisable = 28; +} + +// +message PlayViewBusinessInfo { + // + bool isPreview = 1; + + // + bool bp = 2; + + // + string marlinToken = 3; +} + +// +message Shake { + // + string file = 1; +} + +// +message Event { + // + Shake shake = 1; +} + +// +message Report { + // + string showEventId = 1; + + // + string clickEventId = 2; + + // + string extends = 3; +} + +// +message BadgeInfo { + // + string text = 1; + + // + string bgColor = 2; + + // + string bgColorNight = 3; +} + +// +message ButtonInfo { + // + string text = 1; + + // + string textColor = 2; + + // + string textColorNight = 3; + + // + string bgColor = 4; + + // + string bgColorNight = 5; + + // + string link = 6; + + // + string actionType = 7; + + // + BadgeInfo badgeInfo = 8; + + // + Report report = 9; +} + +// +message DialogConfig { + // + bool isShowCover = 1; + + // + bool isOrientationEnable = 2; + + // + bool isNestedScrollEnable = 3; + + // + bool isForceHalfscreenEnable = 4; +} + +// +message TextInfo { + // + string text = 1; + + // + string textColor = 2; + + // + string textColorNight = 3; +} + +// +message ImageInfo { + // + string url = 1; +} + +// +message Dialog { + // + int64 code = 1; + + // + string msg = 2; + + // + string type = 3; + + // + string styleType = 4; + + // + DialogConfig config = 5; + + // + TextInfo title = 6; + + // + TextInfo subtitle = 7; + + // + ImageInfo image = 8; + + // + repeated ButtonInfo button = 9; + + // + ButtonInfo bottomDesc = 10; + + // + Report report = 11; + + // + int32 countDownSec = 12; +} + +// +message Toast { + // + string text = 1; + + // + ButtonInfo button = 2; +} + +// +message CouponTextInfo { + // + string positivePreview = 1; + + // + string section = 2; +} + +// +message CouponToast { + // + CouponTextInfo textInfo = 1; + + // + ButtonInfo button = 2; +} + +// +message Coupon { + // + string couponToken = 1; + + // + int64 type = 2; + + // + string value = 3; + + // + string useDesc = 4; + + // + string title = 5; + + // + string desc = 6; + + // + string payButtonText = 7; + + // + string payButtonTextLineThrough = 8; + + // + string realAmount = 9; + + // + google.protobuf.Timestamp expireTime = 10; +} + +// +message PopWin { + // + string title = 1; + + // + repeated Coupon coupon = 2; + + // + repeated ButtonInfo button = 3; + + // + string bottomText = 4; +} + +// +message CouponInfo { + // + CouponToast toast = 1; + + // + PopWin popWin = 2; +} + +// +message EndPage { + // + Dialog dialog = 1; + + // + bool hide = 2; +} + +// +message ViewInfo { + // + Dialog dialog = 1; + + // + Toast toast = 2; + + // + CouponInfo couponInfo = 3; + + // + repeated int64 demandNoPayEpids = 4; + + // + EndPage endPage = 5; +} \ No newline at end of file diff --git a/src/Models/Models.gRPC/bilibili/rpc/status.proto b/src/Models/Models.gRPC/bilibili/rpc/status.proto new file mode 100644 index 0000000000000000000000000000000000000000..c120a1b08d13d64c92c6994d9cbf6e8f78a198ae --- /dev/null +++ b/src/Models/Models.gRPC/bilibili/rpc/status.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package bilibili.rpc; + +import "google/protobuf/any.proto"; + +// 响应gRPC Status +// 当status code是[UNKNOWN = 2]时,details为业务详细的错误信息,进行proto any转换成业务码结构体 +message Status { + // 业务错误码 + int32 code = 1; + // 业务错误信息 + string message = 2; + //扩展信息嵌套(相当于该messasge的套娃) + repeated google.protobuf.Any details = 3; +} diff --git a/src/ViewModels/ViewModels.Uwp/RankViewModel/RankViewModel.cs b/src/ViewModels/ViewModels.Uwp/RankViewModel/RankViewModel.cs index 9d10b1adea75f91a8929d08659f8dbf1ac6d2a5f..3acf8500bcae7350763f17e16ba76414e539d1ac 100644 --- a/src/ViewModels/ViewModels.Uwp/RankViewModel/RankViewModel.cs +++ b/src/ViewModels/ViewModels.Uwp/RankViewModel/RankViewModel.cs @@ -41,20 +41,7 @@ namespace Richasy.Bili.ViewModels.Uwp 0, new RankPartition( _resourceToolkit.GetLocaleString(Models.Enums.LanguageNames.WholePartitions), - Models.Enums.RankScope.All, "ms-appx:///Assets/Bili_rgba_80.png")); - rankPartitions.Insert( - 1, - new RankPartition( - _resourceToolkit.GetLocaleString(Models.Enums.LanguageNames.Original), - Models.Enums.RankScope.Origin, - "ms-appx:///Assets/Original_rgba_80.png")); - rankPartitions.Insert( - 2, - new RankPartition( - _resourceToolkit.GetLocaleString(Models.Enums.LanguageNames.Rookie), - Models.Enums.RankScope.Rookie, - "ms-appx:///Assets/Rookie_rgba_80.png")); rankPartitions.ForEach(p => PartitionCollection.Add(p)); @@ -82,10 +69,10 @@ namespace Richasy.Bili.ViewModels.Uwp } else { - var rankInfo = await _controller.GetRankAsync(partition.PartitionId, partition.Scope); - if (rankInfo != null) + var rankList = await _controller.GetRankAsync(partition.PartitionId); + if (rankList?.Any() ?? false) { - videoList = rankInfo.VideoList.Select(p => new VideoViewModel(p)).ToList(); + videoList = rankList.Select(p => new VideoViewModel(p)).ToList(); _cachedRankData.Add(partition, videoList); } } diff --git a/src/ViewModels/ViewModels.Uwp/VideoViewModel/VideoViewModel.Properties.cs b/src/ViewModels/ViewModels.Uwp/VideoViewModel/VideoViewModel.Properties.cs index c5ebfbf01bce94f1776c6e9e9c82f545a1c4aab8..fec4142422c63475a9d6cd6f7593ebe74540f226 100644 --- a/src/ViewModels/ViewModels.Uwp/VideoViewModel/VideoViewModel.Properties.cs +++ b/src/ViewModels/ViewModels.Uwp/VideoViewModel/VideoViewModel.Properties.cs @@ -13,6 +13,11 @@ namespace Richasy.Bili.ViewModels.Uwp { private readonly INumberToolkit _numberToolkit; + /// + /// 分区Id. + /// + public int PartitionId { get; } + /// /// 视频标题. /// diff --git a/src/ViewModels/ViewModels.Uwp/VideoViewModel/VideoViewModel.cs b/src/ViewModels/ViewModels.Uwp/VideoViewModel/VideoViewModel.cs index b0c957b3dc240e7366d30c629dd75bc2b1889c74..c5ad4c744ab8430c70a2ad6034bb54b51950377d 100644 --- a/src/ViewModels/ViewModels.Uwp/VideoViewModel/VideoViewModel.cs +++ b/src/ViewModels/ViewModels.Uwp/VideoViewModel/VideoViewModel.cs @@ -1,6 +1,7 @@ // Copyright (c) Richasy. All rights reserved. using System; +using Bilibili.App.Show.V1; using Richasy.Bili.Locator.Uwp; using Richasy.Bili.Models.BiliBili; @@ -27,6 +28,7 @@ namespace Richasy.Bili.ViewModels.Uwp LikeCount = _numberToolkit.GetCountText(video.LikeCount); VideoId = video.Parameter; PartitionName = video.PartitionName; + PartitionId = video.PartitionId; Source = video; LimitCoverAndAvatar(video.Cover, video.PublisherAvatar); } @@ -35,20 +37,21 @@ namespace Richasy.Bili.ViewModels.Uwp /// Initializes a new instance of the class. /// /// 排行榜视频. - public VideoViewModel(RankVideo video) + public VideoViewModel(RankItem video) : this() { Title = video.Title ?? string.Empty; - PublisherName = video.PublisherInfo.Publisher; + PublisherName = video.Name ?? "--"; Duration = _numberToolkit.GetDurationText(TimeSpan.FromSeconds(video.Duration)); - PlayCount = _numberToolkit.GetCountText(video.Status.PlayCount); - ReplyCount = _numberToolkit.GetCountText(video.Status.ReplyCount); - DanmakuCount = _numberToolkit.GetCountText(video.Status.DanmakuCount); - LikeCount = _numberToolkit.GetCountText(video.Status.LikeCount); - VideoId = video.Aid.ToString(); - PartitionName = video.PartitionName; + PlayCount = _numberToolkit.GetCountText(video.Play); + ReplyCount = _numberToolkit.GetCountText(video.Reply); + DanmakuCount = _numberToolkit.GetCountText(video.Danmaku); + LikeCount = _numberToolkit.GetCountText(video.Like); + VideoId = video.Param; + PartitionName = video.Rname; Source = video; - LimitCoverAndAvatar(video.Cover, video.PublisherInfo.PublisherAvatar); + PartitionId = video.Rid; + LimitCoverAndAvatar(video.Cover, video.Face); } internal VideoViewModel() diff --git a/src/ViewModels/ViewModels.Uwp/ViewModels.Uwp.csproj b/src/ViewModels/ViewModels.Uwp/ViewModels.Uwp.csproj index 3f294ddf15c1fa34cc8369edd5a249aa1d9f7c0f..22132252149709beaad1bb9c16d547da81d87c2c 100644 --- a/src/ViewModels/ViewModels.Uwp/ViewModels.Uwp.csproj +++ b/src/ViewModels/ViewModels.Uwp/ViewModels.Uwp.csproj @@ -69,6 +69,10 @@ {88314412-B020-415B-AEAB-57ADC43B273E} Models.Enums + + {0187840f-8d1a-4198-b5bf-8b05cadb4554} + Models.gRPC + {793EC923-D704-4C6F-9506-EB6A32BFBB8D} Locator.Uwp