From 985e88bc6ff87011531847c829b6e150b7b447a0 Mon Sep 17 00:00:00 2001 From: Steven He Date: Mon, 18 Jul 2022 00:32:38 +0900 Subject: [PATCH 1/2] Get rid of protobuf-net --- BBDown.Core/APP/Header/Device.cs | 127 --- BBDown.Core/APP/Header/FawkesReq.cs | 52 -- BBDown.Core/APP/Header/Locale.cs | 67 -- BBDown.Core/APP/Header/Metadata.cs | 95 --- BBDown.Core/APP/Header/Network.cs | 88 -- BBDown.Core/APP/Header/Restriction.cs | 71 -- BBDown.Core/APP/Header/device.proto | 19 + BBDown.Core/APP/Header/fawkesreq.proto | 8 + BBDown.Core/APP/Header/locale.proto | 12 + BBDown.Core/APP/Header/metadata.proto | 12 + BBDown.Core/APP/Header/network.proto | 25 + BBDown.Core/APP/Header/restriction.proto | 14 + BBDown.Core/APP/Payload/DmViewReq.cs | 70 -- BBDown.Core/APP/Payload/PlayViewReq.cs | 173 ---- BBDown.Core/APP/Payload/dmviewreq.proto | 10 + BBDown.Core/APP/Payload/playviewreq.proto | 24 + BBDown.Core/APP/Response/PlayViewReply.cs | 831 ------------------- BBDown.Core/APP/Response/dmviewreply.proto | 104 +++ BBDown.Core/APP/Response/playviewreply.proto | 129 +++ BBDown.Core/AppHelper.cs | 132 ++- BBDown.Core/BBDown.Core.csproj | 10 +- BBDown/Directory.Build.props | 4 - BBDown/rd.xml | 21 - 23 files changed, 415 insertions(+), 1683 deletions(-) delete mode 100644 BBDown.Core/APP/Header/Device.cs delete mode 100644 BBDown.Core/APP/Header/FawkesReq.cs delete mode 100644 BBDown.Core/APP/Header/Locale.cs delete mode 100644 BBDown.Core/APP/Header/Metadata.cs delete mode 100644 BBDown.Core/APP/Header/Network.cs delete mode 100644 BBDown.Core/APP/Header/Restriction.cs create mode 100644 BBDown.Core/APP/Header/device.proto create mode 100644 BBDown.Core/APP/Header/fawkesreq.proto create mode 100644 BBDown.Core/APP/Header/locale.proto create mode 100644 BBDown.Core/APP/Header/metadata.proto create mode 100644 BBDown.Core/APP/Header/network.proto create mode 100644 BBDown.Core/APP/Header/restriction.proto delete mode 100644 BBDown.Core/APP/Payload/DmViewReq.cs delete mode 100644 BBDown.Core/APP/Payload/PlayViewReq.cs create mode 100644 BBDown.Core/APP/Payload/dmviewreq.proto create mode 100644 BBDown.Core/APP/Payload/playviewreq.proto delete mode 100644 BBDown.Core/APP/Response/PlayViewReply.cs create mode 100644 BBDown.Core/APP/Response/dmviewreply.proto create mode 100644 BBDown.Core/APP/Response/playviewreply.proto delete mode 100644 BBDown/rd.xml diff --git a/BBDown.Core/APP/Header/Device.cs b/BBDown.Core/APP/Header/Device.cs deleted file mode 100644 index ceedbc1bc..000000000 --- a/BBDown.Core/APP/Header/Device.cs +++ /dev/null @@ -1,127 +0,0 @@ -// -// This file was generated by a tool; you should avoid making direct changes. -// Consider using 'partial classes' to extend these types -// Input: my.proto -// - -#region Designer generated code -#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -[global::ProtoBuf.ProtoContract()] -public partial class Device : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - public int appId - { - get => __pbn__appId.GetValueOrDefault(); - set => __pbn__appId = value; - } - public bool ShouldSerializeappId() => __pbn__appId != null; - public void ResetappId() => __pbn__appId = null; - private int? __pbn__appId; - - [global::ProtoBuf.ProtoMember(2, Name = @"build")] - public int Build - { - get => __pbn__Build.GetValueOrDefault(); - set => __pbn__Build = value; - } - public bool ShouldSerializeBuild() => __pbn__Build != null; - public void ResetBuild() => __pbn__Build = null; - private int? __pbn__Build; - - [global::ProtoBuf.ProtoMember(3, Name = @"buvid")] - [global::System.ComponentModel.DefaultValue("")] - public string Buvid - { - get => __pbn__Buvid ?? ""; - set => __pbn__Buvid = value; - } - public bool ShouldSerializeBuvid() => __pbn__Buvid != null; - public void ResetBuvid() => __pbn__Buvid = null; - private string __pbn__Buvid; - - [global::ProtoBuf.ProtoMember(4)] - [global::System.ComponentModel.DefaultValue("")] - public string mobiApp - { - get => __pbn__mobiApp ?? ""; - set => __pbn__mobiApp = value; - } - public bool ShouldSerializemobiApp() => __pbn__mobiApp != null; - public void ResetmobiApp() => __pbn__mobiApp = null; - private string __pbn__mobiApp; - - [global::ProtoBuf.ProtoMember(5, Name = @"platform")] - [global::System.ComponentModel.DefaultValue("")] - public string Platform - { - get => __pbn__Platform ?? ""; - set => __pbn__Platform = value; - } - public bool ShouldSerializePlatform() => __pbn__Platform != null; - public void ResetPlatform() => __pbn__Platform = null; - private string __pbn__Platform; - - [global::ProtoBuf.ProtoMember(6)] - [global::System.ComponentModel.DefaultValue("")] - public string device - { - get => __pbn__device ?? ""; - set => __pbn__device = value; - } - public bool ShouldSerializedevice() => __pbn__device != null; - public void Resetdevice() => __pbn__device = null; - private string __pbn__device; - - [global::ProtoBuf.ProtoMember(7, Name = @"channel")] - [global::System.ComponentModel.DefaultValue("")] - public string Channel - { - get => __pbn__Channel ?? ""; - set => __pbn__Channel = value; - } - public bool ShouldSerializeChannel() => __pbn__Channel != null; - public void ResetChannel() => __pbn__Channel = null; - private string __pbn__Channel; - - [global::ProtoBuf.ProtoMember(8, Name = @"brand")] - [global::System.ComponentModel.DefaultValue("")] - public string Brand - { - get => __pbn__Brand ?? ""; - set => __pbn__Brand = value; - } - public bool ShouldSerializeBrand() => __pbn__Brand != null; - public void ResetBrand() => __pbn__Brand = null; - private string __pbn__Brand; - - [global::ProtoBuf.ProtoMember(9, Name = @"model")] - [global::System.ComponentModel.DefaultValue("")] - public string Model - { - get => __pbn__Model ?? ""; - set => __pbn__Model = value; - } - public bool ShouldSerializeModel() => __pbn__Model != null; - public void ResetModel() => __pbn__Model = null; - private string __pbn__Model; - - [global::ProtoBuf.ProtoMember(10, Name = @"osver")] - [global::System.ComponentModel.DefaultValue("")] - public string Osver - { - get => __pbn__Osver ?? ""; - set => __pbn__Osver = value; - } - public bool ShouldSerializeOsver() => __pbn__Osver != null; - public void ResetOsver() => __pbn__Osver = null; - private string __pbn__Osver; - -} - -#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -#endregion diff --git a/BBDown.Core/APP/Header/FawkesReq.cs b/BBDown.Core/APP/Header/FawkesReq.cs deleted file mode 100644 index c52ba4e1a..000000000 --- a/BBDown.Core/APP/Header/FawkesReq.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// This file was generated by a tool; you should avoid making direct changes. -// Consider using 'partial classes' to extend these types -// Input: fawkesreq.proto -// - -#region Designer generated code -#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -[global::ProtoBuf.ProtoContract()] -public partial class FawkesReq : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"appkey")] - [global::System.ComponentModel.DefaultValue("")] - public string Appkey - { - get => __pbn__Appkey ?? ""; - set => __pbn__Appkey = value; - } - public bool ShouldSerializeAppkey() => __pbn__Appkey != null; - public void ResetAppkey() => __pbn__Appkey = null; - private string __pbn__Appkey; - - [global::ProtoBuf.ProtoMember(2, Name = @"env")] - [global::System.ComponentModel.DefaultValue("")] - public string Env - { - get => __pbn__Env ?? ""; - set => __pbn__Env = value; - } - public bool ShouldSerializeEnv() => __pbn__Env != null; - public void ResetEnv() => __pbn__Env = null; - private string __pbn__Env; - - [global::ProtoBuf.ProtoMember(3)] - [global::System.ComponentModel.DefaultValue("")] - public string sessionId - { - get => __pbn__sessionId ?? ""; - set => __pbn__sessionId = value; - } - public bool ShouldSerializesessionId() => __pbn__sessionId != null; - public void ResetsessionId() => __pbn__sessionId = null; - private string __pbn__sessionId; - -} - -#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -#endregion diff --git a/BBDown.Core/APP/Header/Locale.cs b/BBDown.Core/APP/Header/Locale.cs deleted file mode 100644 index b5d9165ad..000000000 --- a/BBDown.Core/APP/Header/Locale.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// This file was generated by a tool; you should avoid making direct changes. -// Consider using 'partial classes' to extend these types -// Input: locale.proto -// - -#region Designer generated code -#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -[global::ProtoBuf.ProtoContract()] -public partial class Locale : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - public LocaleIds cLocale { get; set; } - - [global::ProtoBuf.ProtoMember(2)] - public LocaleIds sLocale { get; set; } - - [global::ProtoBuf.ProtoContract()] - public partial class LocaleIds : global::ProtoBuf.IExtensible - { - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"language")] - [global::System.ComponentModel.DefaultValue("")] - public string Language - { - get => __pbn__Language ?? ""; - set => __pbn__Language = value; - } - public bool ShouldSerializeLanguage() => __pbn__Language != null; - public void ResetLanguage() => __pbn__Language = null; - private string __pbn__Language; - - [global::ProtoBuf.ProtoMember(2, Name = @"script")] - [global::System.ComponentModel.DefaultValue("")] - public string Script - { - get => __pbn__Script ?? ""; - set => __pbn__Script = value; - } - public bool ShouldSerializeScript() => __pbn__Script != null; - public void ResetScript() => __pbn__Script = null; - private string __pbn__Script; - - [global::ProtoBuf.ProtoMember(3, Name = @"region")] - [global::System.ComponentModel.DefaultValue("")] - public string Region - { - get => __pbn__Region ?? ""; - set => __pbn__Region = value; - } - public bool ShouldSerializeRegion() => __pbn__Region != null; - public void ResetRegion() => __pbn__Region = null; - private string __pbn__Region; - - } - -} - -#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -#endregion diff --git a/BBDown.Core/APP/Header/Metadata.cs b/BBDown.Core/APP/Header/Metadata.cs deleted file mode 100644 index 978859b71..000000000 --- a/BBDown.Core/APP/Header/Metadata.cs +++ /dev/null @@ -1,95 +0,0 @@ -// -// This file was generated by a tool; you should avoid making direct changes. -// Consider using 'partial classes' to extend these types -// Input: metadata.proto -// - -#region Designer generated code -#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -[global::ProtoBuf.ProtoContract()] -public partial class Metadata : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - [global::System.ComponentModel.DefaultValue("")] - public string accessKey - { - get => __pbn__accessKey ?? ""; - set => __pbn__accessKey = value; - } - public bool ShouldSerializeaccessKey() => __pbn__accessKey != null; - public void ResetaccessKey() => __pbn__accessKey = null; - private string __pbn__accessKey; - - [global::ProtoBuf.ProtoMember(2)] - [global::System.ComponentModel.DefaultValue("")] - public string mobiApp - { - get => __pbn__mobiApp ?? ""; - set => __pbn__mobiApp = value; - } - public bool ShouldSerializemobiApp() => __pbn__mobiApp != null; - public void ResetmobiApp() => __pbn__mobiApp = null; - private string __pbn__mobiApp; - - [global::ProtoBuf.ProtoMember(3, Name = @"device")] - [global::System.ComponentModel.DefaultValue("")] - public string Device - { - get => __pbn__Device ?? ""; - set => __pbn__Device = value; - } - public bool ShouldSerializeDevice() => __pbn__Device != null; - public void ResetDevice() => __pbn__Device = null; - private string __pbn__Device; - - [global::ProtoBuf.ProtoMember(4, Name = @"build")] - public int Build - { - get => __pbn__Build.GetValueOrDefault(); - set => __pbn__Build = value; - } - public bool ShouldSerializeBuild() => __pbn__Build != null; - public void ResetBuild() => __pbn__Build = null; - private int? __pbn__Build; - - [global::ProtoBuf.ProtoMember(5, Name = @"channel")] - [global::System.ComponentModel.DefaultValue("")] - public string Channel - { - get => __pbn__Channel ?? ""; - set => __pbn__Channel = value; - } - public bool ShouldSerializeChannel() => __pbn__Channel != null; - public void ResetChannel() => __pbn__Channel = null; - private string __pbn__Channel; - - [global::ProtoBuf.ProtoMember(6, Name = @"buvid")] - [global::System.ComponentModel.DefaultValue("")] - public string Buvid - { - get => __pbn__Buvid ?? ""; - set => __pbn__Buvid = value; - } - public bool ShouldSerializeBuvid() => __pbn__Buvid != null; - public void ResetBuvid() => __pbn__Buvid = null; - private string __pbn__Buvid; - - [global::ProtoBuf.ProtoMember(7, Name = @"platform")] - [global::System.ComponentModel.DefaultValue("")] - public string Platform - { - get => __pbn__Platform ?? ""; - set => __pbn__Platform = value; - } - public bool ShouldSerializePlatform() => __pbn__Platform != null; - public void ResetPlatform() => __pbn__Platform = null; - private string __pbn__Platform; - -} - -#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -#endregion diff --git a/BBDown.Core/APP/Header/Network.cs b/BBDown.Core/APP/Header/Network.cs deleted file mode 100644 index ff02dfb29..000000000 --- a/BBDown.Core/APP/Header/Network.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// This file was generated by a tool; you should avoid making direct changes. -// Consider using 'partial classes' to extend these types -// Input: network.proto -// - -#region Designer generated code -#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -[global::ProtoBuf.ProtoContract()] -public partial class Network : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - [global::System.ComponentModel.DefaultValue(Type.NtUnknown)] - public Type type - { - get => __pbn__type ?? Type.NtUnknown; - set => __pbn__type = value; - } - public bool ShouldSerializetype() => __pbn__type != null; - public void Resettype() => __pbn__type = null; - private Type? __pbn__type; - - [global::ProtoBuf.ProtoMember(2)] - [global::System.ComponentModel.DefaultValue(Tf.TfUnknown)] - public Tf tf - { - get => __pbn__tf ?? Tf.TfUnknown; - set => __pbn__tf = value; - } - public bool ShouldSerializetf() => __pbn__tf != null; - public void Resettf() => __pbn__tf = null; - private Tf? __pbn__tf; - - [global::ProtoBuf.ProtoMember(3, Name = @"oid")] - [global::System.ComponentModel.DefaultValue("")] - public string Oid - { - get => __pbn__Oid ?? ""; - set => __pbn__Oid = value; - } - public bool ShouldSerializeOid() => __pbn__Oid != null; - public void ResetOid() => __pbn__Oid = null; - private string __pbn__Oid; - - [global::ProtoBuf.ProtoContract(Name = @"TYPE")] - public enum Type - { - [global::ProtoBuf.ProtoEnum(Name = @"NT_UNKNOWN")] - NtUnknown = 0, - [global::ProtoBuf.ProtoEnum(Name = @"WIFI")] - Wifi = 1, - [global::ProtoBuf.ProtoEnum(Name = @"CELLULAR")] - Cellular = 2, - [global::ProtoBuf.ProtoEnum(Name = @"OFFLINE")] - Offline = 3, - [global::ProtoBuf.ProtoEnum(Name = @"OTHERNET")] - Othernet = 4, - [global::ProtoBuf.ProtoEnum(Name = @"ETHERNET")] - Ethernet = 5, - } - - [global::ProtoBuf.ProtoContract(Name = @"TF")] - public enum Tf - { - [global::ProtoBuf.ProtoEnum(Name = @"TF_UNKNOWN")] - TfUnknown = 0, - [global::ProtoBuf.ProtoEnum(Name = @"U_CARD")] - UCard = 1, - [global::ProtoBuf.ProtoEnum(Name = @"U_PKG")] - UPkg = 2, - [global::ProtoBuf.ProtoEnum(Name = @"C_CARD")] - CCard = 3, - [global::ProtoBuf.ProtoEnum(Name = @"C_PKG")] - CPkg = 4, - [global::ProtoBuf.ProtoEnum(Name = @"T_CARD")] - TCard = 5, - [global::ProtoBuf.ProtoEnum(Name = @"T_PKG")] - TPkg = 6, - } - -} - -#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -#endregion diff --git a/BBDown.Core/APP/Header/Restriction.cs b/BBDown.Core/APP/Header/Restriction.cs deleted file mode 100644 index 3dfdf3ce2..000000000 --- a/BBDown.Core/APP/Header/Restriction.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// This file was generated by a tool; you should avoid making direct changes. -// Consider using 'partial classes' to extend these types -// Input: restriction.proto -// - -#region Designer generated code -#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -[global::ProtoBuf.ProtoContract()] -public partial class Restriction : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - public bool teenagersMode - { - get => __pbn__teenagersMode.GetValueOrDefault(); - set => __pbn__teenagersMode = value; - } - public bool ShouldSerializeteenagersMode() => __pbn__teenagersMode != null; - public void ResetteenagersMode() => __pbn__teenagersMode = null; - private bool? __pbn__teenagersMode; - - [global::ProtoBuf.ProtoMember(2)] - public bool lessonsMode - { - get => __pbn__lessonsMode.GetValueOrDefault(); - set => __pbn__lessonsMode = value; - } - public bool ShouldSerializelessonsMode() => __pbn__lessonsMode != null; - public void ResetlessonsMode() => __pbn__lessonsMode = null; - private bool? __pbn__lessonsMode; - - [global::ProtoBuf.ProtoMember(3)] - [global::System.ComponentModel.DefaultValue(Mode.Normal)] - public Mode mode - { - get => __pbn__mode ?? Mode.Normal; - set => __pbn__mode = value; - } - public bool ShouldSerializemode() => __pbn__mode != null; - public void Resetmode() => __pbn__mode = null; - private Mode? __pbn__mode; - - [global::ProtoBuf.ProtoMember(4, Name = @"review")] - public bool Review - { - get => __pbn__Review.GetValueOrDefault(); - set => __pbn__Review = value; - } - public bool ShouldSerializeReview() => __pbn__Review != null; - public void ResetReview() => __pbn__Review = null; - private bool? __pbn__Review; - - [global::ProtoBuf.ProtoContract()] - public enum Mode - { - [global::ProtoBuf.ProtoEnum(Name = @"NORMAL")] - Normal = 0, - [global::ProtoBuf.ProtoEnum(Name = @"TEENAGERS")] - Teenagers = 1, - [global::ProtoBuf.ProtoEnum(Name = @"LESSONS")] - Lessons = 2, - } - -} - -#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -#endregion diff --git a/BBDown.Core/APP/Header/device.proto b/BBDown.Core/APP/Header/device.proto new file mode 100644 index 000000000..2193da416 --- /dev/null +++ b/BBDown.Core/APP/Header/device.proto @@ -0,0 +1,19 @@ +syntax = "proto2"; +option csharp_namespace = "BBDown.Core.Protobuf"; + +message Device { + optional int32 appId = 1; + optional int32 build = 2; + optional string buvid = 3; + optional string mobiApp = 4; + optional string platform = 5; + optional string device = 6; + optional string channel = 7; + optional string brand = 8; + optional string model = 9; + optional string osver = 10; + optional string fpLocal = 11; + optional string fpRemote = 12; + optional string versionName = 13; + optional string fp = 14; +} \ No newline at end of file diff --git a/BBDown.Core/APP/Header/fawkesreq.proto b/BBDown.Core/APP/Header/fawkesreq.proto new file mode 100644 index 000000000..c42b37209 --- /dev/null +++ b/BBDown.Core/APP/Header/fawkesreq.proto @@ -0,0 +1,8 @@ +syntax = "proto2"; +option csharp_namespace = "BBDown.Core.Protobuf"; + +message FawkesReq { + optional string appkey = 1; + optional string env = 2; + optional string sessionId = 3; +} \ No newline at end of file diff --git a/BBDown.Core/APP/Header/locale.proto b/BBDown.Core/APP/Header/locale.proto new file mode 100644 index 000000000..f2a905571 --- /dev/null +++ b/BBDown.Core/APP/Header/locale.proto @@ -0,0 +1,12 @@ +syntax = "proto2"; +option csharp_namespace = "BBDown.Core.Protobuf"; + +message Locale { + message LocaleIds { + optional string language = 1; + optional string script = 2; + optional string region = 3; + } + optional LocaleIds cLocale = 1; + optional LocaleIds sLocale = 2; +} \ No newline at end of file diff --git a/BBDown.Core/APP/Header/metadata.proto b/BBDown.Core/APP/Header/metadata.proto new file mode 100644 index 000000000..dbfa035e8 --- /dev/null +++ b/BBDown.Core/APP/Header/metadata.proto @@ -0,0 +1,12 @@ +syntax = "proto2"; +option csharp_namespace = "BBDown.Core.Protobuf"; + +message Metadata { + optional string accessKey = 1; + optional string mobiApp = 2; + optional string device = 3; + optional int32 build = 4; + optional string channel = 5; + optional string buvid = 6; + optional string platform = 7; +} \ No newline at end of file diff --git a/BBDown.Core/APP/Header/network.proto b/BBDown.Core/APP/Header/network.proto new file mode 100644 index 000000000..672a20e8d --- /dev/null +++ b/BBDown.Core/APP/Header/network.proto @@ -0,0 +1,25 @@ +syntax = "proto2"; +option csharp_namespace = "BBDown.Core.Protobuf"; + +message Network { + enum TYPE { + NT_UNKNOWN = 0; + WIFI = 1; + CELLULAR = 2; + OFFLINE = 3; + OTHERNET = 4; + ETHERNET = 5; + } + optional TYPE type = 1; + enum TF { + TF_UNKNOWN = 0; + U_CARD = 1; + U_PKG = 2; + C_CARD = 3; + C_PKG = 4; + T_CARD = 5; + T_PKG = 6; + } + optional TF tf = 2; + optional string oid = 3; +} \ No newline at end of file diff --git a/BBDown.Core/APP/Header/restriction.proto b/BBDown.Core/APP/Header/restriction.proto new file mode 100644 index 000000000..9c5bd869f --- /dev/null +++ b/BBDown.Core/APP/Header/restriction.proto @@ -0,0 +1,14 @@ +syntax = "proto2"; +option csharp_namespace = "BBDown.Core.Protobuf"; + +message Restriction { + optional bool teenagersMode = 1; + optional bool lessonsMode = 2; + enum Mode { + NORMAL = 0; + TEENAGERS = 1; + LESSONS = 2; + } + optional Mode mode = 3; + optional bool review = 4; +} \ No newline at end of file diff --git a/BBDown.Core/APP/Payload/DmViewReq.cs b/BBDown.Core/APP/Payload/DmViewReq.cs deleted file mode 100644 index c36a62d78..000000000 --- a/BBDown.Core/APP/Payload/DmViewReq.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// This file was generated by a tool; you should avoid making direct changes. -// Consider using 'partial classes' to extend these types -// Input: dmviewreq.proto -// - -#region Designer generated code -#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -[global::ProtoBuf.ProtoContract()] -public partial class DmViewReq : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"pid")] - public long Pid - { - get => __pbn__Pid.GetValueOrDefault(); - set => __pbn__Pid = value; - } - public bool ShouldSerializePid() => __pbn__Pid != null; - public void ResetPid() => __pbn__Pid = null; - private long? __pbn__Pid; - - [global::ProtoBuf.ProtoMember(2, Name = @"oid")] - public long Oid - { - get => __pbn__Oid.GetValueOrDefault(); - set => __pbn__Oid = value; - } - public bool ShouldSerializeOid() => __pbn__Oid != null; - public void ResetOid() => __pbn__Oid = null; - private long? __pbn__Oid; - - [global::ProtoBuf.ProtoMember(3, Name = @"type")] - public int Type - { - get => __pbn__Type.GetValueOrDefault(); - set => __pbn__Type = value; - } - public bool ShouldSerializeType() => __pbn__Type != null; - public void ResetType() => __pbn__Type = null; - private int? __pbn__Type; - - [global::ProtoBuf.ProtoMember(4, Name = @"spmid")] - [global::System.ComponentModel.DefaultValue("")] - public string Spmid - { - get => __pbn__Spmid ?? ""; - set => __pbn__Spmid = value; - } - public bool ShouldSerializeSpmid() => __pbn__Spmid != null; - public void ResetSpmid() => __pbn__Spmid = null; - private string __pbn__Spmid; - - [global::ProtoBuf.ProtoMember(5)] - public int isHardBoot - { - get => __pbn__isHardBoot.GetValueOrDefault(); - set => __pbn__isHardBoot = value; - } - public bool ShouldSerializeisHardBoot() => __pbn__isHardBoot != null; - public void ResetisHardBoot() => __pbn__isHardBoot = null; - private int? __pbn__isHardBoot; - -} - -#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -#endregion diff --git a/BBDown.Core/APP/Payload/PlayViewReq.cs b/BBDown.Core/APP/Payload/PlayViewReq.cs deleted file mode 100644 index 6e3d73af0..000000000 --- a/BBDown.Core/APP/Payload/PlayViewReq.cs +++ /dev/null @@ -1,173 +0,0 @@ -// -// This file was generated by a tool; you should avoid making direct changes. -// Consider using 'partial classes' to extend these types -// Input: playviewreq.proto -// - -#region Designer generated code -#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -[global::ProtoBuf.ProtoContract()] -public partial class PlayViewReq : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - public long epId - { - get => __pbn__epId.GetValueOrDefault(); - set => __pbn__epId = value; - } - public bool ShouldSerializeepId() => __pbn__epId != null; - public void ResetepId() => __pbn__epId = null; - private long? __pbn__epId; - - [global::ProtoBuf.ProtoMember(2, Name = @"cid")] - public long Cid - { - get => __pbn__Cid.GetValueOrDefault(); - set => __pbn__Cid = value; - } - public bool ShouldSerializeCid() => __pbn__Cid != null; - public void ResetCid() => __pbn__Cid = null; - private long? __pbn__Cid; - - [global::ProtoBuf.ProtoMember(3, Name = @"qn")] - public long Qn - { - get => __pbn__Qn.GetValueOrDefault(); - set => __pbn__Qn = value; - } - public bool ShouldSerializeQn() => __pbn__Qn != null; - public void ResetQn() => __pbn__Qn = null; - private long? __pbn__Qn; - - [global::ProtoBuf.ProtoMember(4, Name = @"fnver")] - public int Fnver - { - get => __pbn__Fnver.GetValueOrDefault(); - set => __pbn__Fnver = value; - } - public bool ShouldSerializeFnver() => __pbn__Fnver != null; - public void ResetFnver() => __pbn__Fnver = null; - private int? __pbn__Fnver; - - [global::ProtoBuf.ProtoMember(5, Name = @"fnval")] - public int Fnval - { - get => __pbn__Fnval.GetValueOrDefault(); - set => __pbn__Fnval = value; - } - public bool ShouldSerializeFnval() => __pbn__Fnval != null; - public void ResetFnval() => __pbn__Fnval = null; - private int? __pbn__Fnval; - - [global::ProtoBuf.ProtoMember(6, Name = @"download")] - public uint Download - { - get => __pbn__Download.GetValueOrDefault(); - set => __pbn__Download = value; - } - public bool ShouldSerializeDownload() => __pbn__Download != null; - public void ResetDownload() => __pbn__Download = null; - private uint? __pbn__Download; - - [global::ProtoBuf.ProtoMember(7)] - public int forceHost - { - get => __pbn__forceHost.GetValueOrDefault(); - set => __pbn__forceHost = value; - } - public bool ShouldSerializeforceHost() => __pbn__forceHost != null; - public void ResetforceHost() => __pbn__forceHost = null; - private int? __pbn__forceHost; - - [global::ProtoBuf.ProtoMember(8, Name = @"fourk")] - public bool Fourk - { - get => __pbn__Fourk.GetValueOrDefault(); - set => __pbn__Fourk = value; - } - public bool ShouldSerializeFourk() => __pbn__Fourk != null; - public void ResetFourk() => __pbn__Fourk = null; - private bool? __pbn__Fourk; - - [global::ProtoBuf.ProtoMember(9, Name = @"spmid")] - [global::System.ComponentModel.DefaultValue("")] - public string Spmid - { - get => __pbn__Spmid ?? ""; - set => __pbn__Spmid = value; - } - public bool ShouldSerializeSpmid() => __pbn__Spmid != null; - public void ResetSpmid() => __pbn__Spmid = null; - private string __pbn__Spmid; - - [global::ProtoBuf.ProtoMember(10)] - [global::System.ComponentModel.DefaultValue("")] - public string fromSpmid - { - get => __pbn__fromSpmid ?? ""; - set => __pbn__fromSpmid = value; - } - public bool ShouldSerializefromSpmid() => __pbn__fromSpmid != null; - public void ResetfromSpmid() => __pbn__fromSpmid = null; - private string __pbn__fromSpmid; - - [global::ProtoBuf.ProtoMember(11)] - public int teenagersMode - { - get => __pbn__teenagersMode.GetValueOrDefault(); - set => __pbn__teenagersMode = value; - } - public bool ShouldSerializeteenagersMode() => __pbn__teenagersMode != null; - public void ResetteenagersMode() => __pbn__teenagersMode = null; - private int? __pbn__teenagersMode; - - [global::ProtoBuf.ProtoMember(12)] - [global::System.ComponentModel.DefaultValue(CodeType.Nocode)] - public CodeType preferCodecType - { - get => __pbn__preferCodecType ?? CodeType.Nocode; - set => __pbn__preferCodecType = value; - } - public bool ShouldSerializepreferCodecType() => __pbn__preferCodecType != null; - public void ResetpreferCodecType() => __pbn__preferCodecType = null; - private CodeType? __pbn__preferCodecType; - - [global::ProtoBuf.ProtoMember(13)] - public bool isPreview - { - get => __pbn__isPreview.GetValueOrDefault(); - set => __pbn__isPreview = value; - } - public bool ShouldSerializeisPreview() => __pbn__isPreview != null; - public void ResetisPreview() => __pbn__isPreview = null; - private bool? __pbn__isPreview; - - [global::ProtoBuf.ProtoMember(14)] - public long roomId - { - get => __pbn__roomId.GetValueOrDefault(); - set => __pbn__roomId = value; - } - public bool ShouldSerializeroomId() => __pbn__roomId != null; - public void ResetroomId() => __pbn__roomId = null; - private long? __pbn__roomId; - - [global::ProtoBuf.ProtoContract()] - public enum CodeType - { - [global::ProtoBuf.ProtoEnum(Name = @"NOCODE")] - Nocode = 0, - [global::ProtoBuf.ProtoEnum(Name = @"CODE264")] - Code264 = 1, - [global::ProtoBuf.ProtoEnum(Name = @"CODE265")] - Code265 = 2, - } - -} - -#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -#endregion diff --git a/BBDown.Core/APP/Payload/dmviewreq.proto b/BBDown.Core/APP/Payload/dmviewreq.proto new file mode 100644 index 000000000..16b6e5331 --- /dev/null +++ b/BBDown.Core/APP/Payload/dmviewreq.proto @@ -0,0 +1,10 @@ +syntax = "proto2"; +option csharp_namespace = "BBDown.Core.Protobuf"; + +message DmViewReq { + optional int64 pid = 1; + optional int64 oid = 2; + optional int32 type = 3; + optional string spmid = 4; + optional int32 isHardBoot = 5; +} \ No newline at end of file diff --git a/BBDown.Core/APP/Payload/playviewreq.proto b/BBDown.Core/APP/Payload/playviewreq.proto new file mode 100644 index 000000000..b47fdfd56 --- /dev/null +++ b/BBDown.Core/APP/Payload/playviewreq.proto @@ -0,0 +1,24 @@ +syntax = "proto2"; +option csharp_namespace = "BBDown.Core.Protobuf"; + +message PlayViewReq { + optional int64 epId = 1; + optional int64 cid = 2; + optional int64 qn = 3; + optional int32 fnver = 4; + optional int32 fnval = 5; + optional uint32 download = 6; + optional int32 forceHost = 7; + optional bool fourk = 8; + optional string spmid = 9; + optional string fromSpmid = 10; + optional int32 teenagersMode = 11; + enum CodeType { + NOCODE = 0; + CODE264 = 1; + CODE265 = 2; + } + optional CodeType preferCodecType = 12; + optional bool isPreview = 13; + optional int64 roomId = 14; +} \ No newline at end of file diff --git a/BBDown.Core/APP/Response/PlayViewReply.cs b/BBDown.Core/APP/Response/PlayViewReply.cs deleted file mode 100644 index d4f9db623..000000000 --- a/BBDown.Core/APP/Response/PlayViewReply.cs +++ /dev/null @@ -1,831 +0,0 @@ -// -// This file was generated by a tool; you should avoid making direct changes. -// Consider using 'partial classes' to extend these types -// Input: playviewreply.proto -// - -#region Designer generated code -#pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -[global::ProtoBuf.ProtoContract()] -public partial class VideoInfo : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"quality")] - public uint Quality - { - get => __pbn__Quality.GetValueOrDefault(); - set => __pbn__Quality = value; - } - public bool ShouldSerializeQuality() => __pbn__Quality != null; - public void ResetQuality() => __pbn__Quality = null; - private uint? __pbn__Quality; - - [global::ProtoBuf.ProtoMember(2, Name = @"format")] - [global::System.ComponentModel.DefaultValue("")] - public string Format - { - get => __pbn__Format ?? ""; - set => __pbn__Format = value; - } - public bool ShouldSerializeFormat() => __pbn__Format != null; - public void ResetFormat() => __pbn__Format = null; - private string __pbn__Format; - - [global::ProtoBuf.ProtoMember(3, Name = @"timelength")] - public ulong Timelength - { - get => __pbn__Timelength.GetValueOrDefault(); - set => __pbn__Timelength = value; - } - public bool ShouldSerializeTimelength() => __pbn__Timelength != null; - public void ResetTimelength() => __pbn__Timelength = null; - private ulong? __pbn__Timelength; - - [global::ProtoBuf.ProtoMember(4)] - public uint videoCodecid - { - get => __pbn__videoCodecid.GetValueOrDefault(); - set => __pbn__videoCodecid = value; - } - public bool ShouldSerializevideoCodecid() => __pbn__videoCodecid != null; - public void ResetvideoCodecid() => __pbn__videoCodecid = null; - private uint? __pbn__videoCodecid; - - [global::ProtoBuf.ProtoMember(5, Name = @"streamList")] - public global::System.Collections.Generic.List streamLists { get; } = new global::System.Collections.Generic.List(); - - [global::ProtoBuf.ProtoMember(6, Name = @"dashAudio")] - public global::System.Collections.Generic.List dashAudioes { get; } = new global::System.Collections.Generic.List(); - - [global::ProtoBuf.ProtoMember(7, Name = @"dolby")] - public DolbyItem Dolby { get; set; } - -} - -[global::ProtoBuf.ProtoContract()] -public partial class DolbyItem : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"type")] - public int Type - { - get => __pbn__Type.GetValueOrDefault(); - set => __pbn__Type = value; - } - public bool ShouldSerializeType() => __pbn__Type != null; - public void ResetType() => __pbn__Type = null; - private int? __pbn__Type; - - [global::ProtoBuf.ProtoMember(2, Name = @"audio")] - public DashItem Audio { get; set; } - -} - -[global::ProtoBuf.ProtoContract()] -public partial class PlayAbilityConf : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - public bool backgroundPlayDisable - { - get => __pbn__backgroundPlayDisable.GetValueOrDefault(); - set => __pbn__backgroundPlayDisable = value; - } - public bool ShouldSerializebackgroundPlayDisable() => __pbn__backgroundPlayDisable != null; - public void ResetbackgroundPlayDisable() => __pbn__backgroundPlayDisable = null; - private bool? __pbn__backgroundPlayDisable; - - [global::ProtoBuf.ProtoMember(2)] - public bool flipDisable - { - get => __pbn__flipDisable.GetValueOrDefault(); - set => __pbn__flipDisable = value; - } - public bool ShouldSerializeflipDisable() => __pbn__flipDisable != null; - public void ResetflipDisable() => __pbn__flipDisable = null; - private bool? __pbn__flipDisable; - - [global::ProtoBuf.ProtoMember(3)] - public bool castDisable - { - get => __pbn__castDisable.GetValueOrDefault(); - set => __pbn__castDisable = value; - } - public bool ShouldSerializecastDisable() => __pbn__castDisable != null; - public void ResetcastDisable() => __pbn__castDisable = null; - private bool? __pbn__castDisable; - - [global::ProtoBuf.ProtoMember(4)] - public bool feedbackDisable - { - get => __pbn__feedbackDisable.GetValueOrDefault(); - set => __pbn__feedbackDisable = value; - } - public bool ShouldSerializefeedbackDisable() => __pbn__feedbackDisable != null; - public void ResetfeedbackDisable() => __pbn__feedbackDisable = null; - private bool? __pbn__feedbackDisable; - - [global::ProtoBuf.ProtoMember(5)] - public bool subtitleDisable - { - get => __pbn__subtitleDisable.GetValueOrDefault(); - set => __pbn__subtitleDisable = value; - } - public bool ShouldSerializesubtitleDisable() => __pbn__subtitleDisable != null; - public void ResetsubtitleDisable() => __pbn__subtitleDisable = null; - private bool? __pbn__subtitleDisable; - - [global::ProtoBuf.ProtoMember(6)] - public bool playbackRateDisable - { - get => __pbn__playbackRateDisable.GetValueOrDefault(); - set => __pbn__playbackRateDisable = value; - } - public bool ShouldSerializeplaybackRateDisable() => __pbn__playbackRateDisable != null; - public void ResetplaybackRateDisable() => __pbn__playbackRateDisable = null; - private bool? __pbn__playbackRateDisable; - - [global::ProtoBuf.ProtoMember(7)] - public bool timeUpDisable - { - get => __pbn__timeUpDisable.GetValueOrDefault(); - set => __pbn__timeUpDisable = value; - } - public bool ShouldSerializetimeUpDisable() => __pbn__timeUpDisable != null; - public void ResettimeUpDisable() => __pbn__timeUpDisable = null; - private bool? __pbn__timeUpDisable; - - [global::ProtoBuf.ProtoMember(8)] - public bool playbackModeDisable - { - get => __pbn__playbackModeDisable.GetValueOrDefault(); - set => __pbn__playbackModeDisable = value; - } - public bool ShouldSerializeplaybackModeDisable() => __pbn__playbackModeDisable != null; - public void ResetplaybackModeDisable() => __pbn__playbackModeDisable = null; - private bool? __pbn__playbackModeDisable; - - [global::ProtoBuf.ProtoMember(9)] - public bool scaleModeDisable - { - get => __pbn__scaleModeDisable.GetValueOrDefault(); - set => __pbn__scaleModeDisable = value; - } - public bool ShouldSerializescaleModeDisable() => __pbn__scaleModeDisable != null; - public void ResetscaleModeDisable() => __pbn__scaleModeDisable = null; - private bool? __pbn__scaleModeDisable; - - [global::ProtoBuf.ProtoMember(10)] - public bool likeDisable - { - get => __pbn__likeDisable.GetValueOrDefault(); - set => __pbn__likeDisable = value; - } - public bool ShouldSerializelikeDisable() => __pbn__likeDisable != null; - public void ResetlikeDisable() => __pbn__likeDisable = null; - private bool? __pbn__likeDisable; - - [global::ProtoBuf.ProtoMember(11)] - public bool dislikeDisable - { - get => __pbn__dislikeDisable.GetValueOrDefault(); - set => __pbn__dislikeDisable = value; - } - public bool ShouldSerializedislikeDisable() => __pbn__dislikeDisable != null; - public void ResetdislikeDisable() => __pbn__dislikeDisable = null; - private bool? __pbn__dislikeDisable; - - [global::ProtoBuf.ProtoMember(12)] - public bool coinDisable - { - get => __pbn__coinDisable.GetValueOrDefault(); - set => __pbn__coinDisable = value; - } - public bool ShouldSerializecoinDisable() => __pbn__coinDisable != null; - public void ResetcoinDisable() => __pbn__coinDisable = null; - private bool? __pbn__coinDisable; - - [global::ProtoBuf.ProtoMember(13)] - public bool elecDisable - { - get => __pbn__elecDisable.GetValueOrDefault(); - set => __pbn__elecDisable = value; - } - public bool ShouldSerializeelecDisable() => __pbn__elecDisable != null; - public void ResetelecDisable() => __pbn__elecDisable = null; - private bool? __pbn__elecDisable; - - [global::ProtoBuf.ProtoMember(14)] - public bool shareDisable - { - get => __pbn__shareDisable.GetValueOrDefault(); - set => __pbn__shareDisable = value; - } - public bool ShouldSerializeshareDisable() => __pbn__shareDisable != null; - public void ResetshareDisable() => __pbn__shareDisable = null; - private bool? __pbn__shareDisable; - - [global::ProtoBuf.ProtoMember(15)] - public bool screenShotDisable - { - get => __pbn__screenShotDisable.GetValueOrDefault(); - set => __pbn__screenShotDisable = value; - } - public bool ShouldSerializescreenShotDisable() => __pbn__screenShotDisable != null; - public void ResetscreenShotDisable() => __pbn__screenShotDisable = null; - private bool? __pbn__screenShotDisable; - - [global::ProtoBuf.ProtoMember(16)] - public bool lockScreenDisable - { - get => __pbn__lockScreenDisable.GetValueOrDefault(); - set => __pbn__lockScreenDisable = value; - } - public bool ShouldSerializelockScreenDisable() => __pbn__lockScreenDisable != null; - public void ResetlockScreenDisable() => __pbn__lockScreenDisable = null; - private bool? __pbn__lockScreenDisable; - - [global::ProtoBuf.ProtoMember(17)] - public bool recommendDisable - { - get => __pbn__recommendDisable.GetValueOrDefault(); - set => __pbn__recommendDisable = value; - } - public bool ShouldSerializerecommendDisable() => __pbn__recommendDisable != null; - public void ResetrecommendDisable() => __pbn__recommendDisable = null; - private bool? __pbn__recommendDisable; - - [global::ProtoBuf.ProtoMember(18)] - public bool playbackSpeedDisable - { - get => __pbn__playbackSpeedDisable.GetValueOrDefault(); - set => __pbn__playbackSpeedDisable = value; - } - public bool ShouldSerializeplaybackSpeedDisable() => __pbn__playbackSpeedDisable != null; - public void ResetplaybackSpeedDisable() => __pbn__playbackSpeedDisable = null; - private bool? __pbn__playbackSpeedDisable; - - [global::ProtoBuf.ProtoMember(19)] - public bool definitionDisable - { - get => __pbn__definitionDisable.GetValueOrDefault(); - set => __pbn__definitionDisable = value; - } - public bool ShouldSerializedefinitionDisable() => __pbn__definitionDisable != null; - public void ResetdefinitionDisable() => __pbn__definitionDisable = null; - private bool? __pbn__definitionDisable; - - [global::ProtoBuf.ProtoMember(20)] - public bool selectionsDisable - { - get => __pbn__selectionsDisable.GetValueOrDefault(); - set => __pbn__selectionsDisable = value; - } - public bool ShouldSerializeselectionsDisable() => __pbn__selectionsDisable != null; - public void ResetselectionsDisable() => __pbn__selectionsDisable = null; - private bool? __pbn__selectionsDisable; - - [global::ProtoBuf.ProtoMember(21)] - public bool nextDisable - { - get => __pbn__nextDisable.GetValueOrDefault(); - set => __pbn__nextDisable = value; - } - public bool ShouldSerializenextDisable() => __pbn__nextDisable != null; - public void ResetnextDisable() => __pbn__nextDisable = null; - private bool? __pbn__nextDisable; - - [global::ProtoBuf.ProtoMember(22)] - public bool editDmDisable - { - get => __pbn__editDmDisable.GetValueOrDefault(); - set => __pbn__editDmDisable = value; - } - public bool ShouldSerializeeditDmDisable() => __pbn__editDmDisable != null; - public void ReseteditDmDisable() => __pbn__editDmDisable = null; - private bool? __pbn__editDmDisable; - - [global::ProtoBuf.ProtoMember(23)] - public bool smallWindowDisable - { - get => __pbn__smallWindowDisable.GetValueOrDefault(); - set => __pbn__smallWindowDisable = value; - } - public bool ShouldSerializesmallWindowDisable() => __pbn__smallWindowDisable != null; - public void ResetsmallWindowDisable() => __pbn__smallWindowDisable = null; - private bool? __pbn__smallWindowDisable; - - [global::ProtoBuf.ProtoMember(24)] - public bool shakeDisable - { - get => __pbn__shakeDisable.GetValueOrDefault(); - set => __pbn__shakeDisable = value; - } - public bool ShouldSerializeshakeDisable() => __pbn__shakeDisable != null; - public void ResetshakeDisable() => __pbn__shakeDisable = null; - private bool? __pbn__shakeDisable; - -} - -[global::ProtoBuf.ProtoContract()] -public partial class BusinessInfo : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - public bool isPreview - { - get => __pbn__isPreview.GetValueOrDefault(); - set => __pbn__isPreview = value; - } - public bool ShouldSerializeisPreview() => __pbn__isPreview != null; - public void ResetisPreview() => __pbn__isPreview = null; - private bool? __pbn__isPreview; - - [global::ProtoBuf.ProtoMember(2, Name = @"bp")] - public bool Bp - { - get => __pbn__Bp.GetValueOrDefault(); - set => __pbn__Bp = value; - } - public bool ShouldSerializeBp() => __pbn__Bp != null; - public void ResetBp() => __pbn__Bp = null; - private bool? __pbn__Bp; - - [global::ProtoBuf.ProtoMember(3)] - [global::System.ComponentModel.DefaultValue("")] - public string marlinToken - { - get => __pbn__marlinToken ?? ""; - set => __pbn__marlinToken = value; - } - public bool ShouldSerializemarlinToken() => __pbn__marlinToken != null; - public void ResetmarlinToken() => __pbn__marlinToken = null; - private string __pbn__marlinToken; - -} - -[global::ProtoBuf.ProtoContract()] -public partial class Event : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"shake")] - public Shake Shake { get; set; } - -} - -[global::ProtoBuf.ProtoContract()] -public partial class Shake : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"file")] - [global::System.ComponentModel.DefaultValue("")] - public string File - { - get => __pbn__File ?? ""; - set => __pbn__File = value; - } - public bool ShouldSerializeFile() => __pbn__File != null; - public void ResetFile() => __pbn__File = null; - private string __pbn__File; - -} - -[global::ProtoBuf.ProtoContract()] -public partial class DashItem : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"id")] - public uint Id - { - get => __pbn__Id.GetValueOrDefault(); - set => __pbn__Id = value; - } - public bool ShouldSerializeId() => __pbn__Id != null; - public void ResetId() => __pbn__Id = null; - private uint? __pbn__Id; - - [global::ProtoBuf.ProtoMember(2)] - [global::System.ComponentModel.DefaultValue("")] - public string baseUrl - { - get => __pbn__baseUrl ?? ""; - set => __pbn__baseUrl = value; - } - public bool ShouldSerializebaseUrl() => __pbn__baseUrl != null; - public void ResetbaseUrl() => __pbn__baseUrl = null; - private string __pbn__baseUrl; - - [global::ProtoBuf.ProtoMember(3, Name = @"backupUrl")] - public global::System.Collections.Generic.List backupUrls { get; } = new global::System.Collections.Generic.List(); - - [global::ProtoBuf.ProtoMember(4, Name = @"bandwidth")] - public uint Bandwidth - { - get => __pbn__Bandwidth.GetValueOrDefault(); - set => __pbn__Bandwidth = value; - } - public bool ShouldSerializeBandwidth() => __pbn__Bandwidth != null; - public void ResetBandwidth() => __pbn__Bandwidth = null; - private uint? __pbn__Bandwidth; - - [global::ProtoBuf.ProtoMember(5, Name = @"codecid")] - public uint Codecid - { - get => __pbn__Codecid.GetValueOrDefault(); - set => __pbn__Codecid = value; - } - public bool ShouldSerializeCodecid() => __pbn__Codecid != null; - public void ResetCodecid() => __pbn__Codecid = null; - private uint? __pbn__Codecid; - - [global::ProtoBuf.ProtoMember(6, Name = @"md5")] - [global::System.ComponentModel.DefaultValue("")] - public string Md5 - { - get => __pbn__Md5 ?? ""; - set => __pbn__Md5 = value; - } - public bool ShouldSerializeMd5() => __pbn__Md5 != null; - public void ResetMd5() => __pbn__Md5 = null; - private string __pbn__Md5; - - [global::ProtoBuf.ProtoMember(7, Name = @"size")] - public ulong Size - { - get => __pbn__Size.GetValueOrDefault(); - set => __pbn__Size = value; - } - public bool ShouldSerializeSize() => __pbn__Size != null; - public void ResetSize() => __pbn__Size = null; - private ulong? __pbn__Size; - -} - -[global::ProtoBuf.ProtoContract()] -public partial class StreamItem : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - public StreamInfo streamInfo { get; set; } - - [global::ProtoBuf.ProtoMember(2)] - public DashVideo dashVideo { get; set; } - - [global::ProtoBuf.ProtoMember(3)] - public SegmentVideo segmentVideo { get; set; } - -} - -[global::ProtoBuf.ProtoContract()] -public partial class StreamInfo : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"quality")] - public uint Quality - { - get => __pbn__Quality.GetValueOrDefault(); - set => __pbn__Quality = value; - } - public bool ShouldSerializeQuality() => __pbn__Quality != null; - public void ResetQuality() => __pbn__Quality = null; - private uint? __pbn__Quality; - - [global::ProtoBuf.ProtoMember(2, Name = @"format")] - [global::System.ComponentModel.DefaultValue("")] - public string Format - { - get => __pbn__Format ?? ""; - set => __pbn__Format = value; - } - public bool ShouldSerializeFormat() => __pbn__Format != null; - public void ResetFormat() => __pbn__Format = null; - private string __pbn__Format; - - [global::ProtoBuf.ProtoMember(3, Name = @"description")] - [global::System.ComponentModel.DefaultValue("")] - public string Description - { - get => __pbn__Description ?? ""; - set => __pbn__Description = value; - } - public bool ShouldSerializeDescription() => __pbn__Description != null; - public void ResetDescription() => __pbn__Description = null; - private string __pbn__Description; - - [global::ProtoBuf.ProtoMember(4)] - public uint errCode - { - get => __pbn__errCode.GetValueOrDefault(); - set => __pbn__errCode = value; - } - public bool ShouldSerializeerrCode() => __pbn__errCode != null; - public void ReseterrCode() => __pbn__errCode = null; - private uint? __pbn__errCode; - - [global::ProtoBuf.ProtoMember(5, Name = @"limit")] - public StreamLimit Limit { get; set; } - - [global::ProtoBuf.ProtoMember(6)] - public bool needVip - { - get => __pbn__needVip.GetValueOrDefault(); - set => __pbn__needVip = value; - } - public bool ShouldSerializeneedVip() => __pbn__needVip != null; - public void ResetneedVip() => __pbn__needVip = null; - private bool? __pbn__needVip; - - [global::ProtoBuf.ProtoMember(7)] - public bool needLogin - { - get => __pbn__needLogin.GetValueOrDefault(); - set => __pbn__needLogin = value; - } - public bool ShouldSerializeneedLogin() => __pbn__needLogin != null; - public void ResetneedLogin() => __pbn__needLogin = null; - private bool? __pbn__needLogin; - - [global::ProtoBuf.ProtoMember(8, Name = @"intact")] - public bool Intact - { - get => __pbn__Intact.GetValueOrDefault(); - set => __pbn__Intact = value; - } - public bool ShouldSerializeIntact() => __pbn__Intact != null; - public void ResetIntact() => __pbn__Intact = null; - private bool? __pbn__Intact; - - [global::ProtoBuf.ProtoMember(9)] - public bool noRexcode - { - get => __pbn__noRexcode.GetValueOrDefault(); - set => __pbn__noRexcode = value; - } - public bool ShouldSerializenoRexcode() => __pbn__noRexcode != null; - public void ResetnoRexcode() => __pbn__noRexcode = null; - private bool? __pbn__noRexcode; - - [global::ProtoBuf.ProtoMember(10, Name = @"attribute")] - public ulong Attribute - { - get => __pbn__Attribute.GetValueOrDefault(); - set => __pbn__Attribute = value; - } - public bool ShouldSerializeAttribute() => __pbn__Attribute != null; - public void ResetAttribute() => __pbn__Attribute = null; - private ulong? __pbn__Attribute; - -} - -[global::ProtoBuf.ProtoContract()] -public partial class DashVideo : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - [global::System.ComponentModel.DefaultValue("")] - public string baseUrl - { - get => __pbn__baseUrl ?? ""; - set => __pbn__baseUrl = value; - } - public bool ShouldSerializebaseUrl() => __pbn__baseUrl != null; - public void ResetbaseUrl() => __pbn__baseUrl = null; - private string __pbn__baseUrl; - - [global::ProtoBuf.ProtoMember(2, Name = @"backupUrl")] - public global::System.Collections.Generic.List backupUrls { get; } = new global::System.Collections.Generic.List(); - - [global::ProtoBuf.ProtoMember(3, Name = @"bandwidth")] - public uint Bandwidth - { - get => __pbn__Bandwidth.GetValueOrDefault(); - set => __pbn__Bandwidth = value; - } - public bool ShouldSerializeBandwidth() => __pbn__Bandwidth != null; - public void ResetBandwidth() => __pbn__Bandwidth = null; - private uint? __pbn__Bandwidth; - - [global::ProtoBuf.ProtoMember(4, Name = @"codecid")] - public uint Codecid - { - get => __pbn__Codecid.GetValueOrDefault(); - set => __pbn__Codecid = value; - } - public bool ShouldSerializeCodecid() => __pbn__Codecid != null; - public void ResetCodecid() => __pbn__Codecid = null; - private uint? __pbn__Codecid; - - [global::ProtoBuf.ProtoMember(5, Name = @"md5")] - [global::System.ComponentModel.DefaultValue("")] - public string Md5 - { - get => __pbn__Md5 ?? ""; - set => __pbn__Md5 = value; - } - public bool ShouldSerializeMd5() => __pbn__Md5 != null; - public void ResetMd5() => __pbn__Md5 = null; - private string __pbn__Md5; - - [global::ProtoBuf.ProtoMember(6, Name = @"size")] - public ulong Size - { - get => __pbn__Size.GetValueOrDefault(); - set => __pbn__Size = value; - } - public bool ShouldSerializeSize() => __pbn__Size != null; - public void ResetSize() => __pbn__Size = null; - private ulong? __pbn__Size; - - [global::ProtoBuf.ProtoMember(7)] - public uint audioId - { - get => __pbn__audioId.GetValueOrDefault(); - set => __pbn__audioId = value; - } - public bool ShouldSerializeaudioId() => __pbn__audioId != null; - public void ResetaudioId() => __pbn__audioId = null; - private uint? __pbn__audioId; - - [global::ProtoBuf.ProtoMember(8)] - public bool noRexcode - { - get => __pbn__noRexcode.GetValueOrDefault(); - set => __pbn__noRexcode = value; - } - public bool ShouldSerializenoRexcode() => __pbn__noRexcode != null; - public void ResetnoRexcode() => __pbn__noRexcode = null; - private bool? __pbn__noRexcode; - -} - -[global::ProtoBuf.ProtoContract()] -public partial class SegmentVideo : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"segment")] - public global::System.Collections.Generic.List Segments { get; } = new global::System.Collections.Generic.List(); - -} - -[global::ProtoBuf.ProtoContract()] -public partial class StreamLimit : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"title")] - [global::System.ComponentModel.DefaultValue("")] - public string Title - { - get => __pbn__Title ?? ""; - set => __pbn__Title = value; - } - public bool ShouldSerializeTitle() => __pbn__Title != null; - public void ResetTitle() => __pbn__Title = null; - private string __pbn__Title; - - [global::ProtoBuf.ProtoMember(2, Name = @"uri")] - [global::System.ComponentModel.DefaultValue("")] - public string Uri - { - get => __pbn__Uri ?? ""; - set => __pbn__Uri = value; - } - public bool ShouldSerializeUri() => __pbn__Uri != null; - public void ResetUri() => __pbn__Uri = null; - private string __pbn__Uri; - - [global::ProtoBuf.ProtoMember(3, Name = @"msg")] - [global::System.ComponentModel.DefaultValue("")] - public string Msg - { - get => __pbn__Msg ?? ""; - set => __pbn__Msg = value; - } - public bool ShouldSerializeMsg() => __pbn__Msg != null; - public void ResetMsg() => __pbn__Msg = null; - private string __pbn__Msg; - -} - -[global::ProtoBuf.ProtoContract()] -public partial class ResponseUrl : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1, Name = @"order")] - public uint Order - { - get => __pbn__Order.GetValueOrDefault(); - set => __pbn__Order = value; - } - public bool ShouldSerializeOrder() => __pbn__Order != null; - public void ResetOrder() => __pbn__Order = null; - private uint? __pbn__Order; - - [global::ProtoBuf.ProtoMember(2, Name = @"length")] - public ulong Length - { - get => __pbn__Length.GetValueOrDefault(); - set => __pbn__Length = value; - } - public bool ShouldSerializeLength() => __pbn__Length != null; - public void ResetLength() => __pbn__Length = null; - private ulong? __pbn__Length; - - [global::ProtoBuf.ProtoMember(3, Name = @"size")] - public ulong Size - { - get => __pbn__Size.GetValueOrDefault(); - set => __pbn__Size = value; - } - public bool ShouldSerializeSize() => __pbn__Size != null; - public void ResetSize() => __pbn__Size = null; - private ulong? __pbn__Size; - - [global::ProtoBuf.ProtoMember(4, Name = @"url")] - [global::System.ComponentModel.DefaultValue("")] - public string Url - { - get => __pbn__Url ?? ""; - set => __pbn__Url = value; - } - public bool ShouldSerializeUrl() => __pbn__Url != null; - public void ResetUrl() => __pbn__Url = null; - private string __pbn__Url; - - [global::ProtoBuf.ProtoMember(5, Name = @"backupUrl")] - public global::System.Collections.Generic.List backupUrls { get; } = new global::System.Collections.Generic.List(); - - [global::ProtoBuf.ProtoMember(6, Name = @"md5")] - [global::System.ComponentModel.DefaultValue("")] - public string Md5 - { - get => __pbn__Md5 ?? ""; - set => __pbn__Md5 = value; - } - public bool ShouldSerializeMd5() => __pbn__Md5 != null; - public void ResetMd5() => __pbn__Md5 = null; - private string __pbn__Md5; - -} - -[global::ProtoBuf.ProtoContract()] -public partial class PlayViewReply : global::ProtoBuf.IExtensible -{ - private global::ProtoBuf.IExtension __pbn__extensionData; - global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) - => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); - - [global::ProtoBuf.ProtoMember(1)] - public VideoInfo videoInfo { get; set; } - - [global::ProtoBuf.ProtoMember(2)] - public PlayAbilityConf playConf { get; set; } - - [global::ProtoBuf.ProtoMember(3, Name = @"business")] - public BusinessInfo Business { get; set; } - - [global::ProtoBuf.ProtoMember(4, Name = @"event")] - public Event Event { get; set; } - -} - -#pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 -#endregion diff --git a/BBDown.Core/APP/Response/dmviewreply.proto b/BBDown.Core/APP/Response/dmviewreply.proto new file mode 100644 index 000000000..eb6e73940 --- /dev/null +++ b/BBDown.Core/APP/Response/dmviewreply.proto @@ -0,0 +1,104 @@ +syntax = "proto2"; +option csharp_namespace = "BBDown.Core.Protobuf"; + +message DmViewReply { + optional bool closed = 1; + optional VideoMask mask = 2; + optional VideoSubtitle subtitle = 3; + repeated string specialDms = 4; + optional DanmakuFlagConfig aiFlag = 5; + optional DanmuPlayerViewConfig playerConfig = 6; + optional int32 sendBoxStyle = 7; + optional bool allow = 8; + optional string checkBoxShowMsg = 9; + optional bool checkBox = 10; + optional string textPlaceholder = 11; +} + +message VideoMask { + optional int64 cid = 1; + optional int32 plat = 2; + optional int32 fps = 3; + optional int64 time = 4; + optional string maskUrl = 5; +} + +message VideoSubtitle { + optional string lan = 1; + optional string lanDoc = 2; + optional SubtitleItem subtitles = 3; + +} + +message DanmakuFlagConfig { + optional int32 recFlag = 1; + optional string recText = 2; + optional int32 recSwitch = 3; +} + +message DanmuPlayerViewConfig { + optional DanmuDefaultPlayerConfig danmukuDefaultPlayerConfig = 1; + optional DanmuPlayerConfig danmukuPlayerConfig = 2; + optional DanmuPlayerDynamicConfig danmukuPlayerDynamicConfig = 3; +} + +message SubtitleItem { + optional UserInfo author = 6; + optional string idStr = 1; + optional int64 id = 2; + optional string lanDoc = 4; + optional string lan = 3; + optional string subtitleUrl = 5; +} + +message UserInfo { + optional string face = 4; + optional int64 mid = 1; + optional string name = 2; + optional int32 rank = 6; + optional string sex = 3; + optional string sign = 5; +} + +message DanmuDefaultPlayerConfig { + optional bool playerDanmakuUseDefaultConfig = 1; + optional bool playerDanmakuAiRecommendedSwitch = 4; + optional int32 playerDanmakuAiRecommendedLevel = 5; + optional bool playerDanmakuBlocktop = 6; + optional bool playerDanmakuBlockscroll = 7; + optional bool playerDanmakuBlockbottom = 8; + optional bool playerDanmakuBlockcolorful = 9; + optional bool playerDanmakuBlockrepeat = 10; + optional bool playerDanmakuBlockspecial = 11; + optional float playerDanmakuOpacity = 12; + optional float playerDanmakuScalingfactor = 13; + optional float playerDanmakuDomain = 14; + optional int32 playerDanmakuSpeed = 15; + optional bool inlinePlayerDanmakuSwitch = 16; +} + +message DanmuPlayerConfig { + optional bool playerDanmakuSwitchSave = 1; + optional bool playerDanmakuSwitch = 2; + optional bool playerDanmakuUseDefaultConfig = 3; + optional bool playerDanmakuAiRecommendedSwitch = 4; + optional int32 playerDanmakuAiRecommendedLevel = 5; + optional bool playerDanmakuBlocktop = 6; + optional bool playerDanmakuBlockscroll = 7; + optional bool playerDanmakuBlockbottom = 8; + optional bool playerDanmakuBlockcolorful = 9; + optional bool playerDanmakuBlockrepeat = 10; + optional bool playerDanmakuBlockspecial = 11; + optional float playerDanmakuOpacity = 12; + optional float playerDanmakuScalingfactor = 13; + optional float playerDanmakuDomain = 14; + optional int32 playerDanmakuSpeed = 15; + optional bool playerDanmakuEnableblocklist = 16; + optional bool inlinePlayerDanmakuSwitch = 17; + optional int32 inlinePlayerDanmakuConfig = 18; +} + +message DanmuPlayerDynamicConfig { + optional int32 progress = 1; + optional float playerDanmakuDomain = 14; +} \ No newline at end of file diff --git a/BBDown.Core/APP/Response/playviewreply.proto b/BBDown.Core/APP/Response/playviewreply.proto new file mode 100644 index 000000000..dc2685601 --- /dev/null +++ b/BBDown.Core/APP/Response/playviewreply.proto @@ -0,0 +1,129 @@ +syntax = "proto2"; +option csharp_namespace = "BBDown.Core.Protobuf"; + +message VideoInfo { + optional uint32 quality = 1; + optional string format = 2; + optional uint64 timelength = 3; + optional uint32 videoCodecid = 4; + repeated StreamItem streamList = 5; + repeated DashItem dashAudio = 6; + //űȰE + optional DolbyItem dolby = 7; +} + +//űƵϢ +message DolbyItem { + optional int32 type = 1; + //ƵE + optional DashItem audio = 2; +} + +message PlayAbilityConf { + optional bool backgroundPlayDisable = 1; + optional bool flipDisable = 2; + optional bool castDisable = 3; + optional bool feedbackDisable = 4; + optional bool subtitleDisable = 5; + optional bool playbackRateDisable = 6; + optional bool timeUpDisable = 7; + optional bool playbackModeDisable = 8; + optional bool scaleModeDisable = 9; + optional bool likeDisable = 10; + optional bool dislikeDisable = 11; + optional bool coinDisable = 12; + optional bool elecDisable = 13; + optional bool shareDisable = 14; + optional bool screenShotDisable = 15; + optional bool lockScreenDisable = 16; + optional bool recommendDisable = 17; + optional bool playbackSpeedDisable = 18; + optional bool definitionDisable = 19; + optional bool selectionsDisable = 20; + optional bool nextDisable = 21; + optional bool editDmDisable = 22; + optional bool smallWindowDisable = 23; + optional bool shakeDisable = 24; +} + +message BusinessInfo { + optional bool isPreview = 1; + optional bool bp = 2; + optional string marlinToken = 3; +} + +message Event { + optional Shake shake = 1; +} + +message Shake { + optional string file = 1; +} + +message DashItem { + optional uint32 id = 1; + optional string baseUrl = 2; + repeated string backupUrl = 3; + optional uint32 bandwidth = 4; + optional uint32 codecid = 5; + optional string md5 = 6; + optional uint64 size = 7; +} + +message StreamItem { + optional StreamInfo streamInfo = 1; + optional DashVideo dashVideo = 2; + optional SegmentVideo segmentVideo = 3; +} + +message StreamInfo { + optional uint32 quality = 1; + optional string format = 2; + optional string description = 3; + optional uint32 errCode = 4; + optional StreamLimit limit = 5; + optional bool needVip = 6; + optional bool needLogin = 7; + optional bool intact = 8; + optional bool noRexcode = 9; + optional uint64 attribute = 10; + +} + +message DashVideo { + optional string baseUrl = 1; + repeated string backupUrl = 2; + optional uint32 bandwidth = 3; + optional uint32 codecid = 4; + optional string md5 = 5; + optional uint64 size = 6; + optional uint32 audioId = 7; + optional bool noRexcode = 8; +} + +message SegmentVideo { + repeated ResponseUrl segment = 1; +} + +message StreamLimit { + optional string title = 1; + optional string uri = 2; + optional string msg = 3; + +} + +message ResponseUrl { + optional uint32 order = 1; + optional uint64 length = 2; + optional uint64 size = 3; + optional string url = 4; + repeated string backupUrl = 5; + optional string md5 = 6; +} + +message PlayViewReply { + optional VideoInfo videoInfo = 1; + optional PlayAbilityConf playConf = 2; + optional BusinessInfo business = 3; + optional Event event = 4; +} \ No newline at end of file diff --git a/BBDown.Core/AppHelper.cs b/BBDown.Core/AppHelper.cs index 5c24c042d..223612673 100644 --- a/BBDown.Core/AppHelper.cs +++ b/BBDown.Core/AppHelper.cs @@ -1,4 +1,6 @@ -using ProtoBuf; +using BBDown.Core.Protobuf; +using Google.Protobuf; +using System.Buffers.Binary; using System.IO.Compression; using System.Net.Http.Headers; using System.Text.Json; @@ -18,7 +20,7 @@ class AppHelper private static readonly string appVer = "6.32.0"; private static readonly int build = 6320200; private static readonly string channel = "xiaomi_cn_tv.danmaku.bili_zm20200902"; - private static readonly Network.Type networkType = Network.Type.Wifi; + private static readonly Network.Types.TYPE networkType = Network.Types.TYPE.Wifi; private static readonly string networkOid = "46007"; private static readonly string cronet = "1.36.1"; private static readonly string buvid = ""; @@ -43,13 +45,13 @@ public static async Task DoReqAsync(string aid, string cid, string epId, { var headers = GetHeader(appkey); LogDebug("App-Req-Headers: {0}", JsonSerializer.Serialize(headers, JsonContext.Default.DictionaryStringString)); - var body = GetPayload(Convert.ToInt64(aid), Convert.ToInt64(cid), Convert.ToInt64(qn), onlyAvc ? PlayViewReq.CodeType.Code264 : PlayViewReq.CodeType.Code265); + var body = GetPayload(Convert.ToInt64(aid), Convert.ToInt64(cid), Convert.ToInt64(qn), onlyAvc ? PlayViewReq.Types.CodeType.Code264 : PlayViewReq.Types.CodeType.Code265); //Console.WriteLine(ReadMessage(body)); var data = await GetPostResponseAsync(API, body, headers); PlayViewReply? resp; try { - resp = ReadMessage(data); + resp = new MessageParser(() => new PlayViewReply()).ParseFrom(ReadMessage(data)); } catch (Exception ex) { @@ -60,9 +62,9 @@ public static async Task DoReqAsync(string aid, string cid, string epId, if (bangumi) { - body = GetPayload(Convert.ToInt64(epId), Convert.ToInt64(cid), Convert.ToInt64(qn), onlyAvc ? PlayViewReq.CodeType.Code264 : PlayViewReq.CodeType.Code265); + body = GetPayload(Convert.ToInt64(epId), Convert.ToInt64(cid), Convert.ToInt64(qn), onlyAvc ? PlayViewReq.Types.CodeType.Code264 : PlayViewReq.Types.CodeType.Code265); data = await GetPostResponseAsync(API2, body, headers); - resp = ReadMessage(data); + resp = new MessageParser(() => new PlayViewReply()).ParseFrom(ReadMessage(data)); } else { @@ -84,43 +86,43 @@ private static string ConvertToDashJson(object data) var videos = new List(); var audios = new List(); - if (resp.videoInfo.streamLists != null) + if (resp.VideoInfo.StreamList != null) { - foreach (var item in resp.videoInfo.streamLists) + foreach (var item in resp.VideoInfo.StreamList) { - if (item.dashVideo != null) + if (item.DashVideo != null) { videos.Add(new AudioInfoWitCodecId( - item.streamInfo.Quality, - item.dashVideo.baseUrl, - (uint)(item.dashVideo.Size * 8 / (resp.videoInfo.Timelength / 1000)), - item.dashVideo.Codecid + item.StreamInfo.Quality, + item.DashVideo.BaseUrl, + (uint)(item.DashVideo.Size * 8 / (resp.VideoInfo.Timelength / 1000)), + item.DashVideo.Codecid )); } } } - if (resp.videoInfo.dashAudioes != null) + if (resp.VideoInfo.DashAudio != null) { - foreach (var item in resp.videoInfo.dashAudioes) + foreach (var item in resp.VideoInfo.DashAudio) { audios.Add(new AudioInfoWithCodecName( item.Id, - item.baseUrl, - item.backupUrls, + item.BaseUrl, + item.BackupUrl.ToList(), item.Bandwidth, "M4A" )); } } - if (resp.videoInfo.Dolby != null && resp.videoInfo.Dolby.Audio != null) + if (resp.VideoInfo.Dolby != null && resp.VideoInfo.Dolby.Audio != null) { audios.Add(new AudioInfoWithCodecName( - resp.videoInfo.Dolby.Audio.Id, - resp.videoInfo.Dolby.Audio.baseUrl, - resp.videoInfo.Dolby.Audio.backupUrls, - resp.videoInfo.Dolby.Audio.Bandwidth, + resp.VideoInfo.Dolby.Audio.Id, + resp.VideoInfo.Dolby.Audio.BaseUrl, + resp.VideoInfo.Dolby.Audio.BackupUrl.ToList(), + resp.VideoInfo.Dolby.Audio.Bandwidth, "E-AC-3" )); } @@ -130,7 +132,7 @@ private static string ConvertToDashJson(object data) "0", 1, new DashData( - resp.videoInfo.Timelength, + resp.VideoInfo.Timelength, new DashInfo( videos, audios @@ -141,23 +143,23 @@ private static string ConvertToDashJson(object data) return JsonSerializer.Serialize(json, JsonContext.Default.DashJson); } - private static byte[] GetPayload(long aid, long cid, long qn, PlayViewReq.CodeType codec) + private static byte[] GetPayload(long aid, long cid, long qn, PlayViewReq.Types.CodeType codec) { var obj = new PlayViewReq { - epId = aid, + EpId = aid, Cid = cid, //obj.Qn = qn; Qn = 126, Fnval = 976, Spmid = "main.ugc-video-detail.0.0", - fromSpmid = "main.my-history.0.0", - preferCodecType = codec, + FromSpmid = "main.my-history.0.0", + PreferCodecType = codec, Download = 0, //0:播放 1:flv下载 2:dash下载 - forceHost = 2 //0:允许使用ip 1:使用http 2:使用https + ForceHost = 2 //0:允许使用ip 1:使用http 2:使用https }; LogDebug("PayLoadPlain: {0}", JsonSerializer.Serialize(obj, JsonContext.Default.PlayViewReq)); - return PackMessage(ObjectToBytes(obj)); + return PackMessage(obj.ToByteArray()); } @@ -188,54 +190,54 @@ private static string GenerateLocaleBin() { var obj = new Locale { - cLocale = new Locale.LocaleIds + CLocale = new Locale.Types.LocaleIds { Language = language, Region = region } }; - return SerializeToBase64(obj); + return Convert.ToBase64String(obj.ToByteArray()); } private static string GenerateNetworkBin() { var obj = new Network { - type = networkType, + Type = networkType, Oid = networkOid }; - return SerializeToBase64(obj); + return Convert.ToBase64String(obj.ToByteArray()); } private static string GenerateDeviceBin() { var obj = new Device { - appId = appId, + AppId = appId, Build = build, Buvid = buvid, - mobiApp = mobiApp, + MobiApp = mobiApp, Platform = platform, Channel = channel, Brand = brand, Model = model, Osver = osVer }; - return SerializeToBase64(obj); + return Convert.ToBase64String(obj.ToByteArray()); } private static string GenerateMetadataBin(string appkey) { var obj = new Metadata { - accessKey = appkey, - mobiApp = mobiApp, + AccessKey = appkey, + MobiApp = mobiApp, Build = build, Channel = channel, Buvid = buvid, Platform = platform }; - return SerializeToBase64(obj); + return Convert.ToBase64String(obj.ToByteArray()); } private static string GenerateFawkesReqBin() @@ -244,31 +246,9 @@ private static string GenerateFawkesReqBin() { Appkey = appKey, Env = env, - sessionId = sessionId + SessionId = sessionId }; - return SerializeToBase64(obj); - } - - /// - /// 对象转字节数组 - /// - /// - /// - private static byte[] ObjectToBytes(T obj) - { - using var stream = new MemoryStream(); - Serializer.Serialize(stream, obj); - return stream.ToArray(); - } - - /// - /// 序列化为字符串 - /// - /// - /// - private static string SerializeToBase64(T obj) - { - return Convert.ToBase64String(ObjectToBytes(obj)).TrimEnd('='); + return Convert.ToBase64String(obj.ToByteArray()); } #endregion @@ -283,20 +263,7 @@ private static byte[] ReadMessage(byte[] data) byte first; int size; (first, size) = ReadInfo(data); - return first == 1 ? GzipDecompress(data.Skip(5).ToArray()) : data.Skip(5).Take(size).ToArray(); - } - - /// - /// 读取gRPC响应流 通过前5字节信息 解析/解压后面的报文体 - /// - /// - /// - /// 对应的protobuf - private static T ReadMessage(byte[] data) - { - var msg = ReadMessage(data); - var obj = Serializer.Deserialize(new MemoryStream(msg)); - return obj; + return first == 1 ? GzipDecompress(data[5..]) : data[5..(5 + size)]; } /// @@ -306,12 +273,10 @@ private static T ReadMessage(byte[] data) /// private static (byte first, int size) ReadInfo(byte[] data) { - using var stream = new MemoryStream(data.Take(5).ToArray()); - using var reader = new BinaryReader(stream); - var value1 = reader.ReadByte(); - var value2 = reader.ReadBytes(4); + var value1 = data[0]; + var value2 = data[1..5]; - return (value1, BitConverter.ToInt32(value2.Reverse().ToArray())); + return (value1, BinaryPrimitives.ReadInt32BigEndian(value2)); } /// @@ -325,8 +290,9 @@ private static byte[] PackMessage(byte[] input) using (var writer = new BinaryWriter(stream)) { var comp = GzipCompress(input); - var reverse = BitConverter.GetBytes(comp.Length).Reverse().ToArray(); + var reverse = (stackalloc byte[4]); writer.Write((byte)1); + BinaryPrimitives.WriteInt32BigEndian(reverse, comp.Length); writer.Write(reverse); writer.Write(comp); } diff --git a/BBDown.Core/BBDown.Core.csproj b/BBDown.Core/BBDown.Core.csproj index e08669031..fa93d06fd 100644 --- a/BBDown.Core/BBDown.Core.csproj +++ b/BBDown.Core/BBDown.Core.csproj @@ -9,7 +9,15 @@ - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + diff --git a/BBDown/Directory.Build.props b/BBDown/Directory.Build.props index ad7193237..56c71594f 100644 --- a/BBDown/Directory.Build.props +++ b/BBDown/Directory.Build.props @@ -15,8 +15,4 @@ - - - - diff --git a/BBDown/rd.xml b/BBDown/rd.xml deleted file mode 100644 index 95045ac8b..000000000 --- a/BBDown/rd.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 6527993c23471f48db9025762f729843d4842dd5 Mon Sep 17 00:00:00 2001 From: Steven He Date: Mon, 18 Jul 2022 00:48:52 +0900 Subject: [PATCH 2/2] Shrinking size --- BBDown/Directory.Build.props | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BBDown/Directory.Build.props b/BBDown/Directory.Build.props index 56c71594f..d16e938fb 100644 --- a/BBDown/Directory.Build.props +++ b/BBDown/Directory.Build.props @@ -5,7 +5,11 @@ true true full + link + true 7.0.0-* + true + false