commit face3bfa69c288e24c93fa1697b721669d12dfb9
Author: 姚彪 <1315508912@qq.com>
Date: Sat Nov 25 21:59:48 2023 +0800
feat: 首次完成测试
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7d5a1ed
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+.idea/
+.vs/
+.vs_code/
+**/.DS_Store
+
+*/**/obj
+*/**/bin
+
+DownKyi.sln.DotSettings.user
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/BangumiInfo.cs b/DownKyi.Core/BiliApi/Bangumi/BangumiInfo.cs
new file mode 100644
index 0000000..65d9a86
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/BangumiInfo.cs
@@ -0,0 +1,86 @@
+using DownKyi.Core.BiliApi.Bangumi.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Bangumi;
+
+public static class BangumiInfo
+{
+ ///
+ /// 剧集基本信息(mediaId方式)
+ ///
+ ///
+ ///
+ public static BangumiMedia BangumiMediaInfo(long mediaId)
+ {
+ string url = $"https://api.bilibili.com/pgc/review/user?media_id={mediaId}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var media = JsonConvert.DeserializeObject(response);
+ if (media != null && media.Result != null)
+ {
+ return media.Result.Media;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("BangumiMediaInfo()发生异常: {0}", e);
+ LogManager.Error("BangumiInfo", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 获取剧集明细(web端)(seasonId/episodeId方式)
+ ///
+ ///
+ ///
+ ///
+ public static BangumiSeason BangumiSeasonInfo(long seasonId = -1, long episodeId = -1)
+ {
+ string baseUrl = "https://api.bilibili.com/pgc/view/web/season";
+ string referer = "https://www.bilibili.com";
+ string url;
+ if (seasonId > -1)
+ {
+ url = $"{baseUrl}?season_id={seasonId}";
+ }
+ else if (episodeId > -1)
+ {
+ url = $"{baseUrl}?ep_id={episodeId}";
+ }
+ else
+ {
+ return null;
+ }
+
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var bangumiSeason = JsonConvert.DeserializeObject(response);
+ if (bangumiSeason != null)
+ {
+ return bangumiSeason.Result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("BangumiSeasonInfo()发生异常: {0}", e);
+ LogManager.Error("BangumiInfo", e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/BangumiType.cs b/DownKyi.Core/BiliApi/Bangumi/BangumiType.cs
new file mode 100644
index 0000000..99d233e
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/BangumiType.cs
@@ -0,0 +1,32 @@
+namespace DownKyi.Core.BiliApi.Bangumi;
+
+public static class BangumiType
+{
+ public static Dictionary Type = new Dictionary()
+ {
+ { 1, "Anime" },
+ { 2, "Movie" },
+ { 3, "Documentary" },
+ { 4, "Guochuang" },
+ { 5, "TV" },
+ { 6, "Unknown" },
+ { 7, "Entertainment" },
+ { 8, "Unknown" },
+ { 9, "Unknown" },
+ { 10, "Unknown" }
+ };
+
+ public static Dictionary TypeId = new Dictionary()
+ {
+ { 1, 13 },
+ { 2, 23 },
+ { 3, 177 },
+ { 4, 167 },
+ { 5, 11 },
+ { 6, -1 },
+ { 7, -1 },
+ { 8, -1 },
+ { 9, -1 },
+ { 10, -1 }
+ };
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/Models/BangumiArea.cs b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiArea.cs
new file mode 100644
index 0000000..065a778
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiArea.cs
@@ -0,0 +1,10 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Bangumi.Models;
+
+public class BangumiArea : BaseModel
+{
+ [JsonProperty("id")] public int Id { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/Models/BangumiEpisode.cs b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiEpisode.cs
new file mode 100644
index 0000000..348f3ca
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiEpisode.cs
@@ -0,0 +1,39 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Bangumi.Models;
+
+public class BangumiEpisode : BaseModel
+{
+ [JsonProperty("aid")] public long Aid { get; set; }
+
+ [JsonProperty("badge")] public string Badge { get; set; }
+
+ // badge_info
+ // badge_type
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+ [JsonProperty("cid")] public long Cid { get; set; }
+ [JsonProperty("cover")] public string Cover { get; set; }
+ [JsonProperty("dimension")] public Dimension Dimension { get; set; }
+ [JsonProperty("duration")] public long Duration { get; set; }
+ [JsonProperty("from")] public string From { get; set; }
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("link")] public string Link { get; set; }
+ [JsonProperty("long_title")] public string LongTitle { get; set; }
+
+ [JsonProperty("pub_time")] public long PubTime { get; set; }
+
+ // pv
+ // release_date
+ // rights
+ [JsonProperty("share_copy")] public string ShareCopy { get; set; }
+ [JsonProperty("share_url")] public string ShareUrl { get; set; }
+
+ [JsonProperty("short_link")] public string ShortLink { get; set; }
+
+ // stat
+ [JsonProperty("status")] public int Status { get; set; }
+ [JsonProperty("subtitle")] public string Subtitle { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("vid")] public string Vid { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/Models/BangumiMedia.cs b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiMedia.cs
new file mode 100644
index 0000000..59e5003
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiMedia.cs
@@ -0,0 +1,36 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Bangumi.Models;
+
+// https://api.bilibili.com/pgc/review/user
+public class BangumiMediaOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("result")] public BangumiMediaData Result { get; set; }
+}
+
+public class BangumiMediaData : BaseModel
+{
+ [JsonProperty("media")] public BangumiMedia Media { get; set; }
+}
+
+public class BangumiMedia : BaseModel
+{
+ [JsonProperty("areas")] public List Areas { get; set; }
+ [JsonProperty("cover")] public string Cover { get; set; }
+
+ [JsonProperty("media_id")] public long MediaId { get; set; }
+
+ // new_ep
+ // rating
+ [JsonProperty("season_id")] public long SeasonId { get; set; }
+ [JsonProperty("share_url")] public string ShareUrl { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("type_name")] public string TypeName { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/Models/BangumiPositive.cs b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiPositive.cs
new file mode 100644
index 0000000..473a7bd
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiPositive.cs
@@ -0,0 +1,10 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Bangumi.Models;
+
+public class BangumiPositive : BaseModel
+{
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/Models/BangumiSeason.cs b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiSeason.cs
new file mode 100644
index 0000000..8788532
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiSeason.cs
@@ -0,0 +1,65 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Bangumi.Models;
+
+// https://api.bilibili.com/pgc/view/web/season
+public class BangumiSeasonOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("result")] public BangumiSeason Result { get; set; }
+}
+
+public class BangumiSeason : BaseModel
+{
+ // activity
+ // alias
+ [JsonProperty("areas")] public List Areas { get; set; }
+ [JsonProperty("bkg_cover")] public string BkgCover { get; set; }
+ [JsonProperty("cover")] public string Cover { get; set; }
+ [JsonProperty("episodes")] public List Episodes { get; set; }
+
+ [JsonProperty("evaluate")] public string Evaluate { get; set; }
+
+ // freya
+ // jp_title
+ [JsonProperty("link")] public string Link { get; set; }
+
+ [JsonProperty("media_id")] public long MediaId { get; set; }
+
+ // mode
+ // new_ep
+ // payment
+ [JsonProperty("positive")] public BangumiPositive Positive { get; set; }
+
+ // publish
+ // rating
+ // record
+ // rights
+ [JsonProperty("season_id")] public long SeasonId { get; set; }
+ [JsonProperty("season_title")] public string SeasonTitle { get; set; }
+ [JsonProperty("seasons")] public List Seasons { get; set; }
+
+ [JsonProperty("section")] public List Section { get; set; }
+
+ // series
+ // share_copy
+ // share_sub_title
+ // share_url
+ // show
+ [JsonProperty("square_cover")] public string SquareCover { get; set; }
+
+ [JsonProperty("stat")] public BangumiStat Stat { get; set; }
+
+ // status
+ [JsonProperty("subtitle")] public string Subtitle { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("total")] public int Total { get; set; }
+ [JsonProperty("type")] public int Type { get; set; }
+ [JsonProperty("up_info")] public BangumiUpInfo UpInfo { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/Models/BangumiSeasonInfo.cs b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiSeasonInfo.cs
new file mode 100644
index 0000000..5b820d8
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiSeasonInfo.cs
@@ -0,0 +1,22 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Bangumi.Models;
+
+public class BangumiSeasonInfo : BaseModel
+{
+ [JsonProperty("badge")] public string Badge { get; set; }
+
+ // badge_info
+ // badge_type
+ [JsonProperty("cover")] public string Cover { get; set; }
+
+ [JsonProperty("media_id")] public long MediaId { get; set; }
+
+ // new_ep
+ [JsonProperty("season_id")] public long SeasonId { get; set; }
+ [JsonProperty("season_title")] public string SeasonTitle { get; set; }
+
+ [JsonProperty("season_type")] public int SeasonType { get; set; }
+ // stat
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/Models/BangumiSection.cs b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiSection.cs
new file mode 100644
index 0000000..e383c49
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiSection.cs
@@ -0,0 +1,13 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Bangumi.Models;
+
+public class BangumiSection : BaseModel
+{
+ [JsonProperty("episode_id")] public long EpisodeId { get; set; }
+ [JsonProperty("episodes")] public List Episodes { get; set; }
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("type")] public int Type { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/Models/BangumiStat.cs b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiStat.cs
new file mode 100644
index 0000000..6e7121a
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiStat.cs
@@ -0,0 +1,16 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Bangumi.Models;
+
+public class BangumiStat : BaseModel
+{
+ [JsonProperty("coins")] public long Coins { get; set; }
+ [JsonProperty("danmakus")] public long Danmakus { get; set; }
+ [JsonProperty("favorite")] public long Favorite { get; set; }
+ [JsonProperty("favorites")] public long Favorites { get; set; }
+ [JsonProperty("likes")] public long Likes { get; set; }
+ [JsonProperty("reply")] public long Reply { get; set; }
+ [JsonProperty("share")] public long Share { get; set; }
+ [JsonProperty("views")] public long Views { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Bangumi/Models/BangumiUpInfo.cs b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiUpInfo.cs
new file mode 100644
index 0000000..d6ee4d1
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Bangumi/Models/BangumiUpInfo.cs
@@ -0,0 +1,20 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Bangumi.Models;
+
+public class BangumiUpInfo : BaseModel
+{
+ [JsonProperty("avatar")] public string Avatar { get; set; }
+
+ // follower
+ // is_follow
+ [JsonProperty("mid")] public long Mid { get; set; }
+
+ // pendant
+ // theme_type
+ [JsonProperty("uname")] public string Name { get; set; }
+ // verify_type
+ // vip_status
+ // vip_type
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/BiliUtils/BvId.cs b/DownKyi.Core/BiliApi/BiliUtils/BvId.cs
new file mode 100644
index 0000000..bf63532
--- /dev/null
+++ b/DownKyi.Core/BiliApi/BiliUtils/BvId.cs
@@ -0,0 +1,59 @@
+namespace DownKyi.Core.BiliApi.BiliUtils;
+
+public static class BvId
+{
+ private const string tableStr = "fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF"; //码表
+ private static readonly char[] table = tableStr.ToCharArray();
+
+ private static readonly char[] tr = new char[124]; //反查码表
+ private const ulong Xor = 177451812; //固定异或值
+ private const ulong add = 8728348608; //固定加法值
+ private static readonly int[] s = { 11, 10, 3, 8, 4, 6 }; //位置编码表
+
+ static BvId()
+ {
+ Tr_init();
+ }
+
+ //初始化反查码表
+ private static void Tr_init()
+ {
+ for (int i = 0; i < 58; i++)
+ tr[table[i]] = (char)i;
+ }
+
+ ///
+ /// bvid转avid
+ ///
+ ///
+ ///
+ public static ulong Bv2Av(string bvid)
+ {
+ char[] bv = bvid.ToCharArray();
+
+ ulong r = 0;
+ ulong av;
+ for (int i = 0; i < 6; i++)
+ r += tr[bv[s[i]]] * (ulong)Math.Pow(58, i);
+ av = (r - add) ^ Xor;
+ return av;
+ }
+
+ ///
+ /// avid转bvid
+ ///
+ ///
+ ///
+ public static string Av2Bv(ulong av)
+ {
+ //编码结果
+ string res = "BV1 4 1 7 ";
+ char[] result = res.ToCharArray();
+
+ av = (av ^ Xor) + add;
+ for (int i = 0; i < 6; i++)
+ result[s[i]] = table[av / (ulong)Math.Pow(58, i) % 58];
+ string bv = new string(result);
+ return bv;
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/BiliUtils/Constant.cs b/DownKyi.Core/BiliApi/BiliUtils/Constant.cs
new file mode 100644
index 0000000..47ac3ca
--- /dev/null
+++ b/DownKyi.Core/BiliApi/BiliUtils/Constant.cs
@@ -0,0 +1,74 @@
+namespace DownKyi.Core.BiliApi.BiliUtils;
+
+public static class Constant
+{
+ private static readonly List resolutions = new List
+ {
+ new() { Name = "360P 流畅", Id = 16 },
+ new() { Name = "480P 清晰", Id = 32 },
+ new() { Name = "720P 高清", Id = 64 },
+ new() { Name = "720P 60帧", Id = 74 },
+ new() { Name = "1080P 高清", Id = 80 },
+ new() { Name = "1080P 高码率", Id = 112 },
+ new() { Name = "1080P 60帧", Id = 116 },
+ new() { Name = "4K 超清", Id = 120 },
+ new() { Name = "HDR 真彩", Id = 125 },
+ new() { Name = "杜比视界", Id = 126 },
+ new() { Name = "超高清 8K", Id = 127 },
+ };
+
+ private static readonly List codecIds = new List
+ {
+ new() { Name = "H.264/AVC", Id = 7 },
+ new() { Name = "H.265/HEVC", Id = 12 },
+ new() { Name = "AV1", Id = 13 },
+ };
+
+ private static readonly List qualities = new List
+ {
+ //new Quality { Name = "64K", Id = 30216 },
+ //new Quality { Name = "132K", Id = 30232 },
+ //new Quality { Name = "192K", Id = 30280 },
+ new() { Name = "低质量", Id = 30216 },
+ new() { Name = "中质量", Id = 30232 },
+ new() { Name = "高质量", Id = 30280 },
+ new() { Name = "Dolby Atmos", Id = 30250 },
+ new() { Name = "Hi-Res无损", Id = 30251 },
+ };
+
+ ///
+ /// 获取支持的视频画质
+ ///
+ ///
+ public static List GetResolutions()
+ {
+ // 使用深复制,
+ // 保证外部修改list后,
+ // 不会影响其他调用处
+ return new List(resolutions);
+ }
+
+ ///
+ /// 获取视频编码代码
+ ///
+ ///
+ public static List GetCodecIds()
+ {
+ // 使用深复制,
+ // 保证外部修改list后,
+ // 不会影响其他调用处
+ return new List(codecIds);
+ }
+
+ ///
+ /// 获取支持的视频音质
+ ///
+ ///
+ public static List GetAudioQualities()
+ {
+ // 使用深复制,
+ // 保证外部修改list后,
+ // 不会影响其他调用处
+ return new List(qualities);
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/BiliUtils/DanmakuSender.cs b/DownKyi.Core/BiliApi/BiliUtils/DanmakuSender.cs
new file mode 100644
index 0000000..0ede811
--- /dev/null
+++ b/DownKyi.Core/BiliApi/BiliUtils/DanmakuSender.cs
@@ -0,0 +1,157 @@
+namespace DownKyi.Core.BiliApi.BiliUtils;
+
+public static class DanmakuSender
+{
+ private const uint CRCPOLYNOMIAL = 0xEDB88320;
+ private static readonly uint[] crctable = new uint[256];
+
+ static DanmakuSender()
+ {
+ CreateTable();
+ }
+
+ private static void CreateTable()
+ {
+ for (int i = 0; i < 256; i++)
+ {
+ uint crcreg = (uint)i;
+
+ for (int j = 0; j < 8; j++)
+ {
+ if ((crcreg & 1) != 0)
+ {
+ crcreg = CRCPOLYNOMIAL ^ (crcreg >> 1);
+ }
+ else
+ {
+ crcreg >>= 1;
+ }
+ }
+
+ crctable[i] = crcreg;
+ }
+ }
+
+ private static uint Crc32(string userId)
+ {
+ uint crcstart = 0xFFFFFFFF;
+ for (int i = 0; i < userId.Length; i++)
+ {
+ uint index = (uint)(crcstart ^ (int)userId[i]) & 255;
+ crcstart = (crcstart >> 8) ^ crctable[index];
+ }
+
+ return crcstart;
+ }
+
+ private static uint Crc32LastIndex(string userId)
+ {
+ uint index = 0;
+ uint crcstart = 0xFFFFFFFF;
+ for (int i = 0; i < userId.Length; i++)
+ {
+ index = (uint)((crcstart ^ (int)userId[i]) & 255);
+ crcstart = (crcstart >> 8) ^ crctable[index];
+ }
+
+ return index;
+ }
+
+ private static int GetCrcIndex(long t)
+ {
+ for (int i = 0; i < 256; i++)
+ {
+ if ((crctable[i] >> 24) == t)
+ {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ private static object[] DeepCheck(int i, int[] index)
+ {
+ object[] resultArray = new object[2];
+
+ string result = "";
+ uint tc; // = 0x00;
+ var hashcode = Crc32(i.ToString());
+ tc = (uint)(hashcode & 0xff ^ index[2]);
+
+ if (!(tc <= 57 && tc >= 48))
+ {
+ resultArray[0] = 0;
+ return resultArray;
+ }
+
+ result += (tc - 48).ToString();
+ hashcode = crctable[index[2]] ^ (hashcode >> 8);
+ tc = (uint)(hashcode & 0xff ^ index[1]);
+
+ if (!(tc <= 57 && tc >= 48))
+ {
+ resultArray[0] = 0;
+ return resultArray;
+ }
+
+ result += (tc - 48).ToString();
+ hashcode = crctable[index[1]] ^ (hashcode >> 8);
+ tc = (uint)(hashcode & 0xff ^ index[0]);
+
+ if (!(tc <= 57 && tc >= 48))
+ {
+ resultArray[0] = 0;
+ return resultArray;
+ }
+
+ result += (tc - 48).ToString();
+ //hashcode = crctable[index[0]] ^ (hashcode >> 8);
+
+ resultArray[0] = 1;
+ resultArray[1] = result;
+ return resultArray;
+ }
+
+ ///
+ /// 查询弹幕发送者
+ ///
+ ///
+ ///
+ public static string FindDanmakuSender(string userId)
+ {
+ object[] deepCheckData = new object[2];
+
+ int[] index = new int[4];
+ uint ht = (uint)Convert.ToInt32($"0x{userId}", 16);
+ ht ^= 0xffffffff;
+
+ int i;
+ for (i = 3; i > -1; i--)
+ {
+ index[3 - i] = GetCrcIndex(ht >> (i * 8));
+ uint snum = crctable[index[3 - i]];
+ ht ^= snum >> ((3 - i) * 8);
+ }
+
+ for (i = 0; i < 100000000; i++)
+ {
+ uint lastindex = Crc32LastIndex(i.ToString());
+ if (lastindex == index[3])
+ {
+ deepCheckData = DeepCheck(i, index);
+ if ((int)deepCheckData[0] != 0)
+ {
+ break;
+ }
+ }
+ }
+
+ if (i == 100000000)
+ {
+ return "-1";
+ }
+
+ return $"{i}{deepCheckData[1]}";
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/BiliUtils/ParseEntrance.cs b/DownKyi.Core/BiliApi/BiliUtils/ParseEntrance.cs
new file mode 100644
index 0000000..2d20a96
--- /dev/null
+++ b/DownKyi.Core/BiliApi/BiliUtils/ParseEntrance.cs
@@ -0,0 +1,575 @@
+using DownKyi.Core.Utils.Validator;
+using System.Text.RegularExpressions;
+
+namespace DownKyi.Core.BiliApi.BiliUtils;
+
+///
+/// 解析输入的字符串
+/// 支持的格式有:
+/// av号:av170001, AV170001, https://www.bilibili.com/video/av170001
+/// BV号:BV17x411w7KC, https://www.bilibili.com/video/BV17x411w7KC, https://b23.tv/BV17x411w7KC
+/// 番剧(电影、电视剧)ss号:ss32982, SS32982, https://www.bilibili.com/bangumi/play/ss32982
+/// 番剧(电影、电视剧)ep号:ep317925, EP317925, https://www.bilibili.com/bangumi/play/ep317925
+/// 番剧(电影、电视剧)md号:md28228367, MD28228367, https://www.bilibili.com/bangumi/media/md28228367
+/// 课程ss号:https://www.bilibili.com/cheese/play/ss205
+/// 课程ep号:https://www.bilibili.com/cheese/play/ep3489
+/// 收藏夹:ml1329019876, ML1329019876, https://www.bilibili.com/medialist/detail/ml1329019876, https://www.bilibili.com/medialist/play/ml1329019876/
+/// 用户空间:uid928123, UID928123, uid:928123, UID:928123, https://space.bilibili.com/928123
+///
+public static class ParseEntrance
+{
+ public static readonly string WwwUrl = "https://www.bilibili.com";
+ public static readonly string ShareWwwUrl = "https://www.bilibili.com/s";
+ public static readonly string ShortUrl = "https://b23.tv/";
+ public static readonly string MobileUrl = "https://m.bilibili.com";
+
+ public static readonly string SpaceUrl = "https://space.bilibili.com";
+
+ public static readonly string VideoUrl = $"{WwwUrl}/video/";
+ public static readonly string BangumiUrl = $"{WwwUrl}/bangumi/play/";
+ public static readonly string BangumiMediaUrl = $"{WwwUrl}/bangumi/media/";
+ public static readonly string CheeseUrl = $"{WwwUrl}/cheese/play/";
+ public static readonly string FavoritesUrl1 = $"{WwwUrl}/medialist/detail/";
+ public static readonly string FavoritesUrl2 = $"{WwwUrl}/medialist/play/";
+
+ #region 视频
+
+ ///
+ /// 是否为av id
+ ///
+ ///
+ ///
+ public static bool IsAvId(string input)
+ {
+ return IsIntId(input, "av");
+ }
+
+ ///
+ /// 是否为av url
+ ///
+ ///
+ ///
+ public static bool IsAvUrl(string input)
+ {
+ string id = GetVideoId(input);
+ return IsAvId(id);
+ }
+
+ ///
+ /// 获取av id
+ ///
+ ///
+ ///
+ public static long GetAvId(string input)
+ {
+ if (IsAvId(input))
+ {
+ return Number.GetInt(input.Remove(0, 2));
+ }
+ else if (IsAvUrl(input))
+ {
+ return Number.GetInt(GetVideoId(input).Remove(0, 2));
+ }
+ else
+ {
+ return -1;
+ }
+ }
+
+ ///
+ /// 是否为bv id
+ ///
+ ///
+ ///
+ public static bool IsBvId(string input)
+ {
+ return input.StartsWith("BV") && input.Length == 12;
+ }
+
+ ///
+ /// 是否为bv url
+ ///
+ ///
+ ///
+ public static bool IsBvUrl(string input)
+ {
+ string id = GetVideoId(input);
+ return IsBvId(id);
+ }
+
+ ///
+ /// 获取bv id
+ ///
+ ///
+ ///
+ public static string GetBvId(string input)
+ {
+ if (IsBvId(input))
+ {
+ return input;
+ }
+ else if (IsBvUrl(input))
+ {
+ return GetVideoId(input);
+ }
+ else
+ {
+ return "";
+ }
+ }
+
+ #endregion
+
+ #region 番剧(电影、电视剧)
+
+ ///
+ /// 是否为番剧season id
+ ///
+ ///
+ ///
+ public static bool IsBangumiSeasonId(string input)
+ {
+ return IsIntId(input, "ss");
+ }
+
+ ///
+ /// 是否为番剧season url
+ ///
+ ///
+ ///
+ public static bool IsBangumiSeasonUrl(string input)
+ {
+ string id = GetBangumiId(input);
+ return IsBangumiSeasonId(id);
+ }
+
+ ///
+ /// 获取番剧season id
+ ///
+ ///
+ ///
+ public static long GetBangumiSeasonId(string input)
+ {
+ if (IsBangumiSeasonId(input))
+ {
+ return Number.GetInt(input.Remove(0, 2));
+ }
+ else if (IsBangumiSeasonUrl(input))
+ {
+ return Number.GetInt(GetBangumiId(input).Remove(0, 2));
+ }
+ else
+ {
+ return -1;
+ }
+ }
+
+ ///
+ /// 是否为番剧episode id
+ ///
+ ///
+ ///
+ public static bool IsBangumiEpisodeId(string input)
+ {
+ return IsIntId(input, "ep");
+ }
+
+ ///
+ /// 是否为番剧episode url
+ ///
+ ///
+ ///
+ public static bool IsBangumiEpisodeUrl(string input)
+ {
+ string id = GetBangumiId(input);
+ return IsBangumiEpisodeId(id);
+ }
+
+ ///
+ /// 获取番剧episode id
+ ///
+ ///
+ ///
+ public static long GetBangumiEpisodeId(string input)
+ {
+ if (IsBangumiEpisodeId(input))
+ {
+ return Number.GetInt(input.Remove(0, 2));
+ }
+ else if (IsBangumiEpisodeUrl(input))
+ {
+ return Number.GetInt(GetBangumiId(input).Remove(0, 2));
+ }
+ else
+ {
+ return -1;
+ }
+ }
+
+ ///
+ /// 是否为番剧media id
+ ///
+ ///
+ ///
+ public static bool IsBangumiMediaId(string input)
+ {
+ return IsIntId(input, "md");
+ }
+
+ ///
+ /// 是否为番剧media url
+ ///
+ ///
+ ///
+ public static bool IsBangumiMediaUrl(string input)
+ {
+ string id = GetBangumiId(input);
+ return IsBangumiMediaId(id);
+ }
+
+ ///
+ /// 获取番剧media id
+ ///
+ ///
+ ///
+ public static long GetBangumiMediaId(string input)
+ {
+ if (IsBangumiMediaId(input))
+ {
+ return Number.GetInt(input.Remove(0, 2));
+ }
+ else if (IsBangumiMediaUrl(input))
+ {
+ return Number.GetInt(GetBangumiId(input).Remove(0, 2));
+ }
+ else
+ {
+ return -1;
+ }
+ }
+
+ #endregion
+
+ #region 课程
+
+ ///
+ /// 是否为课程season url
+ ///
+ ///
+ ///
+ public static bool IsCheeseSeasonUrl(string input)
+ {
+ string id = GetCheeseId(input);
+ return IsIntId(id, "ss");
+ }
+
+ ///
+ /// 获取课程season id
+ ///
+ ///
+ ///
+ public static long GetCheeseSeasonId(string input)
+ {
+ return IsCheeseSeasonUrl(input) ? Number.GetInt(GetCheeseId(input).Remove(0, 2)) : -1;
+ }
+
+ ///
+ /// 是否为课程episode url
+ ///
+ ///
+ ///
+ public static bool IsCheeseEpisodeUrl(string input)
+ {
+ string id = GetCheeseId(input);
+ return IsIntId(id, "ep");
+ }
+
+ ///
+ /// 获取课程episode id
+ ///
+ ///
+ ///
+ public static long GetCheeseEpisodeId(string input)
+ {
+ return IsCheeseEpisodeUrl(input) ? Number.GetInt(GetCheeseId(input).Remove(0, 2)) : -1;
+ }
+
+ #endregion
+
+ #region 收藏夹
+
+ ///
+ /// 是否为收藏夹id
+ ///
+ ///
+ ///
+ public static bool IsFavoritesId(string input)
+ {
+ return IsIntId(input, "ml");
+ }
+
+ ///
+ /// 是否为收藏夹url
+ ///
+ ///
+ ///
+ public static bool IsFavoritesUrl(string input)
+ {
+ return IsFavoritesUrl1(input) || IsFavoritesUrl2(input);
+ }
+
+ ///
+ /// 是否为收藏夹url1
+ ///
+ ///
+ ///
+ private static bool IsFavoritesUrl1(string input)
+ {
+ string favoritesId = GetId(input, FavoritesUrl1);
+ return IsFavoritesId(favoritesId);
+ }
+
+ ///
+ /// 是否为收藏夹ur2
+ ///
+ ///
+ ///
+ private static bool IsFavoritesUrl2(string input)
+ {
+ string favoritesId = GetId(input, FavoritesUrl2);
+ return IsFavoritesId(favoritesId.Split('/')[0]);
+ }
+
+ ///
+ /// 获取收藏夹id
+ ///
+ ///
+ ///
+ public static long GetFavoritesId(string input)
+ {
+ if (IsFavoritesId(input))
+ {
+ return Number.GetInt(input.Remove(0, 2));
+ }
+ else if (IsFavoritesUrl1(input))
+ {
+ return Number.GetInt(GetId(input, FavoritesUrl1).Remove(0, 2));
+ }
+ else if (IsFavoritesUrl2(input))
+ {
+ return Number.GetInt(GetId(input, FavoritesUrl2).Remove(0, 2).Split('/')[0]);
+ }
+ else
+ {
+ return -1;
+ }
+ }
+
+ #endregion
+
+ #region 用户空间
+
+ ///
+ /// 是否为用户id
+ ///
+ ///
+ ///
+ public static bool IsUserId(string input)
+ {
+ if (input.ToLower().StartsWith("uid:"))
+ {
+ return Regex.IsMatch(input.Remove(0, 4), @"^\d+$");
+ }
+ else if (input.ToLower().StartsWith("uid"))
+ {
+ return Regex.IsMatch(input.Remove(0, 3), @"^\d+$");
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ ///
+ /// 是否为用户空间url
+ ///
+ ///
+ ///
+ public static bool IsUserUrl(string input)
+ {
+ if (!IsUrl(input))
+ {
+ return false;
+ }
+
+ if (input.Contains("space.bilibili.com"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ ///
+ /// 获取用户mid
+ ///
+ ///
+ ///
+ public static long GetUserId(string input)
+ {
+ if (input.ToLower().StartsWith("uid:"))
+ {
+ return Number.GetInt(input.Remove(0, 4));
+ }
+ else if (input.ToLower().StartsWith("uid"))
+ {
+ return Number.GetInt(input.Remove(0, 3));
+ }
+ else if (IsUserUrl(input))
+ {
+ string url = EnableHttps(input);
+ url = DeleteUrlParam(url);
+ var match = Regex.Match(url, @"\d+");
+ if (match.Success)
+ {
+ return long.Parse(match.Value);
+ }
+ else
+ {
+ return -1;
+ }
+ }
+ else
+ {
+ return -1;
+ }
+ }
+
+ #endregion
+
+ ///
+ /// 是否为网址
+ ///
+ ///
+ ///
+ private static bool IsUrl(string input)
+ {
+ return input.StartsWith("http://") || input.StartsWith("https://");
+ }
+
+ ///
+ /// 将http转为https
+ ///
+ ///
+ private static string EnableHttps(string url)
+ {
+ if (!IsUrl(url))
+ {
+ return null;
+ }
+
+ return url.Replace("http://", "https://");
+ }
+
+ ///
+ /// 去除url中的参数
+ ///
+ ///
+ ///
+ private static string DeleteUrlParam(string url)
+ {
+ string[] strList = url.Split('?');
+
+ return strList[0].EndsWith("/") ? strList[0].TrimEnd('/') : strList[0];
+ }
+
+ ///
+ /// 从url中获取视频id(avid/bvid)
+ ///
+ ///
+ ///
+ private static string GetVideoId(string input)
+ {
+ return GetId(input, VideoUrl);
+ }
+
+ ///
+ /// 从url中获取番剧id(ss/ep/md)
+ ///
+ ///
+ ///
+ private static string GetBangumiId(string input)
+ {
+ string id = GetId(input, BangumiUrl);
+ if (id != "")
+ {
+ return id;
+ }
+
+ return GetId(input, BangumiMediaUrl);
+ }
+
+ ///
+ /// 从url中获取课程id(ss/ep)
+ ///
+ ///
+ ///
+ private static string GetCheeseId(string input)
+ {
+ return GetId(input, CheeseUrl);
+ }
+
+ ///
+ /// 是否为数字型id
+ ///
+ ///
+ ///
+ ///
+ private static bool IsIntId(string input, string prefix)
+ {
+ if (input.ToLower().StartsWith(prefix))
+ {
+ return Regex.IsMatch(input.Remove(0, 2), @"^\d+$");
+ }
+
+ return false;
+ }
+
+ ///
+ /// 从url中获取id
+ ///
+ ///
+ ///
+ ///
+ private static string GetId(string input, string baseUrl)
+ {
+ if (!IsUrl(input))
+ {
+ return "";
+ }
+
+ string url = EnableHttps(input);
+ url = DeleteUrlParam(url);
+
+ url = url.Replace(ShareWwwUrl, WwwUrl);
+ url = url.Replace(MobileUrl, WwwUrl);
+
+ if (url.Contains("b23.tv/ss") || url.Contains("b23.tv/ep"))
+ {
+ url = url.Replace(ShortUrl, BangumiUrl);
+ }
+ else
+ {
+ url = url.Replace(ShortUrl, VideoUrl);
+ }
+
+ if (!url.StartsWith(baseUrl))
+ {
+ return "";
+ }
+
+ return url.Replace(baseUrl, "");
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/BiliUtils/Quality.cs b/DownKyi.Core/BiliApi/BiliUtils/Quality.cs
new file mode 100644
index 0000000..3640f37
--- /dev/null
+++ b/DownKyi.Core/BiliApi/BiliUtils/Quality.cs
@@ -0,0 +1,8 @@
+namespace DownKyi.Core.BiliApi.BiliUtils;
+
+[Serializable]
+public class Quality
+{
+ public string Name { get; set; }
+ public int Id { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/BilibiliImages.axaml b/DownKyi.Core/BiliApi/BilibiliImages.axaml
new file mode 100644
index 0000000..70f2345
--- /dev/null
+++ b/DownKyi.Core/BiliApi/BilibiliImages.axaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Cheese/CheeseInfo.cs b/DownKyi.Core/BiliApi/Cheese/CheeseInfo.cs
new file mode 100644
index 0000000..1b85dba
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Cheese/CheeseInfo.cs
@@ -0,0 +1,88 @@
+using DownKyi.Core.BiliApi.Cheese.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Cheese;
+
+public static class CheeseInfo
+{
+ ///
+ /// 获取课程基本信息
+ ///
+ ///
+ ///
+ ///
+ public static CheeseView CheeseViewInfo(long seasonId = -1, long episodeId = -1)
+ {
+ string baseUrl = "https://api.bilibili.com/pugv/view/web/season";
+ string referer = "https://www.bilibili.com";
+ string url;
+ if (seasonId > -1)
+ {
+ url = $"{baseUrl}?season_id={seasonId}";
+ }
+ else if (episodeId > -1)
+ {
+ url = $"{baseUrl}?ep_id={episodeId}";
+ }
+ else
+ {
+ return null;
+ }
+
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ CheeseViewOrigin cheese = JsonConvert.DeserializeObject(response);
+ if (cheese != null)
+ {
+ return cheese.Data;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("CheeseViewInfo()发生异常: {0}", e);
+ LogManager.Error("CheeseInfo", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 获取课程分集列表
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static CheeseEpisodeList CheeseEpisodeList(long seasonId, int ps = 50, int pn = 1)
+ {
+ string url = $"https://api.bilibili.com/pugv/view/web/ep/list?season_id={seasonId}&pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ CheeseEpisodeListOrigin cheese = JsonConvert.DeserializeObject(response);
+ if (cheese != null)
+ {
+ return cheese.Data;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("CheeseEpisodeList()发生异常: {0}", e);
+ LogManager.Error("CheeseInfo", e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Cheese/Models/CheeseBrief.cs b/DownKyi.Core/BiliApi/Cheese/Models/CheeseBrief.cs
new file mode 100644
index 0000000..5ba20c0
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Cheese/Models/CheeseBrief.cs
@@ -0,0 +1,12 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Cheese.Models;
+
+public class CheeseBrief : BaseModel
+{
+ // content
+ [JsonProperty("img")] public List Img { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("type")] public int Type { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Cheese/Models/CheeseEpisode.cs b/DownKyi.Core/BiliApi/Cheese/Models/CheeseEpisode.cs
new file mode 100644
index 0000000..c5dfa37
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Cheese/Models/CheeseEpisode.cs
@@ -0,0 +1,25 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Cheese.Models;
+
+public class CheeseEpisode : BaseModel
+{
+ [JsonProperty("aid")] public long Aid { get; set; }
+ [JsonProperty("catalogue_index")] public int CatalogueIndex { get; set; }
+ [JsonProperty("cid")] public long Cid { get; set; }
+ [JsonProperty("cover")] public string Cover { get; set; }
+ [JsonProperty("duration")] public long Duration { get; set; }
+ [JsonProperty("from")] public string From { get; set; }
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("index")] public int Index { get; set; }
+ [JsonProperty("page")] public int Page { get; set; }
+ [JsonProperty("play")] public long Play { get; set; }
+ [JsonProperty("play_way")] public int PlayWay { get; set; }
+ [JsonProperty("play_way_format")] public string PlayWayFormat { get; set; }
+ [JsonProperty("release_date")] public long ReleaseDate { get; set; }
+ [JsonProperty("status")] public int Status { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("watched")] public bool Watched { get; set; }
+ [JsonProperty("watchedHistory")] public int WatchedHistory { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Cheese/Models/CheeseEpisodeList.cs b/DownKyi.Core/BiliApi/Cheese/Models/CheeseEpisodeList.cs
new file mode 100644
index 0000000..4f028a6
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Cheese/Models/CheeseEpisodeList.cs
@@ -0,0 +1,20 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Cheese.Models;
+
+// https://api.bilibili.com/pugv/view/web/ep/list
+public class CheeseEpisodeListOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ [JsonProperty("data")] public CheeseEpisodeList Data { get; set; }
+}
+
+public class CheeseEpisodeList : BaseModel
+{
+ [JsonProperty("items")] public List Items { get; set; }
+ [JsonProperty("page")] public CheeseEpisodePage Page { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Cheese/Models/CheeseEpisodePage.cs b/DownKyi.Core/BiliApi/Cheese/Models/CheeseEpisodePage.cs
new file mode 100644
index 0000000..c876eea
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Cheese/Models/CheeseEpisodePage.cs
@@ -0,0 +1,12 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Cheese.Models;
+
+public class CheeseEpisodePage : BaseModel
+{
+ [JsonProperty("next")] public bool Next { get; set; }
+ [JsonProperty("num")] public int Num { get; set; }
+ [JsonProperty("size")] public int Size { get; set; }
+ [JsonProperty("total")] public int Total { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Cheese/Models/CheeseImg.cs b/DownKyi.Core/BiliApi/Cheese/Models/CheeseImg.cs
new file mode 100644
index 0000000..b630576
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Cheese/Models/CheeseImg.cs
@@ -0,0 +1,10 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Cheese.Models;
+
+public class CheeseImg : BaseModel
+{
+ [JsonProperty("aspect_ratio")] public double AspectRatio { get; set; }
+ [JsonProperty("url")] public string Url { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Cheese/Models/CheeseStat.cs b/DownKyi.Core/BiliApi/Cheese/Models/CheeseStat.cs
new file mode 100644
index 0000000..55b2168
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Cheese/Models/CheeseStat.cs
@@ -0,0 +1,10 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Cheese.Models;
+
+public class CheeseStat : BaseModel
+{
+ [JsonProperty("play")] public long Play { get; set; }
+ [JsonProperty("play_desc")] public string PlayDesc { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Cheese/Models/CheeseUpInfo.cs b/DownKyi.Core/BiliApi/Cheese/Models/CheeseUpInfo.cs
new file mode 100644
index 0000000..296ca9f
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Cheese/Models/CheeseUpInfo.cs
@@ -0,0 +1,15 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Cheese.Models;
+
+public class CheeseUpInfo : BaseModel
+{
+ [JsonProperty("avatar")] public string Avatar { get; set; }
+ [JsonProperty("brief")] public string Brief { get; set; }
+ [JsonProperty("follower")] public long Follower { get; set; }
+ [JsonProperty("is_follow")] public int IsFollow { get; set; }
+ [JsonProperty("link")] public string Link { get; set; }
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("uname")] public string Name { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Cheese/Models/CheeseView.cs b/DownKyi.Core/BiliApi/Cheese/Models/CheeseView.cs
new file mode 100644
index 0000000..e98f229
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Cheese/Models/CheeseView.cs
@@ -0,0 +1,63 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Cheese.Models;
+
+// https://api.bilibili.com/pugv/view/web/season
+public class CheeseViewOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ [JsonProperty("data")] public CheeseView Data { get; set; }
+}
+
+public class CheeseView : BaseModel
+{
+ // active_market
+ // activity_list
+ [JsonProperty("brief")] public CheeseBrief Brief { get; set; }
+
+ // cooperation
+ // coupon
+ // course_content
+ // courses
+ [JsonProperty("cover")] public string Cover { get; set; }
+
+ // ep_catalogue
+ // ep_count
+ // episode_page
+ // episode_sort
+ // episode_tag
+ [JsonProperty("episodes")] public List Episodes { get; set; }
+
+ // faq
+ // faq1
+ // live_ep_count
+ // opened_ep_count
+ // payment
+ // previewed_purchase_note
+ // purchase_format_note
+ // purchase_note
+ // purchase_protocol
+ // recommend_seasons 推荐课程
+ // release_bottom_info
+ // release_info
+ // release_info2
+ // release_status
+ [JsonProperty("season_id")] public long SeasonId { get; set; }
+
+ [JsonProperty("share_url")] public string ShareUrl { get; set; }
+
+ // short_link
+ [JsonProperty("stat")] public CheeseStat Stat { get; set; }
+
+ // status
+ [JsonProperty("subtitle")] public string Subtitle { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+
+ [JsonProperty("up_info")] public CheeseUpInfo UpInfo { get; set; }
+ // update_status
+ // user_status
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Danmaku/DanmakuProtobuf.cs b/DownKyi.Core/BiliApi/Danmaku/DanmakuProtobuf.cs
new file mode 100644
index 0000000..c65234b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Danmaku/DanmakuProtobuf.cs
@@ -0,0 +1,107 @@
+using Bilibili.Community.Service.Dm.V1;
+using DownKyi.Core.BiliApi.Danmaku.Models;
+using DownKyi.Core.Storage;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Danmaku;
+
+public static class DanmakuProtobuf
+{
+ ///
+ /// 下载6分钟内的弹幕,返回弹幕列表
+ ///
+ /// 稿件avID
+ /// 视频CID
+ /// 分包,每6分钟一包
+ ///
+ public static List GetDanmakuProto(long avid, long cid, int segmentIndex)
+ {
+ string url =
+ $"https://api.bilibili.com/x/v2/dm/web/seg.so?type=1&oid={cid}&pid={avid}&segment_index={segmentIndex}";
+ //string referer = "https://www.bilibili.com";
+
+ string directory = Path.Combine(StorageManager.GetDanmaku(), $"{cid}");
+ string filePath = Path.Combine(directory, $"{segmentIndex}.proto");
+ if (!Directory.Exists(directory))
+ {
+ Directory.CreateDirectory(directory);
+ }
+
+ try
+ {
+ System.Net.WebClient mywebclient = new System.Net.WebClient();
+ mywebclient.DownloadFile(url, filePath);
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetDanmakuProto()发生异常: {0}", e);
+ //Logging.LogManager.Error(e);
+ }
+
+ var danmakuList = new List();
+ try
+ {
+ using (var input = File.OpenRead(filePath))
+ {
+ DmSegMobileReply danmakus = DmSegMobileReply.Parser.ParseFrom(input);
+ if (danmakus == null || danmakus.Elems == null)
+ {
+ return danmakuList;
+ }
+
+ foreach (var dm in danmakus.Elems)
+ {
+ var danmaku = new BiliDanmaku
+ {
+ Id = dm.Id,
+ Progress = dm.Progress,
+ Mode = dm.Mode,
+ Fontsize = dm.Fontsize,
+ Color = dm.Color,
+ MidHash = dm.MidHash,
+ Content = dm.Content,
+ Ctime = dm.Ctime,
+ Weight = dm.Weight,
+ //Action = dm.Action,
+ Pool = dm.Pool
+ };
+ danmakuList.Add(danmaku);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetDanmakuProto()发生异常: {0}", e);
+ //Logging.LogManager.Error(e);
+ return null;
+ }
+
+ return danmakuList;
+ }
+
+ ///
+ /// 下载所有弹幕,返回弹幕列表
+ ///
+ /// 稿件avID
+ /// 视频CID
+ ///
+ public static List GetAllDanmakuProto(long avid, long cid)
+ {
+ var danmakuList = new List();
+
+ int segmentIndex = 0;
+ while (true)
+ {
+ segmentIndex += 1;
+ var danmakus = GetDanmakuProto(avid, cid, segmentIndex);
+ if (danmakus == null)
+ {
+ break;
+ }
+
+ danmakuList.AddRange(danmakus);
+ }
+
+ return danmakuList;
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Danmaku/Models/BiliDanmaku.cs b/DownKyi.Core/BiliApi/Danmaku/Models/BiliDanmaku.cs
new file mode 100644
index 0000000..b33bc00
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Danmaku/Models/BiliDanmaku.cs
@@ -0,0 +1,34 @@
+namespace DownKyi.Core.BiliApi.Danmaku.Models;
+
+public class BiliDanmaku
+{
+ public long Id { get; set; } //弹幕dmID
+ public int Progress { get; set; } //出现时间
+ public int Mode { get; set; } //弹幕类型
+ public int Fontsize { get; set; } //文字大小
+ public uint Color { get; set; } //弹幕颜色
+ public string MidHash { get; set; } //发送者UID的HASH
+ public string Content { get; set; } //弹幕内容
+ public long Ctime { get; set; } //发送时间
+
+ public int Weight { get; set; } //权重
+
+ //public string Action { get; set; } //动作?
+ public int Pool { get; set; } //弹幕池
+
+ public override string ToString()
+ {
+ string separator = "\n";
+ return $"id: {Id}{separator}" +
+ $"progress: {Progress}{separator}" +
+ $"mode: {Mode}{separator}" +
+ $"fontsize: {Fontsize}{separator}" +
+ $"color: {Color}{separator}" +
+ $"midHash: {MidHash}{separator}" +
+ $"content: {Content}{separator}" +
+ $"ctime: {Ctime}{separator}" +
+ $"weight: {Weight}{separator}" +
+ //$"action: {Action}{separator}" +
+ $"pool: {Pool}";
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Favorites/FavoritesInfo.cs b/DownKyi.Core/BiliApi/Favorites/FavoritesInfo.cs
new file mode 100644
index 0000000..6274e9b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Favorites/FavoritesInfo.cs
@@ -0,0 +1,155 @@
+using DownKyi.Core.BiliApi.Favorites.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Favorites;
+
+public static class FavoritesInfo
+{
+ ///
+ /// 获取收藏夹元数据
+ ///
+ ///
+ public static FavoritesMetaInfo GetFavoritesInfo(long mediaId)
+ {
+ string url = $"https://api.bilibili.com/x/v3/fav/folder/info?media_id={mediaId}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var info = JsonConvert.DeserializeObject(response);
+ if (info != null)
+ {
+ return info.Data;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetFavoritesInfo()发生异常: {0}", e);
+ LogManager.Error("FavoritesInfo", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询用户创建的视频收藏夹
+ ///
+ /// 目标用户UID
+ /// 页码
+ /// 每页项数
+ ///
+ public static List GetCreatedFavorites(long mid, int pn, int ps)
+ {
+ string url = $"https://api.bilibili.com/x/v3/fav/folder/created/list?up_mid={mid}&pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var favorites = JsonConvert.DeserializeObject(response);
+ if (favorites == null || favorites.Data == null || favorites.Data.List == null)
+ {
+ return null;
+ }
+
+ return favorites.Data.List;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetCreatedFavorites()发生异常: {0}", e);
+ LogManager.Error("FavoritesInfo", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询所有的用户创建的视频收藏夹
+ ///
+ /// 目标用户UID
+ ///
+ public static List GetAllCreatedFavorites(long mid)
+ {
+ List result = new List();
+
+ int i = 0;
+ while (true)
+ {
+ i++;
+ int ps = 50;
+
+ var data = GetCreatedFavorites(mid, i, ps);
+ if (data == null || data.Count == 0)
+ {
+ break;
+ }
+
+ result.AddRange(data);
+ }
+
+ return result;
+ }
+
+ ///
+ /// 查询用户收藏的视频收藏夹
+ ///
+ /// 目标用户UID
+ /// 页码
+ /// 每页项数
+ ///
+ public static List GetCollectedFavorites(long mid, int pn, int ps)
+ {
+ string url = $"https://api.bilibili.com/x/v3/fav/folder/collected/list?up_mid={mid}&pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var favorites = JsonConvert.DeserializeObject(response);
+ if (favorites == null || favorites.Data == null || favorites.Data.List == null)
+ {
+ return null;
+ }
+
+ return favorites.Data.List;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetCollectedFavorites()发生异常: {0}", e);
+ LogManager.Error("FavoritesInfo", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询所有的用户收藏的视频收藏夹
+ ///
+ /// 目标用户UID
+ ///
+ public static List GetAllCollectedFavorites(long mid)
+ {
+ List result = new List();
+
+ int i = 0;
+ while (true)
+ {
+ i++;
+ int ps = 50;
+
+ var data = GetCollectedFavorites(mid, i, ps);
+ if (data == null || data.Count == 0)
+ {
+ break;
+ }
+
+ result.AddRange(data);
+ }
+
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Favorites/FavoritesResource.cs b/DownKyi.Core/BiliApi/Favorites/FavoritesResource.cs
new file mode 100644
index 0000000..1142df3
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Favorites/FavoritesResource.cs
@@ -0,0 +1,96 @@
+using DownKyi.Core.BiliApi.Favorites.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Favorites;
+
+public static class FavoritesResource
+{
+ ///
+ /// 获取收藏夹内容明细列表
+ ///
+ /// 收藏夹ID
+ /// 页码
+ /// 每页项数
+ ///
+ public static List GetFavoritesMedia(long mediaId, int pn, int ps)
+ {
+ string url =
+ $"https://api.bilibili.com/x/v3/fav/resource/list?media_id={mediaId}&pn={pn}&ps={ps}&platform=web";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var resource = JsonConvert.DeserializeObject(response);
+ if (resource == null || resource.Data == null || resource.Data.Medias == null)
+ {
+ return null;
+ }
+
+ return resource.Data.Medias;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("GetFavoritesMedia()发生异常: {0}", e);
+ LogManager.Error("FavoritesResource", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 获取收藏夹内容明细列表(全部)
+ ///
+ /// 收藏夹ID
+ ///
+ public static List GetAllFavoritesMedia(long mediaId)
+ {
+ List result = new List();
+
+ int i = 0;
+ while (true)
+ {
+ i++;
+ int ps = 20;
+
+ var data = GetFavoritesMedia(mediaId, i, ps);
+ if (data == null || data.Count == 0)
+ {
+ break;
+ }
+
+ result.AddRange(data);
+ }
+
+ return result;
+ }
+
+ ///
+ /// 获取收藏夹全部内容id
+ ///
+ ///
+ ///
+ public static List GetFavoritesMediaId(long mediaId)
+ {
+ string url = $"https://api.bilibili.com/x/v3/fav/resource/ids?media_id={mediaId}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var media = JsonConvert.DeserializeObject(response);
+ if (media == null || media.Data == null)
+ {
+ return null;
+ }
+
+ return media.Data;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("GetFavoritesMediaId()发生异常: {0}", e);
+ LogManager.Error("FavoritesResource", e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Favorites/Models/FavStatus.cs b/DownKyi.Core/BiliApi/Favorites/Models/FavStatus.cs
new file mode 100644
index 0000000..2af2685
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Favorites/Models/FavStatus.cs
@@ -0,0 +1,12 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Favorites.Models;
+
+public class FavStatus : BaseModel
+{
+ [JsonProperty("collect")] public long Collect { get; set; }
+ [JsonProperty("play")] public long Play { get; set; }
+ [JsonProperty("thumb_up")] public long ThumbUp { get; set; }
+ [JsonProperty("share")] public long Share { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Favorites/Models/FavUpper.cs b/DownKyi.Core/BiliApi/Favorites/Models/FavUpper.cs
new file mode 100644
index 0000000..166e83d
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Favorites/Models/FavUpper.cs
@@ -0,0 +1,15 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Favorites.Models;
+
+public class FavUpper : BaseModel
+{
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+ [JsonProperty("face")] public string Face { get; set; }
+
+ [JsonProperty("followed")] public bool Followed { get; set; }
+ // vip_type
+ // vip_statue
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Favorites/Models/FavoritesList.cs b/DownKyi.Core/BiliApi/Favorites/Models/FavoritesList.cs
new file mode 100644
index 0000000..1665a2b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Favorites/Models/FavoritesList.cs
@@ -0,0 +1,25 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Favorites.Models;
+
+// https://api.bilibili.com/x/v3/fav/folder/collected/list
+public class FavoritesListOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public FavoritesList Data { get; set; }
+}
+
+public class FavoritesList : BaseModel
+{
+ [JsonProperty("count")] public int Count { get; set; }
+
+ [JsonProperty("list")] public List List { get; set; }
+ //[JsonProperty("has_more")]
+ //public bool HasMore { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMedia.cs b/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMedia.cs
new file mode 100644
index 0000000..fe176fe
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMedia.cs
@@ -0,0 +1,30 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Favorites.Models;
+
+public class FavoritesMedia : BaseModel
+{
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("type")] public int Type { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("cover")] public string Cover { get; set; }
+ [JsonProperty("intro")] public string Intro { get; set; }
+ [JsonProperty("page")] public int Page { get; set; }
+ [JsonProperty("duration")] public long Duration { get; set; }
+
+ [JsonProperty("upper")] public FavUpper Upper { get; set; }
+
+ // attr
+ [JsonProperty("cnt_info")] public MediaStatus CntInfo { get; set; }
+ [JsonProperty("link")] public string Link { get; set; }
+ [JsonProperty("ctime")] public long Ctime { get; set; }
+ [JsonProperty("pubtime")] public long Pubtime { get; set; }
+ [JsonProperty("fav_time")] public long FavTime { get; set; }
+ [JsonProperty("bv_id")] public string BvId { get; set; }
+
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+ // season
+ // ogv
+ // ugc
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMediaId.cs b/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMediaId.cs
new file mode 100644
index 0000000..7e54bb5
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMediaId.cs
@@ -0,0 +1,24 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Favorites.Models;
+
+// https://api.bilibili.com/x/v3/fav/resource/ids
+public class FavoritesMediaIdOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public List Data { get; set; }
+}
+
+public class FavoritesMediaId : BaseModel
+{
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("type")] public int Type { get; set; }
+ [JsonProperty("bv_id")] public string BvId { get; set; }
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMediaResource.cs b/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMediaResource.cs
new file mode 100644
index 0000000..316ca3b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMediaResource.cs
@@ -0,0 +1,23 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Favorites.Models;
+
+// https://api.bilibili.com/x/v3/fav/resource/list
+public class FavoritesMediaResourceOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public FavoritesMediaResource Data { get; set; }
+}
+
+public class FavoritesMediaResource : BaseModel
+{
+ [JsonProperty("info")] public FavoritesMetaInfo Info { get; set; }
+ [JsonProperty("medias")] public List Medias { get; set; }
+ [JsonProperty("has_more")] public bool HasMore { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMetaInfo.cs b/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMetaInfo.cs
new file mode 100644
index 0000000..705c6f5
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Favorites/Models/FavoritesMetaInfo.cs
@@ -0,0 +1,44 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Favorites.Models;
+
+// https://api.bilibili.com/x/v3/fav/folder/info
+public class FavoritesMetaInfoOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public FavoritesMetaInfo Data { get; set; }
+}
+
+public class FavoritesMetaInfo : BaseModel
+{
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("fid")] public long Fid { get; set; }
+
+ [JsonProperty("mid")] public long Mid { get; set; }
+
+ // attr
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("cover")] public string Cover { get; set; }
+
+ [JsonProperty("upper")] public FavUpper Upper { get; set; }
+
+ // cover_type
+ [JsonProperty("cnt_info")] public FavStatus CntInfo { get; set; }
+
+ // type
+ [JsonProperty("intro")] public string Intro { get; set; }
+ [JsonProperty("ctime")] public long Ctime { get; set; }
+
+ [JsonProperty("mtime")] public long Mtime { get; set; }
+
+ // state
+ [JsonProperty("fav_state")] public int FavState { get; set; }
+ [JsonProperty("like_state")] public int LikeState { get; set; }
+ [JsonProperty("media_count")] public int MediaCount { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Favorites/Models/MediaStatus.cs b/DownKyi.Core/BiliApi/Favorites/Models/MediaStatus.cs
new file mode 100644
index 0000000..d56c16e
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Favorites/Models/MediaStatus.cs
@@ -0,0 +1,11 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Favorites.Models;
+
+public class MediaStatus : BaseModel
+{
+ [JsonProperty("collect")] public long Collect { get; set; }
+ [JsonProperty("play")] public long Play { get; set; }
+ [JsonProperty("danmaku")] public long Danmaku { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/History/History.cs b/DownKyi.Core/BiliApi/History/History.cs
new file mode 100644
index 0000000..1bfd2bd
--- /dev/null
+++ b/DownKyi.Core/BiliApi/History/History.cs
@@ -0,0 +1,63 @@
+using DownKyi.Core.BiliApi.History.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using System;
+
+namespace DownKyi.Core.BiliApi.History
+{
+ ///
+ /// 历史记录
+ ///
+ public static class History
+ {
+ ///
+ /// 获取历史记录列表(视频、直播、专栏)
+ /// startId和startTime必须同时使用才有效,分别对应结果中的max和view_at,默认为0
+ ///
+ /// 历史记录开始目标ID
+ /// 历史记录开始时间
+ /// 每页项数
+ /// 历史记录ID类型
+ ///
+ public static HistoryData GetHistory(long startId, long startTime, int ps = 30, HistoryBusiness business = HistoryBusiness.ARCHIVE)
+ {
+ string businessStr = string.Empty;
+ switch (business)
+ {
+ case HistoryBusiness.ARCHIVE:
+ businessStr = "archive";
+ break;
+ case HistoryBusiness.PGC:
+ businessStr = "pgc";
+ break;
+ case HistoryBusiness.LIVE:
+ businessStr = "live";
+ break;
+ case HistoryBusiness.ARTICLE_LIST:
+ businessStr = "article-list";
+ break;
+ case HistoryBusiness.ARTICLE:
+ businessStr = "article";
+ break;
+ }
+
+ string url = $"https://api.bilibili.com/x/web-interface/history/cursor?max={startId}&view_at={startTime}&ps={ps}&business={businessStr}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var history = JsonConvert.DeserializeObject(response);
+ if (history == null || history.Data == null) { return null; }
+ return history.Data;
+ }
+ catch (Exception e)
+ {
+ Utils.Debugging.Console.PrintLine("GetHistory()发生异常: {0}", e);
+ LogManager.Error("History", e);
+ return null;
+ }
+ }
+
+ }
+}
diff --git a/DownKyi.Core/BiliApi/History/Models/HistoryBusiness.cs b/DownKyi.Core/BiliApi/History/Models/HistoryBusiness.cs
new file mode 100644
index 0000000..0b40257
--- /dev/null
+++ b/DownKyi.Core/BiliApi/History/Models/HistoryBusiness.cs
@@ -0,0 +1,11 @@
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ public enum HistoryBusiness
+ {
+ ARCHIVE = 1, // 稿件
+ PGC, // 番剧(影视)
+ LIVE, // 直播
+ ARTICLE_LIST, // 文集
+ ARTICLE, // 文章
+ }
+}
diff --git a/DownKyi.Core/BiliApi/History/Models/HistoryCursor.cs b/DownKyi.Core/BiliApi/History/Models/HistoryCursor.cs
new file mode 100644
index 0000000..c6641e7
--- /dev/null
+++ b/DownKyi.Core/BiliApi/History/Models/HistoryCursor.cs
@@ -0,0 +1,17 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ public class HistoryCursor : BaseModel
+ {
+ [JsonProperty("max")]
+ public long Max { get; set; }
+ [JsonProperty("view_at")]
+ public long ViewAt { get; set; }
+ [JsonProperty("business")]
+ public string Business { get; set; }
+ [JsonProperty("ps")]
+ public int Ps { get; set; }
+ }
+}
diff --git a/DownKyi.Core/BiliApi/History/Models/HistoryData.cs b/DownKyi.Core/BiliApi/History/Models/HistoryData.cs
new file mode 100644
index 0000000..ca58a5b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/History/Models/HistoryData.cs
@@ -0,0 +1,28 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ // https://api.bilibili.com/x/web-interface/history/cursor?max={startId}&view_at={startTime}&ps={ps}&business={businessStr}
+ public class HistoryOrigin : BaseModel
+ {
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")]
+ public HistoryData Data { get; set; }
+ }
+
+ public class HistoryData : BaseModel
+ {
+ [JsonProperty("cursor")]
+ public HistoryCursor Cursor { get; set; }
+ //public List tab { get; set; }
+ [JsonProperty("list")]
+ public List List { get; set; }
+ }
+}
diff --git a/DownKyi.Core/BiliApi/History/Models/HistoryList.cs b/DownKyi.Core/BiliApi/History/Models/HistoryList.cs
new file mode 100644
index 0000000..5ac7372
--- /dev/null
+++ b/DownKyi.Core/BiliApi/History/Models/HistoryList.cs
@@ -0,0 +1,46 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ public class HistoryList : BaseModel
+ {
+ [JsonProperty("title")]
+ public string Title { get; set; }
+ // long_title
+ [JsonProperty("cover")]
+ public string Cover { get; set; }
+ // covers
+ [JsonProperty("uri")]
+ public string Uri { get; set; }
+ [JsonProperty("history")]
+ public HistoryListHistory History { get; set; }
+ [JsonProperty("videos")]
+ public int Videos { get; set; }
+ [JsonProperty("author_name")]
+ public string AuthorName { get; set; }
+ [JsonProperty("author_face")]
+ public string AuthorFace { get; set; }
+ [JsonProperty("author_mid")]
+ public long AuthorMid { get; set; }
+ [JsonProperty("view_at")]
+ public long ViewAt { get; set; }
+ [JsonProperty("progress")]
+ public long Progress { get; set; }
+ // badge
+ [JsonProperty("show_title")]
+ public string ShowTitle { get; set; }
+ [JsonProperty("duration")]
+ public long Duration { get; set; }
+ // current
+ // total
+ [JsonProperty("new_desc")]
+ public string NewDesc { get; set; }
+ // is_finish
+ // is_fav
+ // kid
+ [JsonProperty("tag_name")]
+ public string TagName { get; set; }
+ // live_status
+ }
+}
diff --git a/DownKyi.Core/BiliApi/History/Models/HistoryListHistory.cs b/DownKyi.Core/BiliApi/History/Models/HistoryListHistory.cs
new file mode 100644
index 0000000..8ea33f0
--- /dev/null
+++ b/DownKyi.Core/BiliApi/History/Models/HistoryListHistory.cs
@@ -0,0 +1,25 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ public class HistoryListHistory : BaseModel
+ {
+ [JsonProperty("oid")]
+ public long Oid { get; set; }
+ [JsonProperty("epid")]
+ public long Epid { get; set; }
+ [JsonProperty("bvid")]
+ public string Bvid { get; set; }
+ [JsonProperty("page")]
+ public int Page { get; set; }
+ [JsonProperty("cid")]
+ public long Cid { get; set; }
+ [JsonProperty("part")]
+ public string Part { get; set; }
+ [JsonProperty("business")]
+ public string Business { get; set; }
+ [JsonProperty("dt")]
+ public int Dt { get; set; }
+ }
+}
diff --git a/DownKyi.Core/BiliApi/History/Models/ToViewData.cs b/DownKyi.Core/BiliApi/History/Models/ToViewData.cs
new file mode 100644
index 0000000..5c1a7ac
--- /dev/null
+++ b/DownKyi.Core/BiliApi/History/Models/ToViewData.cs
@@ -0,0 +1,27 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ // https://api.bilibili.com/x/v2/history/toview
+ public class ToViewOrigin : BaseModel
+ {
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")]
+ public ToViewData Data { get; set; }
+ }
+
+ public class ToViewData : BaseModel
+ {
+ [JsonProperty("count")]
+ public int Count { get; set; }
+ [JsonProperty("list")]
+ public List List { get; set; }
+ }
+}
diff --git a/DownKyi.Core/BiliApi/History/Models/ToViewList.cs b/DownKyi.Core/BiliApi/History/Models/ToViewList.cs
new file mode 100644
index 0000000..4458a94
--- /dev/null
+++ b/DownKyi.Core/BiliApi/History/Models/ToViewList.cs
@@ -0,0 +1,43 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ public class ToViewList : BaseModel
+ {
+ [JsonProperty("aid")]
+ public long Aid { get; set; }
+ // videos
+ // tid
+ // tname
+ // copyright
+ [JsonProperty("pic")]
+ public string Pic { get; set; }
+ [JsonProperty("title")]
+ public string Title { get; set; }
+ // pubdate
+ // ctime
+ // desc
+ // state
+ // duration
+ // rights
+ [JsonProperty("owner")]
+ public VideoOwner Owner { get; set; }
+ // stat
+ // dynamic
+ // dimension
+ // short_link_v2
+ // first_frame
+ // page
+ // count
+ [JsonProperty("cid")]
+ public long Cid { get; set; }
+ // progress
+ [JsonProperty("add_at")]
+ public long AddAt { get; set; }
+ [JsonProperty("bvid")]
+ public string Bvid { get; set; }
+ // uri
+ // viewed
+ }
+}
diff --git a/DownKyi.Core/BiliApi/History/ToView.cs b/DownKyi.Core/BiliApi/History/ToView.cs
new file mode 100644
index 0000000..354569b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/History/ToView.cs
@@ -0,0 +1,38 @@
+using DownKyi.Core.BiliApi.History.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+
+namespace DownKyi.Core.BiliApi.History
+{
+ ///
+ /// 稍后再看
+ ///
+ public static class ToView
+ {
+ ///
+ /// 获取稍后再看视频列表
+ ///
+ ///
+ public static List GetToView()
+ {
+ string url = "https://api.bilibili.com/x/v2/history/toview";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var toView = JsonConvert.DeserializeObject(response);
+ if (toView == null || toView.Data == null) { return null; }
+ return toView.Data.List;
+ }
+ catch (Exception e)
+ {
+ Utils.Debugging.Console.PrintLine("GetToView()发生异常: {0}", e);
+ LogManager.Error("ToView", e);
+ return null;
+ }
+ }
+ }
+}
diff --git a/DownKyi.Core/BiliApi/Login/LoginHelper.cs b/DownKyi.Core/BiliApi/Login/LoginHelper.cs
new file mode 100644
index 0000000..1136f3c
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Login/LoginHelper.cs
@@ -0,0 +1,156 @@
+using System.Net;
+using DownKyi.Core.Logging;
+using DownKyi.Core.Settings;
+using DownKyi.Core.Settings.Models;
+using DownKyi.Core.Storage;
+using DownKyi.Core.Utils;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Login
+{
+ public static class LoginHelper
+ {
+ // 本地位置
+ private static readonly string LOCAL_LOGIN_INFO = StorageManager.GetLogin();
+
+ // 16位密码,ps:密码位数没有限制,可任意设置
+ private static readonly string SecretKey = "EsOat*^y1QR!&0J6";
+
+ ///
+ /// 保存登录的cookies到文件
+ ///
+ ///
+ ///
+ public static bool SaveLoginInfoCookies(string url)
+ {
+ string tempFile = LOCAL_LOGIN_INFO + "-" + Guid.NewGuid().ToString("N");
+ CookieContainer cookieContainer = ObjectHelper.ParseCookie(url);
+
+ bool isSucceed = ObjectHelper.WriteCookiesToDisk(tempFile, cookieContainer);
+ if (isSucceed)
+ {
+ // 加密密钥,增加机器码
+ string password = SecretKey;
+
+ try
+ {
+ File.Copy(tempFile, LOCAL_LOGIN_INFO, true);
+ // Encryptor.EncryptFile(tempFile, LOCAL_LOGIN_INFO, password);
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("SaveLoginInfoCookies()发生异常: {0}", e);
+ LogManager.Error(e);
+ return false;
+ }
+ }
+
+ if (File.Exists(tempFile))
+ {
+ File.Delete(tempFile);
+ }
+
+ return isSucceed;
+ }
+
+
+ ///
+ /// 获得登录的cookies
+ ///
+ ///
+ public static CookieContainer GetLoginInfoCookies()
+ {
+ string tempFile = LOCAL_LOGIN_INFO + "-" + Guid.NewGuid().ToString("N");
+
+ if (File.Exists(LOCAL_LOGIN_INFO))
+ {
+ try
+ {
+ File.Copy(LOCAL_LOGIN_INFO, tempFile, true);
+ // 加密密钥,增加机器码
+ // string password = SecretKey;
+ // Encryptor.DecryptFile(LOCAL_LOGIN_INFO, tempFile, password);
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetLoginInfoCookies()发生异常: {0}", e);
+ LogManager.Error(e);
+ if (File.Exists(tempFile))
+ {
+ File.Delete(tempFile);
+ }
+
+ return null;
+ }
+ }
+ else
+ {
+ return null;
+ }
+
+ CookieContainer cookies = ObjectHelper.ReadCookiesFromDisk(tempFile);
+
+ if (File.Exists(tempFile))
+ {
+ File.Delete(tempFile);
+ }
+
+ return cookies;
+ }
+
+ ///
+ /// 返回登录信息的cookies的字符串
+ ///
+ ///
+ public static string GetLoginInfoCookiesString()
+ {
+ var cookieContainer = GetLoginInfoCookies();
+ if (cookieContainer == null)
+ {
+ return "";
+ }
+
+ var cookies = ObjectHelper.GetAllCookies(cookieContainer);
+
+ string cookie = string.Empty;
+ foreach (var item in cookies)
+ {
+ cookie += item.ToString() + ";";
+ }
+
+ return cookie.TrimEnd(';');
+ }
+
+ ///
+ /// 注销登录
+ ///
+ ///
+ public static bool Logout()
+ {
+ if (File.Exists(LOCAL_LOGIN_INFO))
+ {
+ try
+ {
+ File.Delete(LOCAL_LOGIN_INFO);
+
+ SettingsManager.GetInstance().SetUserInfo(new UserInfoSettings
+ {
+ Mid = -1,
+ Name = "",
+ IsLogin = false,
+ IsVip = false
+ });
+ return true;
+ }
+ catch (IOException e)
+ {
+ Console.PrintLine("Logout()发生异常: {0}", e);
+ LogManager.Error(e);
+ return false;
+ }
+ }
+
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Login/LoginQR.cs b/DownKyi.Core/BiliApi/Login/LoginQR.cs
new file mode 100644
index 0000000..c2dc09b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Login/LoginQR.cs
@@ -0,0 +1,87 @@
+using Avalonia.Media.Imaging;
+using DownKyi.Core.BiliApi.Login.Models;
+using DownKyi.Core.Logging;
+using DownKyi.Core.Utils;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Login;
+
+public static class LoginQR
+{
+ ///
+ /// 申请二维码URL及扫码密钥(web端)
+ ///
+ ///
+ public static LoginUrlOrigin? GetLoginUrl()
+ {
+ string getLoginUrl = "https://passport.bilibili.com/x/passport-login/web/qrcode/generate";
+ string response = WebClient.RequestWeb(getLoginUrl);
+ Console.Out.WriteLine(response);
+ try
+ {
+ return JsonConvert.DeserializeObject(response);
+ }
+ catch (Exception e)
+ {
+ Utils.Debugging.Console.PrintLine("GetLoginUrl()发生异常: {0}", e);
+ LogManager.Error("LoginQR", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 使用扫码登录(web端)
+ ///
+ ///
+ ///
+ ///
+ public static LoginStatus? GetLoginStatus(string qrcodeKey, string goUrl = "https://www.bilibili.com")
+ {
+ string url = "https://passport.bilibili.com/x/passport-login/web/qrcode/poll?qrcode_key=" + qrcodeKey;
+
+ string response = WebClient.RequestWeb(url);
+
+ try
+ {
+ return JsonConvert.DeserializeObject(response);
+ }
+ catch (Exception e)
+ {
+ Utils.Debugging.Console.PrintLine("GetLoginInfo()发生异常: {0}", e);
+ LogManager.Error("LoginQR", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 获得登录二维码
+ ///
+ ///
+ public static Bitmap GetLoginQRCode()
+ {
+ try
+ {
+ string loginUrl = GetLoginUrl().Data.Url;
+ return GetLoginQRCode(loginUrl);
+ }
+ catch (Exception e)
+ {
+ Utils.Debugging.Console.PrintLine("GetLoginQRCode()发生异常: {0}", e);
+ LogManager.Error("LoginQR", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 根据输入url生成二维码
+ ///
+ ///
+ ///
+ public static Bitmap GetLoginQRCode(string url)
+ {
+ // 设置的参数影响app能否成功扫码
+ Bitmap qrCode = QRCode.EncodeQRCode(url, 10, 10, null, 0, 0, false);
+
+ return qrCode;
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Login/Models/LoginStatus.cs b/DownKyi.Core/BiliApi/Login/Models/LoginStatus.cs
new file mode 100644
index 0000000..4981ff2
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Login/Models/LoginStatus.cs
@@ -0,0 +1,23 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Login.Models
+{
+ [JsonObject]
+ public class LoginStatus : BaseModel
+ {
+ [JsonProperty("code")] public int Code { get; set; }
+ [JsonProperty("message")] public string Message { get; set; }
+
+ [JsonProperty("data")] public LoginStatusData Data { get; set; }
+ }
+
+ [JsonObject]
+ public class LoginStatusData : BaseModel
+ {
+ [JsonProperty("url")] public string Url { get; set; }
+ [JsonProperty("refresh_token")] public string RefreshToken { get; set; }
+ [JsonProperty("code")] public int Code { get; set; }
+ [JsonProperty("message")] public string Message { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Login/Models/LoginUrl.cs b/DownKyi.Core/BiliApi/Login/Models/LoginUrl.cs
new file mode 100644
index 0000000..ebaff22
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Login/Models/LoginUrl.cs
@@ -0,0 +1,23 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Login.Models
+{
+ // https://passport.bilibili.com/qrcode/getLoginUrl
+ [JsonObject]
+ public class LoginUrlOrigin : BaseModel
+ {
+ //public int code { get; set; }
+ [JsonProperty("data")] public LoginUrl Data { get; set; }
+
+ [JsonProperty("code")] public int Code { get; set; }
+ //public long ts { get; set; }
+ }
+
+ [JsonObject]
+ public class LoginUrl : BaseModel
+ {
+ [JsonProperty("qrcode_key")] public string QrcodeKey { get; set; }
+ [JsonProperty("url")] public string Url { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Models/BaseModel.cs b/DownKyi.Core/BiliApi/Models/BaseModel.cs
new file mode 100644
index 0000000..674a0a0
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Models/BaseModel.cs
@@ -0,0 +1,29 @@
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Models;
+
+public abstract class BaseModel
+{
+ public string ToString(string format = "")
+ {
+ // 设置为去掉null
+ var jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
+
+ switch (format)
+ {
+ case "":
+ return JsonConvert.SerializeObject(this);
+ case "F":
+ // 整理json格式
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ case "N":
+ // 去掉null后,转换为json字符串
+ return JsonConvert.SerializeObject(this, Formatting.None, jsonSetting);
+ case "FN":
+ case "NF":
+ return JsonConvert.SerializeObject(this, Formatting.Indented, jsonSetting);
+ default:
+ return ToString();
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Models/Dimension.cs b/DownKyi.Core/BiliApi/Models/Dimension.cs
new file mode 100644
index 0000000..7056f0d
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Models/Dimension.cs
@@ -0,0 +1,10 @@
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Models;
+
+public class Dimension : BaseModel
+{
+ [JsonProperty("width")] public int Width { get; set; }
+ [JsonProperty("height")] public int Height { get; set; }
+ [JsonProperty("rotate")] public int Rotate { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Models/Json/SubRipText.cs b/DownKyi.Core/BiliApi/Models/Json/SubRipText.cs
new file mode 100644
index 0000000..bab5c86
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Models/Json/SubRipText.cs
@@ -0,0 +1,10 @@
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Models.Json;
+
+public class SubRipText : BaseModel
+{
+ [JsonProperty("lan")] public string Lan { get; set; }
+ [JsonProperty("lan_doc")] public string LanDoc { get; set; }
+ [JsonProperty("srtString")] public string SrtString { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Models/Json/Subtitle.cs b/DownKyi.Core/BiliApi/Models/Json/Subtitle.cs
new file mode 100644
index 0000000..ca35b4e
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Models/Json/Subtitle.cs
@@ -0,0 +1,11 @@
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Models.Json;
+
+public class Subtitle : BaseModel
+{
+ [JsonProperty("from")] public float From { get; set; }
+ [JsonProperty("to")] public float To { get; set; }
+ [JsonProperty("location")] public int Location { get; set; }
+ [JsonProperty("content")] public string Content { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Models/Json/SubtitleJson.cs b/DownKyi.Core/BiliApi/Models/Json/SubtitleJson.cs
new file mode 100644
index 0000000..8ead11a
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Models/Json/SubtitleJson.cs
@@ -0,0 +1,59 @@
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Models.Json;
+
+public class SubtitleJson : BaseModel
+{
+ [JsonProperty("font_size")] public float FontSize { get; set; }
+ [JsonProperty("font_color")] public string FontColor { get; set; }
+ [JsonProperty("background_alpha")] public float BackgroundAlpha { get; set; }
+ [JsonProperty("background_color")] public string BackgroundColor { get; set; }
+ [JsonProperty("Stroke")] public string Stroke { get; set; }
+ [JsonProperty("body")] public List Body { get; set; }
+
+ ///
+ /// srt格式字幕
+ ///
+ ///
+ public string ToSubRip()
+ {
+ string subRip = string.Empty;
+ for (int i = 0; i < Body.Count; i++)
+ {
+ subRip += $"{i + 1}\n";
+ subRip += $"{Second2hms(Body[i].From)} --> {Second2hms(Body[i].To)}\n";
+ subRip += $"{Body[i].Content}\n";
+ subRip += "\n";
+ }
+
+ return subRip;
+ }
+
+ ///
+ /// 秒数转 时:分:秒 格式
+ ///
+ ///
+ ///
+ private static string Second2hms(float seconds)
+ {
+ if (seconds < 0)
+ {
+ return "00:00:00,000";
+ }
+
+ int i = (int)Math.Floor(seconds / 1.0);
+ int dec = (int)(Math.Round(seconds % 1.0f, 2) * 100);
+ if (dec >= 100)
+ {
+ dec = 99;
+ }
+
+ int min = (int)Math.Floor(i / 60.0);
+ int second = (int)(i % 60.0f);
+
+ int hour = (int)Math.Floor(min / 60.0);
+ min = (int)Math.Floor(min % 60.0f);
+
+ return $"{hour:D2}:{min:D2}:{second:D2},{dec:D3}";
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Models/VideoOwner.cs b/DownKyi.Core/BiliApi/Models/VideoOwner.cs
new file mode 100644
index 0000000..92b4112
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Models/VideoOwner.cs
@@ -0,0 +1,10 @@
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Models;
+
+public class VideoOwner : BaseModel
+{
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+ [JsonProperty("face")] public string Face { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Sign/WbiSign.cs b/DownKyi.Core/BiliApi/Sign/WbiSign.cs
new file mode 100644
index 0000000..c950d08
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Sign/WbiSign.cs
@@ -0,0 +1,116 @@
+using System.Security.Cryptography;
+using System.Text;
+using System.Text.RegularExpressions;
+using DownKyi.Core.Settings;
+
+namespace DownKyi.Core.BiliApi.Sign;
+
+public static class WbiSign
+{
+ ///
+ /// 打乱重排实时口令
+ ///
+ ///
+ ///
+ private static string GetMixinKey(string origin)
+ {
+ int[] mixinKeyEncTab = {
+ 46, 47, 18, 2, 53, 8, 23, 32, 15, 50, 10, 31, 58, 3, 45, 35, 27, 43, 5, 49,
+ 33, 9, 42, 19, 29, 28, 14, 39, 12, 38, 41, 13, 37, 48, 7, 16, 24, 55, 40,
+ 61, 26, 17, 0, 1, 60, 51, 30, 4, 22, 25, 54, 21, 56, 59, 6, 63, 57, 62, 11,
+ 36, 20, 34, 44, 52
+ };
+
+ var temp = new StringBuilder();
+ foreach (var i in mixinKeyEncTab)
+ {
+ temp.Append(origin[i]);
+ }
+
+ return temp.ToString().Substring(0, 32);
+ }
+
+ ///
+ /// 将字典参数转为字符串
+ ///
+ ///
+ ///
+ public static string ParametersToQuery(Dictionary parameters)
+ {
+ var keys = parameters.Keys.ToList();
+ var queryList = new List();
+ foreach (var item in keys)
+ {
+ var value = parameters[item];
+ queryList.Add($"{item}={value}");
+ }
+
+ return string.Join("&", queryList);
+ }
+
+ ///
+ /// Wbi签名,返回所有参数字典
+ ///
+ ///
+ ///
+ public static Dictionary EncodeWbi(Dictionary parameters)
+ {
+ return EncodeWbi(parameters, GetKey().Item1, GetKey().Item2);
+ }
+
+ ///
+ /// Wbi签名,返回所有参数字典
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static Dictionary EncodeWbi(Dictionary parameters, string imgKey,
+ string subKey)
+ {
+ var mixinKey = GetMixinKey(imgKey + subKey);
+
+ var chrFilter = new Regex("[!'()*]");
+
+ var newParameters = new Dictionary
+ {
+ { "wts", (long)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds }
+ };
+
+ foreach (var para in parameters)
+ {
+ var key = para.Key;
+ var value = para.Value.ToString();
+
+ var encodedValue = chrFilter.Replace(value, "");
+
+ newParameters.Add(Uri.EscapeDataString(key), Uri.EscapeDataString(encodedValue));
+ }
+
+ var keys = newParameters.Keys.ToList();
+ keys.Sort();
+
+ var queryList = new List();
+ foreach (var item in keys)
+ {
+ var value = newParameters[item];
+ queryList.Add($"{item}={value}");
+ }
+
+ var queryString = string.Join("&", queryList);
+ var md5Hasher = MD5.Create();
+ var hashStr = queryString + mixinKey;
+ var hashedQueryString = md5Hasher.ComputeHash(Encoding.UTF8.GetBytes(hashStr));
+ var wbiSign = BitConverter.ToString(hashedQueryString).Replace("-", "").ToLower();
+
+ newParameters.Add("w_rid", wbiSign);
+ return newParameters;
+ }
+
+ public static Tuple GetKey()
+ {
+ var user = SettingsManager.GetInstance().GetUserInfo();
+
+ return new Tuple(user.ImgKey, user.SubKey);
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/BangumiFollow.cs b/DownKyi.Core/BiliApi/Users/Models/BangumiFollow.cs
new file mode 100644
index 0000000..f1eb8b4
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/BangumiFollow.cs
@@ -0,0 +1,65 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class BangumiFollow : BaseModel
+{
+ [JsonProperty("season_id")] public long SeasonId { get; set; }
+ [JsonProperty("media_id")] public long MediaId { get; set; }
+ [JsonProperty("season_type")] public int SeasonType { get; set; }
+ [JsonProperty("season_type_name")] public string SeasonTypeName { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("cover")] public string Cover { get; set; }
+
+ [JsonProperty("total_count")] public int TotalCount { get; set; }
+
+ // is_finish
+ // is_started
+ // is_play
+ [JsonProperty("badge")] public string Badge { get; set; }
+
+ [JsonProperty("badge_type")] public int BadgeType { get; set; }
+
+ // rights
+ // stat
+ [JsonProperty("new_ep")] public BangumiFollowNewEp NewEp { get; set; }
+
+ // rating
+ // square_cover
+ [JsonProperty("season_status")] public int SeasonStatus { get; set; }
+ [JsonProperty("season_title")] public string SeasonTitle { get; set; }
+
+ [JsonProperty("badge_ep")] public string BadgeEp { get; set; }
+
+ // media_attr
+ // season_attr
+ [JsonProperty("evaluate")] public string Evaluate { get; set; }
+ [JsonProperty("areas")] public List Areas { get; set; }
+ [JsonProperty("subtitle")] public string Subtitle { get; set; }
+
+ [JsonProperty("first_ep")] public long FirstEp { get; set; }
+
+ // can_watch
+ // series
+ // publish
+ // mode
+ // section
+ [JsonProperty("url")] public string Url { get; set; }
+
+ // badge_info
+ // first_ep_info
+ // formal_ep_count
+ // short_url
+ // badge_infos
+ // season_version
+ // horizontal_cover_16_9
+ // horizontal_cover_16_10
+ // subtitle_14
+ // viewable_crowd_type
+ // producers
+ // follow_status
+ // is_new
+ [JsonProperty("progress")] public string Progress { get; set; }
+ // both_follow
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/BangumiFollowAreas.cs b/DownKyi.Core/BiliApi/Users/Models/BangumiFollowAreas.cs
new file mode 100644
index 0000000..853ad76
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/BangumiFollowAreas.cs
@@ -0,0 +1,10 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class BangumiFollowAreas : BaseModel
+{
+ [JsonProperty("id")] public int Id { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/BangumiFollowNewEp.cs b/DownKyi.Core/BiliApi/Users/Models/BangumiFollowNewEp.cs
new file mode 100644
index 0000000..e607591
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/BangumiFollowNewEp.cs
@@ -0,0 +1,15 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class BangumiFollowNewEp : BaseModel
+{
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("index_show")] public string IndexShow { get; set; }
+ [JsonProperty("cover")] public string Cover { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("long_title")] public string LongTitle { get; set; }
+ [JsonProperty("pub_time")] public string PubTime { get; set; }
+ [JsonProperty("duration")] public long Duration { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/BangumiFollowOrigin.cs b/DownKyi.Core/BiliApi/Users/Models/BangumiFollowOrigin.cs
new file mode 100644
index 0000000..bb731ad
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/BangumiFollowOrigin.cs
@@ -0,0 +1,18 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/space/bangumi/follow/list?vmid={mid}&type={type:D}&pn={pn}&ps={ps}
+public class BangumiFollowOrigin : BaseModel
+{
+ [JsonProperty("data")] public BangumiFollowData Data { get; set; }
+}
+
+public class BangumiFollowData : BaseModel
+{
+ [JsonProperty("list")] public List List { get; set; }
+ [JsonProperty("pn")] public int Pn { get; set; }
+ [JsonProperty("ps")] public int Ps { get; set; }
+ [JsonProperty("total")] public int Total { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/BangumiType.cs b/DownKyi.Core/BiliApi/Users/Models/BangumiType.cs
new file mode 100644
index 0000000..4f63dcd
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/BangumiType.cs
@@ -0,0 +1,7 @@
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public enum BangumiType
+{
+ ANIME = 1, // 番剧
+ EPISODE = 2 // 剧集、电影
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/FollowingGroup.cs b/DownKyi.Core/BiliApi/Users/Models/FollowingGroup.cs
new file mode 100644
index 0000000..c26fbf2
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/FollowingGroup.cs
@@ -0,0 +1,18 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/relation/tags
+public class FollowingGroupOrigin : BaseModel
+{
+ [JsonProperty("data")] public List Data { get; set; }
+}
+
+public class FollowingGroup : BaseModel
+{
+ [JsonProperty("tagid")] public int TagId { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+ [JsonProperty("count")] public int Count { get; set; }
+ [JsonProperty("tip")] public string Tip { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/FollowingGroupContent.cs b/DownKyi.Core/BiliApi/Users/Models/FollowingGroupContent.cs
new file mode 100644
index 0000000..25a9e10
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/FollowingGroupContent.cs
@@ -0,0 +1,10 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/relation/tag?tagid={tagId}&pn={pn}&ps={ps}&order_type={orderType}
+public class FollowingGroupContent : BaseModel
+{
+ [JsonProperty("data")] public List Data { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/FollowingOrder.cs b/DownKyi.Core/BiliApi/Users/Models/FollowingOrder.cs
new file mode 100644
index 0000000..90e684d
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/FollowingOrder.cs
@@ -0,0 +1,7 @@
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public enum FollowingOrder
+{
+ DEFAULT = 1, // 按照关注顺序排列,默认
+ ATTENTION // 按照最常访问排列
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/MyInfo.cs b/DownKyi.Core/BiliApi/Users/Models/MyInfo.cs
new file mode 100644
index 0000000..6a19039
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/MyInfo.cs
@@ -0,0 +1,59 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/space/myinfo
+public class MyInfoOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public MyInfo Data { get; set; }
+}
+
+public class MyInfo : BaseModel
+{
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+ [JsonProperty("sex")] public string Sex { get; set; }
+ [JsonProperty("face")] public string Face { get; set; }
+
+ [JsonProperty("sign")] public string Sign { get; set; }
+
+ // rank
+ [JsonProperty("level")] public int Level { get; set; }
+
+ // jointime
+ [JsonProperty("moral")] public int Moral { get; set; }
+ [JsonProperty("silence")] public int Silence { get; set; }
+ [JsonProperty("email_status")] public int EmailStatus { get; set; }
+ [JsonProperty("tel_status")] public int TelStatus { get; set; }
+ [JsonProperty("identification")] public int Identification { get; set; }
+
+ [JsonProperty("vip")] public UserInfoVip Vip { get; set; }
+
+ // pendant
+ // nameplate
+ // official
+ [JsonProperty("birthday")] public long Birthday { get; set; }
+ [JsonProperty("is_tourist")] public int IsTourist { get; set; }
+ [JsonProperty("is_fake_account")] public int IsFakeAccount { get; set; }
+ [JsonProperty("pin_prompting")] public int PinPrompting { get; set; }
+
+ [JsonProperty("is_deleted")] public int IsDeleted { get; set; }
+
+ // in_reg_audit
+ // is_rip_user
+ // profession
+ // face_nft
+ // face_nft_new
+ // is_senior_member
+ [JsonProperty("level_exp")] public UserInfoLevelExp LevelExp { get; set; }
+ [JsonProperty("coins")] public float Coins { get; set; }
+ [JsonProperty("following")] public int Following { get; set; }
+ [JsonProperty("follower")] public int Follower { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/NicknameStatus.cs b/DownKyi.Core/BiliApi/Users/Models/NicknameStatus.cs
new file mode 100644
index 0000000..e37e7cd
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/NicknameStatus.cs
@@ -0,0 +1,11 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/relation/stat?nickName={nickName}
+public class NicknameStatus : BaseModel
+{
+ [JsonProperty("code")] public int Code { get; set; }
+ [JsonProperty("message")] public string Message { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/PublicationOrder.cs b/DownKyi.Core/BiliApi/Users/Models/PublicationOrder.cs
new file mode 100644
index 0000000..afaf859
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/PublicationOrder.cs
@@ -0,0 +1,8 @@
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public enum PublicationOrder
+{
+ PUBDATE = 1, // 最新发布,默认
+ CLICK, // 最多播放
+ STOW // 最多收藏
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/RelationBlack.cs b/DownKyi.Core/BiliApi/Users/Models/RelationBlack.cs
new file mode 100644
index 0000000..b3e4647
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/RelationBlack.cs
@@ -0,0 +1,10 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/relation/blacks?pn={pn}&ps={ps}
+public class RelationBlack : BaseModel
+{
+ [JsonProperty("data")] public List Data { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/RelationFollow.cs b/DownKyi.Core/BiliApi/Users/Models/RelationFollow.cs
new file mode 100644
index 0000000..efde758
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/RelationFollow.cs
@@ -0,0 +1,20 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/relation/followers?vmid={mid}&pn={pn}&ps={ps}
+// https://api.bilibili.com/x/relation/followings?vmid={mid}&pn={pn}&ps={ps}&order_type={orderType}
+public class RelationFollowOrigin : BaseModel
+{
+ [JsonProperty("data")] public RelationFollow Data { get; set; }
+}
+
+public class RelationFollow : BaseModel
+{
+ [JsonProperty("list")] public List List { get; set; }
+
+ //[JsonProperty("re_version")]
+ //public long reVersion { get; set; }
+ [JsonProperty("total")] public int Total { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/RelationFollowInfo.cs b/DownKyi.Core/BiliApi/Users/Models/RelationFollowInfo.cs
new file mode 100644
index 0000000..61465c5
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/RelationFollowInfo.cs
@@ -0,0 +1,24 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class RelationFollowInfo : BaseModel
+{
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("attribute")] public int Attribute { get; set; }
+ [JsonProperty("mtime")] public long Mtime { get; set; }
+ [JsonProperty("tag")] public List Tag { get; set; }
+
+ [JsonProperty("special")] public int Special { get; set; }
+
+ // contract_info
+ [JsonProperty("uname")] public string Name { get; set; }
+ [JsonProperty("face")] public string Face { get; set; }
+
+ [JsonProperty("sign")] public string Sign { get; set; }
+ // face_nft
+ // official_verify
+ // vip
+ // nft_icon
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/RelationWhisper.cs b/DownKyi.Core/BiliApi/Users/Models/RelationWhisper.cs
new file mode 100644
index 0000000..50b2688
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/RelationWhisper.cs
@@ -0,0 +1,16 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/relation/whispers?pn={pn}&ps={ps}
+public class RelationWhisper : BaseModel
+{
+ [JsonProperty("data")] public RelationWhisperData Data { get; set; }
+}
+
+public class RelationWhisperData : BaseModel
+{
+ [JsonProperty("list")] public List List { get; set; }
+ // re_version
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceChannel.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceChannel.cs
new file mode 100644
index 0000000..59ed4a0
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceChannel.cs
@@ -0,0 +1,19 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/space/channel/list?mid={mid}
+public class SpaceChannelOrigin : BaseModel
+{
+ [JsonProperty("data")]
+ public SpaceChannel Data { get; set; }
+}
+
+public class SpaceChannel : BaseModel
+{
+ [JsonProperty("count")]
+ public int Count { get; set; }
+ [JsonProperty("list")]
+ public List List { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceChannelArchive.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelArchive.cs
new file mode 100644
index 0000000..af3b31b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelArchive.cs
@@ -0,0 +1,42 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceChannelArchive : BaseModel
+{
+ [JsonProperty("aid")] public long Aid { get; set; }
+
+ // videos
+ [JsonProperty("tid")] public int Tid { get; set; }
+
+ [JsonProperty("tname")] public string Tname { get; set; }
+
+ // copyright
+ [JsonProperty("pic")] public string Pic { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("pubdate")] public long Pubdate { get; set; }
+ [JsonProperty("ctime")] public long Ctime { get; set; }
+
+ [JsonProperty("desc")] public string Desc { get; set; }
+
+ // state
+ [JsonProperty("duration")] public long Duration { get; set; }
+
+ // mission_id
+ // rights
+ [JsonProperty("owner")] public VideoOwner Owner { get; set; }
+
+ [JsonProperty("stat")] public SpaceChannelArchiveStat Stat { get; set; }
+
+ // dynamic
+ [JsonProperty("cid")] public long Cid { get; set; }
+
+ [JsonProperty("dimension")] public Dimension Dimension { get; set; }
+
+ // season_id
+ // short_link_v2
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+ // inter_video
+ // is_live_playback
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceChannelArchiveStat.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelArchiveStat.cs
new file mode 100644
index 0000000..f25912d
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelArchiveStat.cs
@@ -0,0 +1,19 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceChannelArchiveStat : BaseModel
+{
+ [JsonProperty("aid")] public long Aid { get; set; }
+ [JsonProperty("view")] public long View { get; set; }
+ [JsonProperty("danmaku")] public long Danmaku { get; set; }
+ [JsonProperty("reply")] public long Reply { get; set; }
+ [JsonProperty("favorite")] public long Favorite { get; set; }
+ [JsonProperty("coin")] public long Coin { get; set; }
+ [JsonProperty("share")] public long Share { get; set; }
+ [JsonProperty("now_rank")] public long NowRank { get; set; }
+ [JsonProperty("his_rank")] public long HisRank { get; set; }
+ [JsonProperty("like")] public long Like { get; set; }
+ [JsonProperty("dislike")] public long Dislike { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceChannelList.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelList.cs
new file mode 100644
index 0000000..7dd25fa
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelList.cs
@@ -0,0 +1,17 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceChannelList : BaseModel
+{
+ [JsonProperty("cid")] public long Cid { get; set; }
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+ [JsonProperty("intro")] public string Intro { get; set; }
+ [JsonProperty("mtime")] public long Mtime { get; set; }
+ [JsonProperty("count")] public int Count { get; set; }
+
+ [JsonProperty("cover")] public string Cover { get; set; }
+ // is_live_playback
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceChannelVideo.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelVideo.cs
new file mode 100644
index 0000000..31add32
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelVideo.cs
@@ -0,0 +1,17 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/space/channel/video?mid={mid}&cid={cid}&pn={pn}&ps={ps}
+public class SpaceChannelVideoOrigin : BaseModel
+{
+ [JsonProperty("data")] public SpaceChannelVideo Data { get; set; }
+}
+
+public class SpaceChannelVideo : BaseModel
+{
+ // episodic_button
+ [JsonProperty("list")] public SpaceChannelVideoList List { get; set; }
+ [JsonProperty("page")] public SpaceChannelVideoPage Page { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceChannelVideoList.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelVideoList.cs
new file mode 100644
index 0000000..3af26ab
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelVideoList.cs
@@ -0,0 +1,19 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceChannelVideoList : BaseModel
+{
+ [JsonProperty("cid")] public long Cid { get; set; }
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+ [JsonProperty("intro")] public string Intro { get; set; }
+ [JsonProperty("mtime")] public long Mtime { get; set; }
+ [JsonProperty("count")] public int Count { get; set; }
+
+ [JsonProperty("cover")] public string Cover { get; set; }
+
+ // is_live_playback
+ [JsonProperty("archives")] public List Archives { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceChannelVideoPage.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelVideoPage.cs
new file mode 100644
index 0000000..cf15156
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceChannelVideoPage.cs
@@ -0,0 +1,11 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceChannelVideoPage : BaseModel
+{
+ [JsonProperty("count")] public int Count { get; set; }
+ [JsonProperty("num")] public int Num { get; set; }
+ [JsonProperty("size")] public int Size { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceCheese.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceCheese.cs
new file mode 100644
index 0000000..4baf80e
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceCheese.cs
@@ -0,0 +1,17 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceCheese : BaseModel
+{
+ [JsonProperty("cover")] public string Cover { get; set; }
+ [JsonProperty("ep_count")] public int EpCount { get; set; }
+ [JsonProperty("link")] public string Link { get; set; }
+ [JsonProperty("page")] public int Page { get; set; }
+ [JsonProperty("play")] public int Play { get; set; }
+ [JsonProperty("season_id")] public long SeasonId { get; set; }
+ [JsonProperty("status")] public string Status { get; set; }
+ [JsonProperty("subtitle")] public string SubTitle { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceCheeseOrigin.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceCheeseOrigin.cs
new file mode 100644
index 0000000..9dc203b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceCheeseOrigin.cs
@@ -0,0 +1,16 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/pugv/app/web/season/page?mid={mid}&pn={pn}&ps={ps}
+public class SpaceCheeseOrigin : BaseModel
+{
+ [JsonProperty("data")] public SpaceCheeseData Data { get; set; }
+}
+
+public class SpaceCheeseData : BaseModel
+{
+ [JsonProperty("items")] public List Items { get; set; }
+ [JsonProperty("page")] public SpaceCheesePage Page { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceCheesePage.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceCheesePage.cs
new file mode 100644
index 0000000..82cc1b6
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceCheesePage.cs
@@ -0,0 +1,12 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceCheesePage : BaseModel
+{
+ [JsonProperty("next")] public bool Next { get; set; }
+ [JsonProperty("num")] public int Num { get; set; }
+ [JsonProperty("size")] public int Size { get; set; }
+ [JsonProperty("total")] public int Total { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpacePublication.cs b/DownKyi.Core/BiliApi/Users/Models/SpacePublication.cs
new file mode 100644
index 0000000..5d183e4
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpacePublication.cs
@@ -0,0 +1,16 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/space/arc/search
+public class SpacePublicationOrigin : BaseModel
+{
+ [JsonProperty("data")] public SpacePublication Data { get; set; }
+}
+
+public class SpacePublication : BaseModel
+{
+ [JsonProperty("list")] public SpacePublicationList List { get; set; }
+ [JsonProperty("page")] public SpacePublicationPage Page { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpacePublicationList.cs b/DownKyi.Core/BiliApi/Users/Models/SpacePublicationList.cs
new file mode 100644
index 0000000..03aafeb
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpacePublicationList.cs
@@ -0,0 +1,10 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpacePublicationList : BaseModel
+{
+ [JsonProperty("tlist")] public SpacePublicationListType Tlist { get; set; }
+ [JsonProperty("vlist")] public List Vlist { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpacePublicationListType.cs b/DownKyi.Core/BiliApi/Users/Models/SpacePublicationListType.cs
new file mode 100644
index 0000000..33c2184
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpacePublicationListType.cs
@@ -0,0 +1,29 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpacePublicationListType : BaseModel
+{
+ [JsonProperty("1")] public SpacePublicationListTypeVideoZone Douga { get; set; }
+ [JsonProperty("13")] public SpacePublicationListTypeVideoZone Anime { get; set; }
+ [JsonProperty("167")] public SpacePublicationListTypeVideoZone Guochuang { get; set; }
+ [JsonProperty("3")] public SpacePublicationListTypeVideoZone Music { get; set; }
+ [JsonProperty("129")] public SpacePublicationListTypeVideoZone Dance { get; set; }
+ [JsonProperty("4")] public SpacePublicationListTypeVideoZone Game { get; set; }
+ [JsonProperty("36")] public SpacePublicationListTypeVideoZone Technology { get; set; }
+ [JsonProperty("188")] public SpacePublicationListTypeVideoZone Digital { get; set; }
+ [JsonProperty("234")] public SpacePublicationListTypeVideoZone Sports { get; set; }
+ [JsonProperty("223")] public SpacePublicationListTypeVideoZone Car { get; set; }
+ [JsonProperty("160")] public SpacePublicationListTypeVideoZone Life { get; set; }
+ [JsonProperty("211")] public SpacePublicationListTypeVideoZone Food { get; set; }
+ [JsonProperty("217")] public SpacePublicationListTypeVideoZone Animal { get; set; }
+ [JsonProperty("119")] public SpacePublicationListTypeVideoZone Kichiku { get; set; }
+ [JsonProperty("155")] public SpacePublicationListTypeVideoZone Fashion { get; set; }
+ [JsonProperty("202")] public SpacePublicationListTypeVideoZone Information { get; set; }
+ [JsonProperty("5")] public SpacePublicationListTypeVideoZone Ent { get; set; }
+ [JsonProperty("181")] public SpacePublicationListTypeVideoZone Cinephile { get; set; }
+ [JsonProperty("177")] public SpacePublicationListTypeVideoZone Documentary { get; set; }
+ [JsonProperty("23")] public SpacePublicationListTypeVideoZone Movie { get; set; }
+ [JsonProperty("11")] public SpacePublicationListTypeVideoZone Tv { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpacePublicationListTypeVideoZone.cs b/DownKyi.Core/BiliApi/Users/Models/SpacePublicationListTypeVideoZone.cs
new file mode 100644
index 0000000..b1f068d
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpacePublicationListTypeVideoZone.cs
@@ -0,0 +1,11 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpacePublicationListTypeVideoZone : BaseModel
+{
+ [JsonProperty("tid")] public int Tid { get; set; }
+ [JsonProperty("count")] public int Count { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpacePublicationListVideo.cs b/DownKyi.Core/BiliApi/Users/Models/SpacePublicationListVideo.cs
new file mode 100644
index 0000000..756e5b6
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpacePublicationListVideo.cs
@@ -0,0 +1,47 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpacePublicationListVideo : BaseModel
+{
+ //[JsonProperty("comment")]
+ //public int Comment { get; set; }
+ [JsonProperty("typeid")] public int Typeid { get; set; }
+ [JsonProperty("play")] public int Play { get; set; }
+
+ [JsonProperty("pic")] public string Pic { get; set; }
+
+ //[JsonProperty("subtitle")]
+ //public string Subtitle { get; set; }
+ //[JsonProperty("description")]
+ //public string Description { get; set; }
+ //[JsonProperty("copyright")]
+ //public string Copyright { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+
+ //[JsonProperty("review")]
+ //public int Review { get; set; }
+ //[JsonProperty("author")]
+ //public string Author { get; set; }
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("created")] public long Created { get; set; }
+
+ [JsonProperty("length")] public string Length { get; set; }
+
+ //[JsonProperty("video_review")]
+ //public int VideoReview { get; set; }
+ [JsonProperty("aid")] public long Aid { get; set; }
+
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+ //[JsonProperty("hide_click")]
+ //public bool HideClick { get; set; }
+ //[JsonProperty("is_pay")]
+ //public int IsPay { get; set; }
+ //[JsonProperty("is_union_video")]
+ //public int IsUnionVideo { get; set; }
+ //[JsonProperty("is_steins_gate")]
+ //public int IsSteinsGate { get; set; }
+ //[JsonProperty("is_live_playback")]
+ //public int IsLivePlayback { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpacePublicationPage.cs b/DownKyi.Core/BiliApi/Users/Models/SpacePublicationPage.cs
new file mode 100644
index 0000000..a3d98ff
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpacePublicationPage.cs
@@ -0,0 +1,11 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpacePublicationPage : BaseModel
+{
+ [JsonProperty("pn")] public int Pn { get; set; }
+ [JsonProperty("ps")] public int Ps { get; set; }
+ [JsonProperty("count")] public int Count { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsDetail.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsDetail.cs
new file mode 100644
index 0000000..7f4eafb
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsDetail.cs
@@ -0,0 +1,24 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/polymer/space/seasons_archives_list?mid={mid}&season_id={seasonId}&page_num={pageNum}&page_size={pageSize}&sort_reverse=false
+public class SpaceSeasonsDetailOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public SpaceSeasonsDetail Data { get; set; }
+}
+
+public class SpaceSeasonsDetail : BaseModel
+{
+ [JsonProperty("aids")] public List Aids { get; set; }
+ [JsonProperty("archives")] public List Archives { get; set; }
+ [JsonProperty("meta")] public SpaceSeasonsMeta Meta { get; set; }
+ [JsonProperty("page")] public SpaceSeasonsSeriesPage Page { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeries.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeries.cs
new file mode 100644
index 0000000..37afc90
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeries.cs
@@ -0,0 +1,18 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceSeasons : BaseModel
+{
+ [JsonProperty("archives")] public List Archives { get; set; }
+ [JsonProperty("meta")] public SpaceSeasonsMeta Meta { get; set; }
+ [JsonProperty("recent_aids")] public List RecentAids { get; set; }
+}
+
+public class SpaceSeries : BaseModel
+{
+ [JsonProperty("archives")] public List Archives { get; set; }
+ [JsonProperty("meta")] public SpaceSeriesMeta Meta { get; set; }
+ [JsonProperty("recent_aids")] public List RecentAids { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesArchives.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesArchives.cs
new file mode 100644
index 0000000..0accc4a
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesArchives.cs
@@ -0,0 +1,21 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceSeasonsSeriesArchives : BaseModel
+{
+ [JsonProperty("aid")] public long Aid { get; set; }
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+ [JsonProperty("ctime")] public long Ctime { get; set; }
+ [JsonProperty("duration")] public long Duration { get; set; }
+ [JsonProperty("interactive_video")] public bool InteractiveVideo { get; set; }
+ [JsonProperty("pic")] public string Pic { get; set; }
+ [JsonProperty("pubdate")] public long Pubdate { get; set; }
+
+ [JsonProperty("stat")] public SpaceSeasonsSeriesStat Stat { get; set; }
+
+ // state
+ [JsonProperty("title")] public string Title { get; set; }
+ // ugc_pay
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesMeta.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesMeta.cs
new file mode 100644
index 0000000..d317d63
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesMeta.cs
@@ -0,0 +1,32 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceSeasonsSeriesMeta : BaseModel
+{
+ [JsonProperty("category")] public int Category { get; set; }
+ [JsonProperty("cover")] public string Cover { get; set; }
+ [JsonProperty("description")] public string Description { get; set; }
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+ [JsonProperty("total")] public int Total { get; set; }
+}
+
+public class SpaceSeasonsMeta : SpaceSeasonsSeriesMeta
+{
+ [JsonProperty("ptime")] public long Ptime { get; set; }
+ [JsonProperty("season_id")] public long SeasonId { get; set; }
+}
+
+public class SpaceSeriesMeta : SpaceSeasonsSeriesMeta
+{
+ [JsonProperty("creator")] public string Creator { get; set; }
+ [JsonProperty("ctime")] public long Ctime { get; set; }
+ [JsonProperty("keywords")] public List Keywords { get; set; }
+ [JsonProperty("last_update_ts")] public long LastUpdate { get; set; }
+ [JsonProperty("mtime")] public long Mtime { get; set; }
+ [JsonProperty("raw_keywords")] public string RawKeywords { get; set; }
+ [JsonProperty("series_id")] public long SeriesId { get; set; }
+ [JsonProperty("state")] public int State { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesOrigin.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesOrigin.cs
new file mode 100644
index 0000000..cb3621b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesOrigin.cs
@@ -0,0 +1,28 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/space/channel/video?mid={mid}&page_num={pageNum}&page_size={pageSize}
+public class SpaceSeasonsSeriesOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public SpaceSeasonsSeriesData Data { get; set; }
+}
+
+public class SpaceSeasonsSeriesData : BaseModel
+{
+ [JsonProperty("items_lists")] public SpaceSeasonsSeries ItemsLists { get; set; }
+}
+
+public class SpaceSeasonsSeries : BaseModel
+{
+ [JsonProperty("page")] public SpaceSeasonsSeriesPage Page { get; set; }
+ [JsonProperty("seasons_list")] public List SeasonsList { get; set; }
+ [JsonProperty("series_list")] public List SeriesList { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesPage.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesPage.cs
new file mode 100644
index 0000000..6d86524
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesPage.cs
@@ -0,0 +1,11 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceSeasonsSeriesPage : BaseModel
+{
+ [JsonProperty("page_num")] public int PageNum;
+ [JsonProperty("page_size")] public int PageSize;
+ [JsonProperty("total")] public int Total;
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesStat.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesStat.cs
new file mode 100644
index 0000000..98bcee8
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSeasonsSeriesStat.cs
@@ -0,0 +1,9 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceSeasonsSeriesStat : BaseModel
+{
+ [JsonProperty("view")] public long View { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSeriesDetail.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSeriesDetail.cs
new file mode 100644
index 0000000..2bef4fa
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSeriesDetail.cs
@@ -0,0 +1,24 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/series/archives?mid={mid}&series_id={seriesId}&only_normal=true&sort=desc&pn={pn}&ps={ps}
+public class SpaceSeriesDetailOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public SpaceSeriesDetail Data { get; set; }
+}
+
+public class SpaceSeriesDetail : BaseModel
+{
+ [JsonProperty("aids")] public List Aids { get; set; }
+
+ // page
+ [JsonProperty("archives")] public List Archives { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSeriesMeta.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSeriesMeta.cs
new file mode 100644
index 0000000..38272af
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSeriesMeta.cs
@@ -0,0 +1,22 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/series/series?series_id={seriesId}
+public class SpaceSeriesMetaOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public SpaceSeriesMetaData Data { get; set; }
+}
+
+public class SpaceSeriesMetaData : BaseModel
+{
+ [JsonProperty("meta")] public SpaceSeriesMeta Meta { get; set; }
+ [JsonProperty("recent_aids")] public List RecentAids { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSettings.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSettings.cs
new file mode 100644
index 0000000..cb8f3c7
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSettings.cs
@@ -0,0 +1,17 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://space.bilibili.com/ajax/settings/getSettings?mid={mid}
+public class SpaceSettingsOrigin : BaseModel
+{
+ [JsonProperty("status")] public bool Status { get; set; }
+ [JsonProperty("data")] public SpaceSettings Data { get; set; }
+}
+
+public class SpaceSettings : BaseModel
+{
+ // ...
+ [JsonProperty("toutu")] public SpaceSettingsToutu Toutu { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/SpaceSettingsToutu.cs b/DownKyi.Core/BiliApi/Users/Models/SpaceSettingsToutu.cs
new file mode 100644
index 0000000..8bdd069
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/SpaceSettingsToutu.cs
@@ -0,0 +1,17 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class SpaceSettingsToutu : BaseModel
+{
+ [JsonProperty("sid")] public int Sid { get; set; }
+ [JsonProperty("expire")] public long Expire { get; set; }
+ [JsonProperty("s_img")] public string Simg { get; set; } // 完整url为http://i0.hdslb.com/+相对路径
+ [JsonProperty("l_img")] public string Limg { get; set; } // 完整url为http://i0.hdslb.com/+相对路径
+ [JsonProperty("android_img")] public string AndroidImg { get; set; }
+ [JsonProperty("iphone_img")] public string IphoneImg { get; set; }
+ [JsonProperty("ipad_img")] public string IpadImg { get; set; }
+ [JsonProperty("thumbnail_img")] public string ThumbnailImg { get; set; }
+ [JsonProperty("platform")] public int Platform { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/UpStat.cs b/DownKyi.Core/BiliApi/Users/Models/UpStat.cs
new file mode 100644
index 0000000..4036b93
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/UpStat.cs
@@ -0,0 +1,22 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/space/upstat?mid={mid}
+public class UpStatOrigin : BaseModel
+{
+ [JsonProperty("data")] public UpStat Data { get; set; }
+}
+
+public class UpStat : BaseModel
+{
+ [JsonProperty("archive")] public UpStatArchive Archive { get; set; }
+ [JsonProperty("article")] public UpStatArchive Article { get; set; }
+ [JsonProperty("likes")] public long Likes { get; set; }
+}
+
+public class UpStatArchive : BaseModel
+{
+ [JsonProperty("view")] public long View { get; set; } // 视频/文章播放量
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/UserInfoForNavigation.cs b/DownKyi.Core/BiliApi/Users/Models/UserInfoForNavigation.cs
new file mode 100644
index 0000000..b6d8090
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/UserInfoForNavigation.cs
@@ -0,0 +1,110 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/web-interface/nav
+[JsonObject]
+public class UserInfoForNavigationOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ [JsonProperty("data")] public UserInfoForNavigation Data { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+}
+
+[JsonObject]
+public class UserInfoForNavigation : BaseModel
+{
+ //public int allowance_count { get; set; }
+ //public int answer_status { get; set; }
+ //public int email_verified { get; set; }
+ [JsonProperty("face")] public string Face { get; set; }
+
+ //public bool has_shop { get; set; }
+ [JsonProperty("isLogin")] public bool IsLogin { get; set; }
+
+ //public NavDataLevelInfo level_info { get; set; }
+ [JsonProperty("mid")] public long Mid { get; set; }
+
+ //public int mobile_verified { get; set; }
+ [JsonProperty("money")] public float Money { get; set; }
+
+ //public int moral { get; set; }
+ //public NavDataOfficial official { get; set; }
+ //public NavDataOfficialVerify officialVerify { get; set; }
+ //public NavDataPendant pendant { get; set; }
+ //public int scores { get; set; }
+ //public string shop_url { get; set; }
+ [JsonProperty("uname")] public string Name { get; set; }
+
+ //public long vipDueDate { get; set; }
+ [JsonProperty("vipStatus")] public int VipStatus { get; set; }
+
+ //public int vipType { get; set; }
+ //public int vip_avatar_subscript { get; set; }
+ //public NavDataVipLabel vip_label { get; set; }
+ //public string vip_nickname_color { get; set; }
+ //public int vip_pay_type { get; set; }
+ //public int vip_theme_type { get; set; }
+ [JsonProperty("wallet")] public UserInfoWallet Wallet { get; set; }
+
+ [JsonProperty("wbi_img")] public Wbi Wbi { get; set; }
+}
+
+//public class NavDataLevelInfo
+//{
+// public int current_exp { get; set; }
+// public int current_level { get; set; }
+// public int current_min { get; set; }
+// //public int next_exp { get; set; } // 当等级为6时,next_exp为string类型,值为"--"
+//}
+
+//public class NavDataOfficial
+//{
+// public string desc { get; set; }
+// public int role { get; set; }
+// public string title { get; set; }
+// public int type { get; set; }
+//}
+
+//public class NavDataOfficialVerify
+//{
+// public string desc { get; set; }
+// public int type { get; set; }
+//}
+
+//public class NavDataPendant
+//{
+// public int expire { get; set; }
+// public string image { get; set; }
+// public string image_enhance { get; set; }
+// public string name { get; set; }
+// public int pid { get; set; }
+//}
+
+//public class NavDataVipLabel
+//{
+// public string label_theme { get; set; }
+// public string path { get; set; }
+// public string text { get; set; }
+//}
+
+[JsonObject]
+public class UserInfoWallet : BaseModel
+{
+ [JsonProperty("bcoin_balance")] public float BcoinBalance { get; set; }
+ [JsonProperty("coupon_balance")] public float CouponBalance { get; set; }
+ [JsonProperty("coupon_due_time")] public long CouponDueTime { get; set; }
+ [JsonProperty("mid")] public long Mid { get; set; }
+}
+
+[JsonObject]
+public class Wbi
+{
+ [JsonProperty("img_url")] public string ImgUrl { get; set; }
+ [JsonProperty("sub_url")] public string SubUrl { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/UserInfoForSpace.cs b/DownKyi.Core/BiliApi/Users/Models/UserInfoForSpace.cs
new file mode 100644
index 0000000..afb97be
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/UserInfoForSpace.cs
@@ -0,0 +1,49 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/space/acc/info?mid={mid}
+public class UserInfoForSpaceOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public UserInfoForSpace Data { get; set; }
+}
+
+public class UserInfoForSpace : BaseModel
+{
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+ [JsonProperty("sex")] public string Sex { get; set; }
+
+ [JsonProperty("face")] public string Face { get; set; }
+
+ // face_nft
+ [JsonProperty("sign")] public string Sign { get; set; }
+
+ // rank
+ [JsonProperty("level")] public int Level { get; set; }
+
+ // jointime
+ // moral
+ // silence
+ // coins
+ //[JsonProperty("fans_badge")]
+ //public bool FansBadge { get; set; }
+ // fans_medal
+ // official
+ [JsonProperty("vip")] public UserInfoVip Vip { get; set; }
+
+ // pendant
+ // nameplate
+ // user_honour_info
+ [JsonProperty("is_followed")] public bool IsFollowed { get; set; }
+
+ [JsonProperty("top_photo")] public string TopPhoto { get; set; }
+ // ...
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/UserInfoLevelExp.cs b/DownKyi.Core/BiliApi/Users/Models/UserInfoLevelExp.cs
new file mode 100644
index 0000000..322c213
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/UserInfoLevelExp.cs
@@ -0,0 +1,12 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class UserInfoLevelExp : BaseModel
+{
+ [JsonProperty("current_level")] public int CurrentLevel { get; set; }
+ [JsonProperty("current_min")] public int CurrentMin { get; set; }
+ [JsonProperty("current_exp")] public int CurrentExp { get; set; }
+ [JsonProperty("next_exp")] public int NextExp { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/UserInfoVip.cs b/DownKyi.Core/BiliApi/Users/Models/UserInfoVip.cs
new file mode 100644
index 0000000..203296e
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/UserInfoVip.cs
@@ -0,0 +1,34 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+public class UserInfoVip : BaseModel
+{
+ [JsonProperty("type")] public int Type { get; set; }
+ [JsonProperty("status")] public int Status { get; set; }
+
+ [JsonProperty("due_date")] public long DueDate { get; set; }
+
+ // vip_pay_type
+ // theme_type
+ [JsonProperty("label")] public UserInfoVipLabel Label { get; set; }
+ [JsonProperty("avatar_subscript")] public int AvatarSubscript { get; set; }
+
+ [JsonProperty("nickname_color")] public string NicknameColor { get; set; }
+
+ // role
+ [JsonProperty("avatar_subscript_url")] public string AvatarSubscriptUrl { get; set; }
+}
+
+public class UserInfoVipLabel : BaseModel
+{
+ // path
+ [JsonProperty("text")] public string Text { get; set; }
+ [JsonProperty("label_theme")] public string LabelTheme { get; set; }
+
+ [JsonProperty("text_color")] public string TextColor { get; set; }
+ // bg_style
+ // bg_color
+ // border_color
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Models/UserRelationStat.cs b/DownKyi.Core/BiliApi/Users/Models/UserRelationStat.cs
new file mode 100644
index 0000000..6ba3404
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Models/UserRelationStat.cs
@@ -0,0 +1,19 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Users.Models;
+
+// https://api.bilibili.com/x/relation/stat?vmid={mid}
+public class UserRelationStatOrigin : BaseModel
+{
+ [JsonProperty("data")] public UserRelationStat Data { get; set; }
+}
+
+public class UserRelationStat : BaseModel
+{
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("following")] public long Following { get; set; } // 关注数
+ [JsonProperty("whisper")] public long Whisper { get; set; }
+ [JsonProperty("black")] public long Black { get; set; }
+ [JsonProperty("follower")] public long Follower { get; set; } // 粉丝数
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/Nickname.cs b/DownKyi.Core/BiliApi/Users/Nickname.cs
new file mode 100644
index 0000000..bf24838
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/Nickname.cs
@@ -0,0 +1,36 @@
+using DownKyi.Core.BiliApi.Users.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Users;
+
+///
+/// 用户昵称
+///
+public class Nickname
+{
+ ///
+ /// 检查昵称
+ ///
+ ///
+ ///
+ public static NicknameStatus CheckNickname(string nickName)
+ {
+ string url = $"https://api.bilibili.com/x/relation/stat?nickName={nickName}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ NicknameStatus nickname = JsonConvert.DeserializeObject(response);
+ return nickname;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("CheckNickname()发生异常: {0}", e);
+ LogManager.Error("Nickname", e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/UserInfo.cs b/DownKyi.Core/BiliApi/Users/UserInfo.cs
new file mode 100644
index 0000000..39269de
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/UserInfo.cs
@@ -0,0 +1,104 @@
+using DownKyi.Core.BiliApi.Sign;
+using DownKyi.Core.BiliApi.Users.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Users;
+
+///
+/// 用户基本信息
+///
+public static class UserInfo
+{
+ ///
+ /// 导航栏用户信息
+ ///
+ ///
+ public static UserInfoForNavigation GetUserInfoForNavigation()
+ {
+ string url = "https://api.bilibili.com/x/web-interface/nav";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ UserInfoForNavigationOrigin userInfo =
+ JsonConvert.DeserializeObject(response);
+ if (userInfo == null || userInfo.Data == null)
+ {
+ return null;
+ }
+
+ return userInfo.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetUserInfoForNavigation()发生异常: {0}", e);
+ LogManager.Error("UserInfo", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 用户空间详细信息
+ ///
+ ///
+ ///
+ public static UserInfoForSpace GetUserInfoForSpace(long mid)
+ {
+ var parameters = new Dictionary
+ {
+ { "mid", mid }
+ };
+ string query = WbiSign.ParametersToQuery(WbiSign.EncodeWbi(parameters));
+ string url = $"https://api.bilibili.com/x/space/wbi/acc/info?{query}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ UserInfoForSpaceOrigin spaceInfo = JsonConvert.DeserializeObject(response);
+ if (spaceInfo == null || spaceInfo.Data == null)
+ {
+ return null;
+ }
+
+ return spaceInfo.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetInfoForSpace()发生异常: {0}", e);
+ LogManager.Error("UserInfo", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 本用户详细信息
+ ///
+ ///
+ public static MyInfo GetMyInfo()
+ {
+ string url = "https://api.bilibili.com/x/space/myinfo";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ MyInfoOrigin myInfo = JsonConvert.DeserializeObject(response);
+ if (myInfo == null || myInfo.Data == null)
+ {
+ return null;
+ }
+
+ return myInfo.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetMyInfo()发生异常: {0}", e);
+ LogManager.Error("UserInfo", e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/UserRelation.cs b/DownKyi.Core/BiliApi/Users/UserRelation.cs
new file mode 100644
index 0000000..1a2b330
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/UserRelation.cs
@@ -0,0 +1,299 @@
+using DownKyi.Core.BiliApi.Users.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Users;
+
+///
+/// 用户关系相关
+///
+public static class UserRelation
+{
+ ///
+ /// 查询用户粉丝明细
+ ///
+ /// 目标用户UID
+ /// 页码
+ /// 每页项数
+ ///
+ public static RelationFollow GetFollowers(long mid, int pn, int ps)
+ {
+ string url = $"https://api.bilibili.com/x/relation/followers?vmid={mid}&pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ RelationFollowOrigin relationFollower = JsonConvert.DeserializeObject(response);
+ if (relationFollower == null || relationFollower.Data == null)
+ {
+ return null;
+ }
+
+ return relationFollower.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetFollowers()发生异常: {0}", e);
+ LogManager.Error("UserRelation", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询用户所有的粉丝明细
+ ///
+ /// 目标用户UID
+ ///
+ public static List GetAllFollowers(long mid)
+ {
+ List result = new List();
+
+ int i = 0;
+ while (true)
+ {
+ i++;
+ int ps = 50;
+
+ RelationFollow data = GetFollowers(mid, i, ps);
+ if (data == null || data.List == null || data.List.Count == 0)
+ {
+ break;
+ }
+
+ result.AddRange(data.List);
+ }
+
+ return result;
+ }
+
+ ///
+ /// 查询用户关注明细
+ ///
+ /// 目标用户UID
+ /// 页码
+ /// 每页项数
+ /// 排序方式
+ ///
+ public static RelationFollow GetFollowings(long mid, int pn, int ps,
+ FollowingOrder order = FollowingOrder.DEFAULT)
+ {
+ string orderType = "";
+ if (order == FollowingOrder.ATTENTION)
+ {
+ orderType = "attention";
+ }
+
+ string url =
+ $"https://api.bilibili.com/x/relation/followings?vmid={mid}&pn={pn}&ps={ps}&order_type={orderType}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ RelationFollowOrigin relationFollower = JsonConvert.DeserializeObject(response);
+ if (relationFollower == null || relationFollower.Data == null)
+ {
+ return null;
+ }
+
+ return relationFollower.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetFollowings()发生异常: {0}", e);
+ LogManager.Error("UserRelation", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询用户所有的关注明细
+ ///
+ /// 目标用户UID
+ /// 排序方式
+ ///
+ public static List GetAllFollowings(long mid, FollowingOrder order = FollowingOrder.DEFAULT)
+ {
+ List result = new List();
+
+ int i = 0;
+ while (true)
+ {
+ i++;
+ int ps = 50;
+
+ RelationFollow data = GetFollowings(mid, i, ps, order);
+ if (data == null || data.List == null || data.List.Count == 0)
+ {
+ break;
+ }
+
+ result.AddRange(data.List);
+ }
+
+ return result;
+ }
+
+ ///
+ /// 查询悄悄关注明细
+ ///
+ /// 页码
+ /// 每页项数
+ ///
+ public static List GetWhispers(int pn, int ps)
+ {
+ string url = $"https://api.bilibili.com/x/relation/whispers?pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ RelationWhisper relationWhisper = JsonConvert.DeserializeObject(response);
+ if (relationWhisper == null || relationWhisper.Data == null || relationWhisper.Data.List == null)
+ {
+ return null;
+ }
+
+ return relationWhisper.Data.List;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetWhispers()发生异常: {0}", e);
+ LogManager.Error("UserRelation", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询黑名单明细
+ ///
+ /// 页码
+ /// 每页项数
+ ///
+ public static List GetBlacks(int pn, int ps)
+ {
+ string url = $"https://api.bilibili.com/x/relation/blacks?pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ RelationBlack relationBlack = JsonConvert.DeserializeObject(response);
+ if (relationBlack == null || relationBlack.Data == null)
+ {
+ return null;
+ }
+
+ return relationBlack.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetBlacks()发生异常: {0}", e);
+ LogManager.Error("UserRelation", e);
+ return null;
+ }
+ }
+
+ #region 关注分组相关,只能查询当前登录账户的信息
+
+ ///
+ /// 查询关注分组列表
+ ///
+ ///
+ public static List GetFollowingGroup()
+ {
+ string url = $"https://api.bilibili.com/x/relation/tags";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var followingGroup = JsonConvert.DeserializeObject(response);
+ if (followingGroup == null || followingGroup.Data == null)
+ {
+ return null;
+ }
+
+ return followingGroup.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetFollowingGroup()发生异常: {0}", e);
+ LogManager.Error("UserRelation", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询关注分组明细
+ ///
+ /// 分组ID
+ /// 页数
+ /// 每页项数
+ /// 排序方式
+ ///
+ public static List GetFollowingGroupContent(long tagId, int pn, int ps,
+ FollowingOrder order = FollowingOrder.DEFAULT)
+ {
+ string orderType = "";
+ if (order == FollowingOrder.ATTENTION)
+ {
+ orderType = "attention";
+ }
+
+ string url =
+ $"https://api.bilibili.com/x/relation/tag?tagid={tagId}&pn={pn}&ps={ps}&order_type={orderType}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ FollowingGroupContent content = JsonConvert.DeserializeObject(response);
+ if (content == null || content.Data == null)
+ {
+ return null;
+ }
+
+ return content.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetFollowingGroupContent()发生异常: {0}", e);
+ LogManager.Error("UserRelation", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询所有的关注分组明细
+ ///
+ /// 分组ID
+ /// 排序方式
+ ///
+ public static List GetAllFollowingGroupContent(int tagId,
+ FollowingOrder order = FollowingOrder.DEFAULT)
+ {
+ List result = new List();
+
+ int i = 0;
+ while (true)
+ {
+ i++;
+ int ps = 50;
+
+ var data = GetFollowingGroupContent(tagId, i, ps, order);
+ if (data == null || data.Count == 0)
+ {
+ break;
+ }
+
+ result.AddRange(data);
+ }
+
+ return result;
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/UserSpace.cs b/DownKyi.Core/BiliApi/Users/UserSpace.cs
new file mode 100644
index 0000000..a1409ba
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/UserSpace.cs
@@ -0,0 +1,476 @@
+using DownKyi.Core.BiliApi.Sign;
+using DownKyi.Core.BiliApi.Users.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Users;
+
+///
+/// 用户空间信息
+///
+public static class UserSpace
+{
+ ///
+ /// 查询空间设置
+ ///
+ ///
+ ///
+ public static SpaceSettings GetSpaceSettings(long mid)
+ {
+ string url = $"https://space.bilibili.com/ajax/settings/getSettings?mid={mid}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ SpaceSettingsOrigin settings = JsonConvert.DeserializeObject(response);
+ if (settings == null || settings.Data == null || !settings.Status) { return null; }
+ return settings.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetSpaceSettings()发生异常: {0}", e);
+ LogManager.Error("UserSpace", e);
+ return null;
+ }
+ }
+
+ #region 投稿
+
+ ///
+ /// 获取用户投稿视频的所有分区
+ ///
+ /// 用户id
+ ///
+ public static List GetPublicationType(long mid)
+ {
+ int pn = 1;
+ int ps = 1;
+ SpacePublicationList publication = GetPublication(mid, pn, ps);
+ return GetPublicationType(publication);
+ }
+
+ ///
+ /// 获取用户投稿视频的所有分区
+ ///
+ /// 用户id
+ ///
+ public static List GetPublicationType(SpacePublicationList publication)
+ {
+ if (publication == null || publication.Tlist == null)
+ {
+ return null;
+ }
+
+ List result = new List();
+ JObject typeList = JObject.Parse(publication.Tlist.ToString("N"));
+ foreach (KeyValuePair item in typeList)
+ {
+ SpacePublicationListTypeVideoZone value = JsonConvert.DeserializeObject(item.Value.ToString());
+ result.Add(value);
+ }
+ return result;
+ }
+
+ ///
+ /// 查询用户所有的投稿视频明细
+ ///
+ /// 用户id
+ /// 排序
+ /// 视频分区
+ /// 搜索关键词
+ ///
+ public static List GetAllPublication(long mid, int tid = 0, PublicationOrder order = PublicationOrder.PUBDATE, string keyword = "")
+ {
+ List result = new List();
+
+ int i = 0;
+ while (true)
+ {
+ i++;
+ int ps = 100;
+
+ SpacePublicationList data = GetPublication(mid, i, ps, tid, order, keyword);
+ if (data == null || data.Vlist == null || data.Vlist.Count == 0)
+ { break; }
+
+ result.AddRange(data.Vlist);
+ }
+
+ return result;
+ }
+
+ ///
+ /// 查询用户投稿视频明细
+ ///
+ /// 用户id
+ /// 页码
+ /// 每页的视频数
+ /// 排序
+ /// 视频分区
+ /// 搜索关键词
+ ///
+ public static SpacePublicationList GetPublication(long mid, int pn, int ps, long tid = 0, PublicationOrder order = PublicationOrder.PUBDATE, string keyword = "")
+ {
+ var parameters = new Dictionary
+ {
+ { "mid", mid },
+ { "pn", pn },
+ { "ps", ps },
+ { "order", order.ToString("G").ToLower() },
+ { "tid", tid },
+ { "keyword", keyword },
+ };
+ string query = WbiSign.ParametersToQuery(WbiSign.EncodeWbi(parameters));
+ string url = $"https://api.bilibili.com/x/space/wbi/arc/search?{query}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ // 忽略play的值为“--”时的类型错误
+ JsonSerializerSettings settings = new JsonSerializerSettings
+ {
+ Error = (sender, args) =>
+ {
+ if (Equals(args.ErrorContext.Member, "play") &&
+ args.ErrorContext.OriginalObject.GetType() == typeof(SpacePublicationListVideo))
+ {
+ args.ErrorContext.Handled = true;
+ }
+ }
+ };
+
+ SpacePublicationOrigin spacePublication = JsonConvert.DeserializeObject(response, settings);
+ if (spacePublication == null || spacePublication.Data == null) { return null; }
+ return spacePublication.Data.List;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetPublication()发生异常: {0}", e);
+ LogManager.Error("UserSpace", e);
+ return null;
+ }
+ }
+
+ #endregion
+
+ #region 频道
+
+ ///
+ /// 查询用户频道列表
+ ///
+ /// 用户id
+ ///
+ public static List GetChannelList(long mid)
+ {
+ string url = $"https://api.bilibili.com/x/space/channel/list?mid={mid}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ SpaceChannelOrigin spaceChannel = JsonConvert.DeserializeObject(response);
+ if (spaceChannel == null || spaceChannel.Data == null) { return null; }
+ return spaceChannel.Data.List;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetChannelList()发生异常: {0}", e);
+ LogManager.Error("UserSpace", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询用户频道中的所有视频
+ ///
+ ///
+ ///
+ ///
+ public static List GetAllChannelVideoList(long mid, long cid)
+ {
+ List result = new List();
+
+ int i = 0;
+ while (true)
+ {
+ i++;
+ int ps = 100;
+
+ List data = GetChannelVideoList(mid, cid, i, ps);
+ if (data == null || data.Count == 0)
+ { break; }
+
+ result.AddRange(data);
+ }
+ return result;
+ }
+
+ ///
+ /// 查询用户频道中的视频
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static List GetChannelVideoList(long mid, long cid, int pn, int ps)
+ {
+ string url = $"https://api.bilibili.com/x/space/channel/video?mid={mid}&cid={cid}&pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ SpaceChannelVideoOrigin spaceChannelVideo = JsonConvert.DeserializeObject(response);
+ if (spaceChannelVideo == null || spaceChannelVideo.Data == null || spaceChannelVideo.Data.List == null)
+ { return null; }
+ return spaceChannelVideo.Data.List.Archives;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetChannelVideoList()发生异常: {0}", e);
+ LogManager.Error("UserSpace", e);
+ return null;
+ }
+ }
+
+ #endregion
+
+ #region 合集和列表
+
+ ///
+ /// 查询用户的合集和列表
+ ///
+ ///
+ /// 第几页
+ /// 每页的数量;最大值为20
+ ///
+ public static SpaceSeasonsSeries GetSeasonsSeries(long mid, int pageNum, int pageSize)
+ {
+ // https://api.bilibili.com/x/polymer/space/seasons_series_list?mid=49246269&page_num=1&page_size=18
+ string url = $"https://api.bilibili.com/x/polymer/space/seasons_series_list?mid={mid}&page_num={pageNum}&page_size={pageSize}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ SpaceSeasonsSeriesOrigin origin = JsonConvert.DeserializeObject(response);
+ if (origin == null || origin.Data == null || origin.Data.ItemsLists == null)
+ { return null; }
+ return origin.Data.ItemsLists;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetSeasonsSeries()发生异常: {0}", e);
+ LogManager.Error("UserSpace", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询用户的合集的视频详情
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static SpaceSeasonsDetail GetSeasonsDetail(long mid, long seasonId, int pageNum, int pageSize)
+ {
+ // https://api.bilibili.com/x/polymer/space/seasons_archives_list?mid=23947287&season_id=665&sort_reverse=false&page_num=1&page_size=30
+ string url = $"https://api.bilibili.com/x/polymer/space/seasons_archives_list?mid={mid}&season_id={seasonId}&page_num={pageNum}&page_size={pageSize}&sort_reverse=false";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ SpaceSeasonsDetailOrigin origin = JsonConvert.DeserializeObject(response);
+ if (origin == null || origin.Data == null)
+ { return null; }
+ return origin.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetSeasonsDetail()发生异常: {0}", e);
+ LogManager.Error("UserSpace", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询用户的列表元数据
+ ///
+ ///
+ ///
+ public static SpaceSeriesMetaData GetSeriesMeta(long seriesId)
+ {
+ // https://api.bilibili.com/x/series/series?series_id=1253087
+ string url = $"https://api.bilibili.com/x/series/series?series_id={seriesId}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ SpaceSeriesMetaOrigin origin = JsonConvert.DeserializeObject(response);
+ if (origin == null || origin.Data == null)
+ { return null; }
+ return origin.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetSeriesMeta()发生异常: {0}", e);
+ LogManager.Error("UserSpace", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询用户的列表的视频详情
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static SpaceSeriesDetail GetSeriesDetail(long mid, long seriesId, int pn, int ps)
+ {
+ // https://api.bilibili.com/x/series/archives?mid=27899754&series_id=1253087&only_normal=true&sort=desc&pn=1&ps=30
+
+ string url = $"https://api.bilibili.com/x/series/archives?mid={mid}&series_id={seriesId}&only_normal=true&sort=desc&pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ SpaceSeriesDetailOrigin origin = JsonConvert.DeserializeObject(response);
+ if (origin == null || origin.Data == null)
+ { return null; }
+ return origin.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetSeriesDetail()发生异常: {0}", e);
+ LogManager.Error("UserSpace", e);
+ return null;
+ }
+ }
+
+ #endregion
+
+ #region 课程
+ ///
+ /// 查询用户发布的课程列表
+ ///
+ /// 目标用户UID
+ /// 页码
+ /// 每页项数
+ ///
+ public static List GetCheese(long mid, int pn, int ps)
+ {
+ string url = $"https://api.bilibili.com/pugv/app/web/season/page?mid={mid}&pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ SpaceCheeseOrigin cheese = JsonConvert.DeserializeObject(response);
+ if (cheese == null || cheese.Data == null || cheese.Data.Items == null)
+ { return null; }
+ return cheese.Data.Items;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetCheese()发生异常: {0}", e);
+ LogManager.Error("UserSpace", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询用户发布的所有课程列表
+ ///
+ /// 目标用户UID
+ ///
+ public static List GetAllCheese(long mid)
+ {
+ List result = new List();
+
+ int i = 0;
+ while (true)
+ {
+ i++;
+ int ps = 50;
+
+ List data = GetCheese(mid, i, ps);
+ if (data == null || data.Count == 0)
+ { break; }
+
+ result.AddRange(data);
+ }
+ return result;
+ }
+
+ #endregion
+
+ #region 订阅
+
+ ///
+ /// 查询用户追番(追剧)明细
+ ///
+ /// 目标用户UID
+ /// 查询类型
+ /// 页码
+ /// 每页项数
+ ///
+ public static BangumiFollowData GetBangumiFollow(long mid, BangumiType type, int pn, int ps)
+ {
+ string url = $"https://api.bilibili.com/x/space/bangumi/follow/list?vmid={mid}&type={type:D}&pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ BangumiFollowOrigin bangumiFollow = JsonConvert.DeserializeObject(response);
+ if (bangumiFollow == null || bangumiFollow.Data == null)
+ { return null; }
+ return bangumiFollow.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetBangumiFollow()发生异常: {0}", e);
+ LogManager.Error("UserSpace", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询用户所有的追番(追剧)明细
+ ///
+ /// 目标用户UID
+ /// 查询类型
+ ///
+ public static List GetAllBangumiFollow(long mid, BangumiType type)
+ {
+ List result = new List();
+
+ int i = 0;
+ while (true)
+ {
+ i++;
+ int ps = 30;
+
+ BangumiFollowData data = GetBangumiFollow(mid, type, i, ps);
+ if (data == null || data.List == null || data.List.Count == 0)
+ { break; }
+
+ result.AddRange(data.List);
+ }
+ return result;
+ }
+
+ #endregion
+
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Users/UserStatus.cs b/DownKyi.Core/BiliApi/Users/UserStatus.cs
new file mode 100644
index 0000000..b17c4be
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Users/UserStatus.cs
@@ -0,0 +1,73 @@
+using DownKyi.Core.BiliApi.Users.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Users;
+
+///
+/// 用户状态数
+///
+public static class UserStatus
+{
+ ///
+ /// 关系状态数
+ ///
+ ///
+ ///
+ public static UserRelationStat GetUserRelationStat(long mid)
+ {
+ string url = $"https://api.bilibili.com/x/relation/stat?vmid={mid}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ UserRelationStatOrigin userRelationStat =
+ JsonConvert.DeserializeObject(response);
+ if (userRelationStat == null || userRelationStat.Data == null)
+ {
+ return null;
+ }
+
+ return userRelationStat.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetUserRelationStat()发生异常: {0}", e);
+ LogManager.Error("UserStatus", e);
+ return null;
+ }
+ }
+
+ ///
+ /// UP主状态数
+ ///
+ /// 注:该接口需要任意用户登录,否则不会返回任何数据
+ ///
+ ///
+ ///
+ public static UpStat GetUpStat(long mid)
+ {
+ string url = $"https://api.bilibili.com/x/space/upstat?mid={mid}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ UpStatOrigin upStat = JsonConvert.DeserializeObject(response);
+ if (upStat == null || upStat.Data == null)
+ {
+ return null;
+ }
+
+ return upStat.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetUpStat()发生异常: {0}", e);
+ LogManager.Error("UserStatus", e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Dynamic.cs b/DownKyi.Core/BiliApi/Video/Dynamic.cs
new file mode 100644
index 0000000..de1e076
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Dynamic.cs
@@ -0,0 +1,42 @@
+using DownKyi.Core.BiliApi.Video.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Video;
+
+public static class Dynamic
+{
+ ///
+ /// 获取分区最新视频列表
+ ///
+ /// 目标分区tid
+ /// 页码
+ /// 每页项数(最大50)
+ ///
+ public static List RegionDynamicList(int rid, int pn = 1, int ps = 5)
+ {
+ string url = $"https://api.bilibili.com/x/web-interface/dynamic/region?rid={rid}&pn={pn}&ps={ps}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var dynamic = JsonConvert.DeserializeObject(response);
+ if (dynamic != null && dynamic.Data != null)
+ {
+ return dynamic.Data.Archives;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("RegionDynamicList()发生异常: {0}", e);
+ LogManager.Error("Dynamic", e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/DynamicVideoView.cs b/DownKyi.Core/BiliApi/Video/Models/DynamicVideoView.cs
new file mode 100644
index 0000000..d685bf6
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/DynamicVideoView.cs
@@ -0,0 +1,31 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+public class DynamicVideoView : BaseModel
+{
+ [JsonProperty("aid")] public long Aid { get; set; }
+ [JsonProperty("videos")] public int Videos { get; set; }
+ [JsonProperty("tid")] public int Tid { get; set; }
+ [JsonProperty("tname")] public string Tname { get; set; }
+ [JsonProperty("copyright")] public int Copyright { get; set; }
+ [JsonProperty("pic")] public string Pic { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("pubdate")] public long Pubdate { get; set; }
+ [JsonProperty("ctime")] public long Ctime { get; set; }
+ [JsonProperty("desc")] public string Desc { get; set; }
+ [JsonProperty("state")] public int State { get; set; }
+ [JsonProperty("duration")] public long Duration { get; set; }
+ [JsonProperty("owner")] public VideoOwner Owner { get; set; }
+ [JsonProperty("stat")] public VideoStat Stat { get; set; }
+ [JsonProperty("dynamic")] public string Dynamic { get; set; }
+ [JsonProperty("cid")] public long Cid { get; set; }
+ [JsonProperty("dimension")] public Dimension Dimension { get; set; }
+ [JsonProperty("short_link")] public string ShortLink { get; set; }
+ [JsonProperty("short_link_v2")] public string ShortLinkV2 { get; set; }
+ [JsonProperty("first_frame")] public string FirstFrame { get; set; }
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+ [JsonProperty("season_type")] public int SeasonType { get; set; }
+ [JsonProperty("is_ogv")] public bool IsOgv { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/RankingVideoView.cs b/DownKyi.Core/BiliApi/Video/Models/RankingVideoView.cs
new file mode 100644
index 0000000..613d25f
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/RankingVideoView.cs
@@ -0,0 +1,27 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+public class RankingVideoView : BaseModel
+{
+ [JsonProperty("aid")] public long Aid { get; set; }
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+ [JsonProperty("typename")] public string TypeName { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("subtitle")] public string Subtitle { get; set; }
+ [JsonProperty("play")] public long Play { get; set; }
+ [JsonProperty("review")] public long Review { get; set; }
+ [JsonProperty("video_review")] public long VideoReview { get; set; }
+ [JsonProperty("favorites")] public long Favorites { get; set; }
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("author")] public string Author { get; set; }
+ [JsonProperty("description")] public string Description { get; set; }
+ [JsonProperty("create")] public string Create { get; set; }
+ [JsonProperty("pic")] public string Pic { get; set; }
+ [JsonProperty("coins")] public long Coins { get; set; }
+ [JsonProperty("duration")] public string Duration { get; set; }
+ [JsonProperty("badgepay")] public bool Badgepay { get; set; }
+ [JsonProperty("pts")] public long Pts { get; set; }
+ [JsonProperty("redirect_url")] public string RedirectUrl { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/RegionDynamic.cs b/DownKyi.Core/BiliApi/Video/Models/RegionDynamic.cs
new file mode 100644
index 0000000..c922e42
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/RegionDynamic.cs
@@ -0,0 +1,22 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+// https://api.bilibili.com/x/web-interface/dynamic/region
+public class RegionDynamicOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public RegionDynamic Data { get; set; }
+}
+
+public class RegionDynamic : BaseModel
+{
+ [JsonProperty("archives")] public List Archives { get; set; }
+ // page
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/RegionRanking.cs b/DownKyi.Core/BiliApi/Video/Models/RegionRanking.cs
new file mode 100644
index 0000000..bf7738e
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/RegionRanking.cs
@@ -0,0 +1,16 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+// https://api.bilibili.com/x/web-interface/ranking/region
+public class RegionRanking : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public List Data { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/UgcArc.cs b/DownKyi.Core/BiliApi/Video/Models/UgcArc.cs
new file mode 100644
index 0000000..4ef89e0
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/UgcArc.cs
@@ -0,0 +1,28 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+public class UgcArc : BaseModel
+{
+ [JsonProperty("aid")] public long Aid { get; set; }
+ [JsonProperty("videos")] public int Videos { get; set; }
+ [JsonProperty("type_id")] public int TypeId { get; set; }
+ [JsonProperty("type_name")] public string TypeName { get; set; }
+ [JsonProperty("copyright")] public int Copyright { get; set; }
+ [JsonProperty("pic")] public string Pic { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("pubdate")] public long Pubdate { get; set; }
+ [JsonProperty("ctime")] public long Ctime { get; set; }
+ [JsonProperty("desc")] public string Desc { get; set; }
+ [JsonProperty("state")] public int State { get; set; }
+
+ [JsonProperty("duration")] public long Duration { get; set; }
+
+ //[JsonProperty("rights")]
+ //public VideoRights Rights { get; set; }
+ [JsonProperty("author")] public VideoOwner Author { get; set; }
+ [JsonProperty("stat")] public VideoStat Stat { get; set; }
+ [JsonProperty("dynamic")] public string Dynamic { get; set; }
+ [JsonProperty("dimension")] public Dimension Dimension { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/UgcEpisode.cs b/DownKyi.Core/BiliApi/Video/Models/UgcEpisode.cs
new file mode 100644
index 0000000..9015de2
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/UgcEpisode.cs
@@ -0,0 +1,18 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+public class UgcEpisode : BaseModel
+{
+ [JsonProperty("season_id")] public long SeasonId { get; set; }
+ [JsonProperty("section_id")] public long SectionId { get; set; }
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("aid")] public long Aid { get; set; }
+ [JsonProperty("cid")] public long Cid { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("attribute")] public int Attribute { get; set; }
+ [JsonProperty("arc")] public UgcArc Arc { get; set; }
+ [JsonProperty("page")] public VideoPage Page { get; set; }
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/UgcSeason.cs b/DownKyi.Core/BiliApi/Video/Models/UgcSeason.cs
new file mode 100644
index 0000000..fc89198
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/UgcSeason.cs
@@ -0,0 +1,19 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+public class UgcSeason : BaseModel
+{
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("cover")] public string Cover { get; set; }
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("intro")] public string Intro { get; set; }
+ [JsonProperty("sign_state")] public int SignState { get; set; }
+ [JsonProperty("attribute")] public int Attribute { get; set; }
+ [JsonProperty("sections")] public List Sections { get; set; }
+ [JsonProperty("stat")] public UgcStat Stat { get; set; }
+ [JsonProperty("ep_count")] public int EpCount { get; set; }
+ [JsonProperty("season_type")] public int SeasonType { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/UgcSection.cs b/DownKyi.Core/BiliApi/Video/Models/UgcSection.cs
new file mode 100644
index 0000000..0484682
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/UgcSection.cs
@@ -0,0 +1,18 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+public class UgcSection : BaseModel
+{
+ [JsonProperty("season_id")]
+ public long SeasonId { get; set; }
+ [JsonProperty("id")]
+ public long Id { get; set; }
+ [JsonProperty("title")]
+ public string Title { get; set; }
+ [JsonProperty("type")]
+ public int Type { get; set; }
+ [JsonProperty("episodes")]
+ public List Episodes { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/UgcStat.cs b/DownKyi.Core/BiliApi/Video/Models/UgcStat.cs
new file mode 100644
index 0000000..8ee29f6
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/UgcStat.cs
@@ -0,0 +1,18 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+public class UgcStat : BaseModel
+{
+ [JsonProperty("season_id")] public long SeasonId { get; set; }
+ [JsonProperty("view")] public long View { get; set; }
+ [JsonProperty("danmaku")] public long Danmaku { get; set; }
+ [JsonProperty("reply")] public long Reply { get; set; }
+ [JsonProperty("fav")] public long Favorite { get; set; }
+ [JsonProperty("coin")] public long Coin { get; set; }
+ [JsonProperty("share")] public long Share { get; set; }
+ [JsonProperty("now_rank")] public long NowRank { get; set; }
+ [JsonProperty("his_rank")] public long HisRank { get; set; }
+ [JsonProperty("like")] public long Like { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/VideoDescription.cs b/DownKyi.Core/BiliApi/Video/Models/VideoDescription.cs
new file mode 100644
index 0000000..2e937ab
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/VideoDescription.cs
@@ -0,0 +1,16 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+// https://api.bilibili.com/x/web-interface/archive/desc
+public class VideoDescription : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public string Data { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/VideoPage.cs b/DownKyi.Core/BiliApi/Video/Models/VideoPage.cs
new file mode 100644
index 0000000..a00710b
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/VideoPage.cs
@@ -0,0 +1,17 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+public class VideoPage : BaseModel
+{
+ [JsonProperty("cid")] public long Cid { get; set; }
+ [JsonProperty("page")] public int Page { get; set; }
+ [JsonProperty("from")] public string From { get; set; }
+ [JsonProperty("part")] public string Part { get; set; }
+ [JsonProperty("duration")] public long Duration { get; set; }
+ [JsonProperty("vid")] public string Vid { get; set; }
+ [JsonProperty("weblink")] public string Weblink { get; set; }
+ [JsonProperty("dimension")] public Dimension Dimension { get; set; }
+ [JsonProperty("first_frame")] public string FirstFrame { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/VideoPagelist.cs b/DownKyi.Core/BiliApi/Video/Models/VideoPagelist.cs
new file mode 100644
index 0000000..9553a32
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/VideoPagelist.cs
@@ -0,0 +1,16 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+// https://api.bilibili.com/x/player/pagelist
+public class VideoPagelist : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public List Data { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/VideoStat.cs b/DownKyi.Core/BiliApi/Video/Models/VideoStat.cs
new file mode 100644
index 0000000..0148f0f
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/VideoStat.cs
@@ -0,0 +1,21 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+public class VideoStat : BaseModel
+{
+ [JsonProperty("aid")] public long Aid { get; set; }
+ [JsonProperty("view")] public long View { get; set; }
+ [JsonProperty("danmaku")] public long Danmaku { get; set; }
+ [JsonProperty("reply")] public long Reply { get; set; }
+ [JsonProperty("favorite")] public long Favorite { get; set; }
+ [JsonProperty("coin")] public long Coin { get; set; }
+ [JsonProperty("share")] public long Share { get; set; }
+ [JsonProperty("now_rank")] public long NowRank { get; set; }
+ [JsonProperty("his_rank")] public long HisRank { get; set; }
+ [JsonProperty("like")] public long Like { get; set; }
+ [JsonProperty("dislike")] public long Dislike { get; set; }
+ [JsonProperty("evaluation")] public string Evaluation { get; set; }
+ [JsonProperty("argue_msg")] public string ArgueMsg { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/VideoSubtitle.cs b/DownKyi.Core/BiliApi/Video/Models/VideoSubtitle.cs
new file mode 100644
index 0000000..a3b8ed9
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/VideoSubtitle.cs
@@ -0,0 +1,39 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+public class VideoSubtitle : BaseModel
+{
+ [JsonProperty("allow_submit")] public bool AllowSubmit { get; set; }
+ [JsonProperty("list")] public List List { get; set; }
+}
+
+public class Subtitle : BaseModel
+{
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("lan")] public string Lan { get; set; }
+ [JsonProperty("lan_doc")] public string LanDoc { get; set; }
+ [JsonProperty("is_lock")] public bool IsLock { get; set; }
+ [JsonProperty("author_mid")] public long AuthorMid { get; set; }
+ [JsonProperty("subtitle_url")] public string SubtitleUrl { get; set; }
+ [JsonProperty("author")] public SubtitleAuthor Author { get; set; }
+}
+
+public class SubtitleAuthor : BaseModel
+{
+ [JsonProperty("mid")] public long Mid { get; set; }
+ [JsonProperty("name")] public string Name { get; set; }
+ [JsonProperty("sex")] public string Sex { get; set; }
+ [JsonProperty("face")] public string Face { get; set; }
+
+ [JsonProperty("sign")] public string Sign { get; set; }
+ //[JsonProperty("rank")]
+ //public int Rank { get; set; }
+ //[JsonProperty("birthday")]
+ //public int Birthday { get; set; }
+ //[JsonProperty("is_fake_account")]
+ //public int IsFakeAccount { get; set; }
+ //[JsonProperty("is_deleted")]
+ //public int IsDeleted { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Models/VideoView.cs b/DownKyi.Core/BiliApi/Video/Models/VideoView.cs
new file mode 100644
index 0000000..1325fff
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Models/VideoView.cs
@@ -0,0 +1,58 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.Video.Models;
+
+// https://api.bilibili.com/x/web-interface/view
+public class VideoViewOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public VideoView Data { get; set; }
+}
+
+public class VideoView : BaseModel
+{
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+ [JsonProperty("aid")] public long Aid { get; set; }
+ [JsonProperty("videos")] public int Videos { get; set; }
+ [JsonProperty("tid")] public int Tid { get; set; }
+ [JsonProperty("tname")] public string Tname { get; set; }
+ [JsonProperty("copyright")] public int Copyright { get; set; }
+ [JsonProperty("pic")] public string Pic { get; set; }
+ [JsonProperty("title")] public string Title { get; set; }
+ [JsonProperty("pubdate")] public long Pubdate { get; set; }
+ [JsonProperty("ctime")] public long Ctime { get; set; }
+ [JsonProperty("desc")] public string Desc { get; set; }
+ [JsonProperty("state")] public int State { get; set; }
+ [JsonProperty("duration")] public long Duration { get; set; }
+ [JsonProperty("redirect_url")] public string RedirectUrl { get; set; }
+
+ [JsonProperty("mission_id")] public long MissionId { get; set; }
+
+ //[JsonProperty("rights")]
+ //public VideoRights Rights { get; set; }
+ [JsonProperty("owner")] public VideoOwner Owner { get; set; }
+ [JsonProperty("stat")] public VideoStat Stat { get; set; }
+ [JsonProperty("dynamic")] public string Dynamic { get; set; }
+ [JsonProperty("cid")] public long Cid { get; set; }
+ [JsonProperty("dimension")] public Dimension Dimension { get; set; }
+ [JsonProperty("season_id")] public long SeasonId { get; set; }
+
+ [JsonProperty("festival_jump_url")] public string FestivalJumpUrl { get; set; }
+
+ //[JsonProperty("no_cache")]
+ //public bool no_cache { get; set; }
+ [JsonProperty("pages")] public List Pages { get; set; }
+ [JsonProperty("subtitle")] public VideoSubtitle Subtitle { get; set; }
+
+ [JsonProperty("ugc_season")] public UgcSeason UgcSeason { get; set; }
+ //[JsonProperty("staff")]
+ //public List staff { get; set; }
+ //[JsonProperty("user_garb")]
+ //public user_garb user_garb { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/Ranking.cs b/DownKyi.Core/BiliApi/Video/Ranking.cs
new file mode 100644
index 0000000..98a43d6
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/Ranking.cs
@@ -0,0 +1,42 @@
+using DownKyi.Core.BiliApi.Video.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Video;
+
+public static class Ranking
+{
+ ///
+ /// 获取分区视频排行榜列表
+ ///
+ /// 目标分区tid
+ /// 3日榜或周榜(3/7)
+ ///
+ ///
+ public static List RegionRankingList(int rid, int day = 3, int original = 0)
+ {
+ string url = $"https://api.bilibili.com/x/web-interface/ranking/region?rid={rid}&day={day}&ps={original}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var ranking = JsonConvert.DeserializeObject(response);
+ if (ranking != null)
+ {
+ return ranking.Data;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("RegionRankingList()发生异常: {0}", e);
+ LogManager.Error("Ranking", e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Video/VideoInfo.cs b/DownKyi.Core/BiliApi/Video/VideoInfo.cs
new file mode 100644
index 0000000..bbeb4e8
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Video/VideoInfo.cs
@@ -0,0 +1,115 @@
+using DownKyi.Core.BiliApi.Sign;
+using DownKyi.Core.BiliApi.Video.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.Video;
+
+public static class VideoInfo
+{
+ ///
+ /// 获取视频详细信息(web端)
+ ///
+ ///
+ ///
+ ///
+ public static VideoView VideoViewInfo(string bvid = null, long aid = -1)
+ {
+ // https://api.bilibili.com/x/web-interface/view/detail?bvid=BV1Sg411F7cb&aid=969147110&need_operation_card=1&web_rm_repeat=1&need_elec=1&out_referer=https%3A%2F%2Fspace.bilibili.com%2F42018135%2Ffavlist%3Ffid%3D94341835
+
+ var parameters = new Dictionary();
+ if (bvid != null)
+ {
+ parameters.Add("bvid", bvid);
+ }
+ else if (aid > -1)
+ {
+ parameters.Add("aid", aid);
+ }
+ else
+ {
+ return null;
+ }
+ string query = WbiSign.ParametersToQuery(WbiSign.EncodeWbi(parameters));
+ string url = $"https://api.bilibili.com/x/web-interface/wbi/view?{query}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var videoView = JsonConvert.DeserializeObject(response);
+ if (videoView != null) { return videoView.Data; }
+ else { return null; }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("VideoInfo()发生异常: {0}", e);
+ LogManager.Error("VideoInfo", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 获取视频简介
+ ///
+ ///
+ ///
+ ///
+ public static string VideoDescription(string bvid = null, long aid = -1)
+ {
+ string baseUrl = "https://api.bilibili.com/x/web-interface/archive/desc";
+ string referer = "https://www.bilibili.com";
+ string url;
+ if (bvid != null) { url = $"{baseUrl}?bvid={bvid}"; }
+ else if (aid >= -1) { url = $"{baseUrl}?aid={aid}"; }
+ else { return null; }
+
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var desc = JsonConvert.DeserializeObject(response);
+ if (desc != null) { return desc.Data; }
+ else { return null; }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("VideoDescription()发生异常: {0}", e);
+ LogManager.Error("VideoInfo", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 查询视频分P列表 (avid/bvid转cid)
+ ///
+ ///
+ ///
+ ///
+ public static List VideoPagelist(string bvid = null, long aid = -1)
+ {
+ string baseUrl = "https://api.bilibili.com/x/player/pagelist";
+ string referer = "https://www.bilibili.com";
+ string url;
+ if (bvid != null) { url = $"{baseUrl}?bvid={bvid}"; }
+ else if (aid > -1) { url = $"{baseUrl}?aid={aid}"; }
+ else { return null; }
+
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var pagelist = JsonConvert.DeserializeObject(response);
+ if (pagelist != null) { return pagelist.Data; }
+ else { return null; }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("VideoPagelist()发生异常: {0}", e);
+ LogManager.Error("VideoInfo", e);
+ return null;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrl.cs b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrl.cs
new file mode 100644
index 0000000..bcbe573
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrl.cs
@@ -0,0 +1,39 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.VideoStream.Models;
+
+public class PlayUrlOrigin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public PlayUrl Data { get; set; }
+ [JsonProperty("result")] public PlayUrl Result { get; set; }
+}
+
+public class PlayUrl : BaseModel
+{
+ // from
+ // result
+ // message
+ // quality
+ // format
+ // timelength
+ // accept_format
+ [JsonProperty("accept_description")] public List AcceptDescription { get; set; }
+
+ [JsonProperty("accept_quality")] public List AcceptQuality { get; set; }
+
+ // video_codecid
+ // seek_param
+ // seek_type
+ [JsonProperty("durl")] public List Durl { get; set; }
+ [JsonProperty("dash")] public PlayUrlDash Dash { get; set; }
+
+ [JsonProperty("support_formats")] public List SupportFormats { get; set; }
+ // high_format
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDash.cs b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDash.cs
new file mode 100644
index 0000000..ba5e191
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDash.cs
@@ -0,0 +1,18 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.VideoStream.Models;
+
+public class PlayUrlDash : BaseModel
+{
+ [JsonProperty("duration")] public long Duration { get; set; }
+
+ //[JsonProperty("minBufferTime")]
+ //public float minBufferTime { get; set; }
+ //[JsonProperty("min_buffer_time")]
+ //public float min_buffer_time { get; set; }
+ [JsonProperty("video")] public List Video { get; set; }
+ [JsonProperty("audio")] public List Audio { get; set; }
+ [JsonProperty("dolby")] public PlayUrlDashDolby Dolby { get; set; }
+ [JsonProperty("flac")] public PlayUrlDashFlac Flac { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDashDolby.cs b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDashDolby.cs
new file mode 100644
index 0000000..4c53379
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDashDolby.cs
@@ -0,0 +1,11 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.VideoStream.Models;
+
+public class PlayUrlDashDolby : BaseModel
+{
+ // type
+ [JsonProperty("audio")]
+ public List Audio { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDashFlac.cs b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDashFlac.cs
new file mode 100644
index 0000000..fee6f6d
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDashFlac.cs
@@ -0,0 +1,10 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.VideoStream.Models;
+
+public class PlayUrlDashFlac : BaseModel
+{
+ [JsonProperty("audio")] public PlayUrlDashVideo Audio { get; set; }
+ //bool display { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDashVideo.cs b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDashVideo.cs
new file mode 100644
index 0000000..8019774
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDashVideo.cs
@@ -0,0 +1,30 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.VideoStream.Models;
+
+public class PlayUrlDashVideo : BaseModel
+{
+ [JsonProperty("id")] public int Id { get; set; }
+ [JsonProperty("base_url")] public string BaseUrl { get; set; }
+
+ [JsonProperty("backup_url")] public List BackupUrl { get; set; }
+
+ // bandwidth
+ [JsonProperty("mimeType")] public string MimeType { get; set; }
+
+ // mime_type
+ [JsonProperty("codecs")] public string Codecs { get; set; }
+ [JsonProperty("width")] public int Width { get; set; }
+ [JsonProperty("height")] public int Height { get; set; }
+
+ [JsonProperty("frameRate")] public string FrameRate { get; set; }
+
+ // frame_rate
+ // sar
+ // startWithSap
+ // start_with_sap
+ // SegmentBase
+ // segment_base
+ [JsonProperty("codecid")] public int CodecId { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDurl.cs b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDurl.cs
new file mode 100644
index 0000000..866dc0c
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlDurl.cs
@@ -0,0 +1,17 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.VideoStream.Models;
+
+public class PlayUrlDurl : BaseModel
+{
+ [JsonProperty("order")] public int Order { get; set; }
+ [JsonProperty("length")] public long Length { get; set; }
+
+ [JsonProperty("size")] public long Size { get; set; }
+
+ // ahead
+ // vhead
+ [JsonProperty("url")] public string Url { get; set; }
+ [JsonProperty("backup_url")] public List BackupUrl { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlSupportFormat.cs b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlSupportFormat.cs
new file mode 100644
index 0000000..5891c49
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/Models/PlayUrlSupportFormat.cs
@@ -0,0 +1,13 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.VideoStream.Models;
+
+public class PlayUrlSupportFormat : BaseModel
+{
+ [JsonProperty("quality")] public int Quality { get; set; }
+ [JsonProperty("format")] public string Format { get; set; }
+ [JsonProperty("new_description")] public string NewDescription { get; set; }
+ [JsonProperty("display_desc")] public string DisplayDesc { get; set; }
+ [JsonProperty("superscript")] public string Superscript { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/Models/PlayerV2.cs b/DownKyi.Core/BiliApi/VideoStream/Models/PlayerV2.cs
new file mode 100644
index 0000000..206e7cc
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/Models/PlayerV2.cs
@@ -0,0 +1,30 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.VideoStream.Models;
+
+// https://api.bilibili.com/x/player/v2?cid={cid}&aid={avid}&bvid={bvid}
+public class PlayerV2Origin : BaseModel
+{
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")] public PlayerV2 Data { get; set; }
+}
+
+public class PlayerV2 : BaseModel
+{
+ [JsonProperty("aid")] public long Aid { get; set; }
+
+ [JsonProperty("bvid")] public string Bvid { get; set; }
+
+ // allow_bp
+ // no_share
+ [JsonProperty("cid")] public long Cid { get; set; }
+
+ // ...
+ [JsonProperty("subtitle")] public SubtitleInfo Subtitle { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/Models/Subtitle.cs b/DownKyi.Core/BiliApi/VideoStream/Models/Subtitle.cs
new file mode 100644
index 0000000..616e094
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/Models/Subtitle.cs
@@ -0,0 +1,16 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.VideoStream.Models;
+
+public class Subtitle : BaseModel
+{
+ [JsonProperty("id")] public long Id { get; set; }
+ [JsonProperty("lan")] public string Lan { get; set; }
+ [JsonProperty("lan_doc")] public string LanDoc { get; set; }
+ [JsonProperty("is_lock")] public bool IsLock { get; set; }
+ [JsonProperty("author_mid")] public long AuthorMid { get; set; }
+ [JsonProperty("subtitle_url")] public string SubtitleUrl { get; set; }
+ [JsonProperty("type")] public int Type { get; set; }
+ [JsonProperty("id_str")] public string IdStr { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/Models/SubtitleInfo.cs b/DownKyi.Core/BiliApi/VideoStream/Models/SubtitleInfo.cs
new file mode 100644
index 0000000..7fcd2a1
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/Models/SubtitleInfo.cs
@@ -0,0 +1,12 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.VideoStream.Models;
+
+public class SubtitleInfo : BaseModel
+{
+ [JsonProperty("allow_submit")] public bool AllowSubmit { get; set; }
+ [JsonProperty("lan")] public string Lan { get; set; }
+ [JsonProperty("lan_doc")] public string LanDoc { get; set; }
+ [JsonProperty("subtitles")] public List Subtitles { get; set; }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/PlayStreamType.cs b/DownKyi.Core/BiliApi/VideoStream/PlayStreamType.cs
new file mode 100644
index 0000000..0ed9ed6
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/PlayStreamType.cs
@@ -0,0 +1,8 @@
+namespace DownKyi.Core.BiliApi.VideoStream;
+
+public enum PlayStreamType
+{
+ VIDEO = 1, // 普通视频
+ BANGUMI, // 番剧、电影、电视剧等
+ CHEESE, // 课程
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/VideoStream/VideoStream.cs b/DownKyi.Core/BiliApi/VideoStream/VideoStream.cs
new file mode 100644
index 0000000..55227ee
--- /dev/null
+++ b/DownKyi.Core/BiliApi/VideoStream/VideoStream.cs
@@ -0,0 +1,238 @@
+using DownKyi.Core.BiliApi.Models.Json;
+using DownKyi.Core.BiliApi.Sign;
+using DownKyi.Core.BiliApi.VideoStream.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using Console = DownKyi.Core.Utils.Debugging.Console;
+
+namespace DownKyi.Core.BiliApi.VideoStream;
+
+public static class VideoStream
+{
+ ///
+ /// 获取播放器信息(web端)
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static PlayerV2 PlayerV2(long avid, string bvid, long cid)
+ {
+ var parameters = new Dictionary
+ {
+ { "avid", avid },
+ { "bvid", bvid },
+ { "cid", cid },
+ };
+ string query = WbiSign.ParametersToQuery(WbiSign.EncodeWbi(parameters));
+ string url = $"https://api.bilibili.com/x/player/wbi/v2?{query}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var playUrl = JsonConvert.DeserializeObject(response);
+ return playUrl?.Data;
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("PlayerV2()发生异常: {0}", e);
+ LogManager.Error("PlayerV2()", e);
+ return null;
+ }
+ }
+
+ ///
+ /// 获取所有字幕
+ /// 若视频没有字幕,返回null
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static List GetSubtitle(long avid, string bvid, long cid)
+ {
+ List subRipTexts = new List();
+
+ // 获取播放器信息
+ PlayerV2 player = PlayerV2(avid, bvid, cid);
+ if (player == null)
+ {
+ return subRipTexts;
+ }
+
+ if (player.Subtitle != null && player.Subtitle.Subtitles != null && player.Subtitle.Subtitles.Count == 0)
+ {
+ return null;
+ }
+
+ foreach (var subtitle in player.Subtitle.Subtitles)
+ {
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb($"https:{subtitle.SubtitleUrl}", referer);
+
+ try
+ {
+ var subtitleJson = JsonConvert.DeserializeObject(response);
+ if (subtitleJson == null)
+ {
+ continue;
+ }
+
+ subRipTexts.Add(new SubRipText
+ {
+ Lan = subtitle.Lan,
+ LanDoc = subtitle.LanDoc,
+ SrtString = subtitleJson.ToSubRip()
+ });
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetSubtitle()发生异常: {0}", e);
+ LogManager.Error("GetSubtitle()", e);
+ }
+ }
+
+ return subRipTexts;
+ }
+
+ ///
+ /// 获取普通视频的视频流
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static PlayUrl GetVideoPlayUrl(long avid, string bvid, long cid, int quality = 125)
+ {
+ var parameters = new Dictionary
+ {
+ { "fourk", 1 },
+ { "fnver", 0 },
+ { "fnval", 4048 },
+ { "cid", cid },
+ { "qn", quality },
+ };
+
+ if (bvid != null)
+ {
+ parameters.Add("bvid", bvid);
+ }
+ else if (avid > -1)
+ {
+ parameters.Add("aid", avid);
+ }
+ else
+ {
+ return null;
+ }
+
+ string query = WbiSign.ParametersToQuery(WbiSign.EncodeWbi(parameters));
+ string url = $"https://api.bilibili.com/x/player/wbi/playurl?{query}";
+
+ return GetPlayUrl(url);
+ }
+
+ ///
+ /// 获取番剧的视频流
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static PlayUrl GetBangumiPlayUrl(long avid, string bvid, long cid, int quality = 125)
+ {
+ string baseUrl =
+ $"https://api.bilibili.com/pgc/player/web/playurl?cid={cid}&qn={quality}&fourk=1&fnver=0&fnval=4048";
+ string url;
+ if (bvid != null)
+ {
+ url = $"{baseUrl}&bvid={bvid}";
+ }
+ else if (avid > -1)
+ {
+ url = $"{baseUrl}&aid={avid}";
+ }
+ else
+ {
+ return null;
+ }
+
+ return GetPlayUrl(url);
+ }
+
+ ///
+ /// 获取课程的视频流
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static PlayUrl GetCheesePlayUrl(long avid, string bvid, long cid, long episodeId, int quality = 125)
+ {
+ string baseUrl =
+ $"https://api.bilibili.com/pugv/player/web/playurl?cid={cid}&qn={quality}&fourk=1&fnver=0&fnval=4048";
+ string url;
+ if (bvid != null)
+ {
+ url = $"{baseUrl}&bvid={bvid}";
+ }
+ else if (avid > -1)
+ {
+ url = $"{baseUrl}&aid={avid}";
+ }
+ else
+ {
+ return null;
+ }
+
+ // 必须有episodeId,否则会返回请求错误
+ if (episodeId != 0)
+ {
+ url += $"&ep_id={episodeId}";
+ }
+
+ return GetPlayUrl(url);
+ }
+
+ ///
+ /// 获取视频流
+ ///
+ ///
+ ///
+ private static PlayUrl GetPlayUrl(string url)
+ {
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var playUrl = JsonConvert.DeserializeObject(response);
+ if (playUrl == null)
+ {
+ return null;
+ }
+ else if (playUrl.Data != null)
+ {
+ return playUrl.Data;
+ }
+ else if (playUrl.Result != null)
+ {
+ return playUrl.Result;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ catch (Exception e)
+ {
+ Console.PrintLine("GetPlayUrl()发生异常: {0}", e);
+ LogManager.Error("GetPlayUrl()", e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/WebClient.cs b/DownKyi.Core/BiliApi/WebClient.cs
new file mode 100644
index 0000000..9f03a7f
--- /dev/null
+++ b/DownKyi.Core/BiliApi/WebClient.cs
@@ -0,0 +1,146 @@
+using System.IO.Compression;
+using System.Net;
+using System.Text;
+using DownKyi.Core.BiliApi.Login;
+using DownKyi.Core.Logging;
+using DownKyi.Core.Settings;
+
+namespace DownKyi.Core.BiliApi;
+
+internal static class WebClient
+{
+ ///
+ /// 发送get或post请求
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string RequestWeb(string url, string referer = null, string method = "GET",
+ Dictionary parameters = null, int retry = 3)
+ {
+ // 重试次数
+ if (retry <= 0)
+ {
+ return "";
+ }
+
+ // post请求,发送参数
+ if (method == "POST" && parameters != null)
+ {
+ StringBuilder builder = new StringBuilder();
+ int i = 0;
+ foreach (var item in parameters)
+ {
+ if (i > 0)
+ {
+ builder.Append("&");
+ }
+
+ builder.AppendFormat("{0}={1}", item.Key, item.Value);
+ i++;
+ }
+
+ url += "?" + builder.ToString();
+ }
+
+ try
+ {
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+ request.Method = method;
+ request.Timeout = 30 * 1000;
+
+ request.UserAgent = SettingsManager.GetInstance().GetUserAgent();
+
+ //request.ContentType = "application/json,text/html,application/xhtml+xml,application/xml;charset=UTF-8";
+ request.Headers["accept-language"] = "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7";
+ request.Headers["accept-encoding"] = "gzip, deflate, br";
+
+ // referer
+ if (referer != null)
+ {
+ request.Referer = referer;
+ }
+
+ // 构造cookie
+ if (!url.Contains("getLogin"))
+ {
+ request.Headers["origin"] = "https://www.bilibili.com";
+
+ CookieContainer cookies = LoginHelper.GetLoginInfoCookies();
+ if (cookies != null)
+ {
+ request.CookieContainer = cookies;
+ }
+ }
+
+ string html = string.Empty;
+ using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
+ {
+ if (response.ContentEncoding.ToLower().Contains("gzip"))
+ {
+ using (GZipStream stream = new GZipStream(response.GetResponseStream(), CompressionMode.Decompress))
+ {
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
+ {
+ html = reader.ReadToEnd();
+ }
+ }
+ }
+ else if (response.ContentEncoding.ToLower().Contains("deflate"))
+ {
+ using (DeflateStream stream =
+ new DeflateStream(response.GetResponseStream(), CompressionMode.Decompress))
+ {
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
+ {
+ html = reader.ReadToEnd();
+ }
+ }
+ }
+ else if (response.ContentEncoding.ToLower().Contains("br"))
+ {
+ using (BrotliStream stream =
+ new BrotliStream(response.GetResponseStream(), CompressionMode.Decompress))
+ {
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
+ {
+ html = reader.ReadToEnd();
+ }
+ }
+ }
+ else
+ {
+ using (Stream stream = response.GetResponseStream())
+ {
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
+ {
+ html = reader.ReadToEnd();
+ }
+ }
+ }
+ }
+
+ return html;
+ }
+ catch (WebException e)
+ {
+ Console.WriteLine("RequestWeb()发生Web异常: {0}", e);
+ LogManager.Error(e);
+ return RequestWeb(url, referer, method, parameters, retry - 1);
+ }
+ catch (IOException e)
+ {
+ Console.WriteLine("RequestWeb()发生IO异常: {0}", e);
+ LogManager.Error(e);
+ return RequestWeb(url, referer, method, parameters, retry - 1);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("RequestWeb()发生其他异常: {0}", e);
+ LogManager.Error(e);
+ return RequestWeb(url, referer, method, parameters, retry - 1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Zone/VideoZone.cs b/DownKyi.Core/BiliApi/Zone/VideoZone.cs
new file mode 100644
index 0000000..e0d0a56
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Zone/VideoZone.cs
@@ -0,0 +1,215 @@
+using System.Collections.Generic;
+
+namespace DownKyi.Core.BiliApi.Zone;
+
+public class VideoZone
+{
+ private static VideoZone that;
+ private readonly List zones = new();
+
+ ///
+ /// 使用单例模式获取分区,注意未搜索到的分区需要额外处理
+ ///
+ ///
+ public static VideoZone Instance()
+ {
+ if (that == null)
+ {
+ that = new VideoZone();
+ }
+
+ return that;
+ }
+
+ public List GetZones()
+ {
+ return zones;
+ }
+
+ private VideoZone()
+ {
+ // SpacePublicationListType类需要同步更新
+
+ //动画
+ zones.Add(new ZoneAttr(1, "douga", "动画")); // 主分区
+ zones.Add(new ZoneAttr(24, "mad", "MAD·AMV", 1)); // 具有一定制作程度的动画或静画的二次创作视频
+ zones.Add(new ZoneAttr(25, "mmd", "MMD·3D", 1)); // 使用MMD(MikuMikuDance)和其他3D建模类软件制作的视频
+ zones.Add(new ZoneAttr(47, "voice", "短片·手书·配音", 1)); // 追求个人特色和创意表达的自制动画短片、手书(绘)及ACGN相关配音
+ zones.Add(new ZoneAttr(210, "garage_kit", "手办·模玩", 1)); // 手办模玩的测评、改造或其他衍生内容
+ zones.Add(new ZoneAttr(86, "tokusatsu", "特摄", 1)); // 特摄相关衍生视频
+ zones.Add(new ZoneAttr(253, "acgntalks", "动漫杂谈", 1)); // 以谈话形式对ACGN文化圈进行的鉴赏、吐槽、评点、解说、推荐、科普等内容
+ zones.Add(new ZoneAttr(27, "other", "综合", 1)); // 以动画及动画相关内容为素材,包括但不仅限于音频替换、恶搞改编、排行榜等内容
+
+ //番剧
+ zones.Add(new ZoneAttr(13, "anime", "番剧")); // 主分区
+ zones.Add(new ZoneAttr(33, "serial", "连载动画", 13)); // 当季连载的动画番剧
+ zones.Add(new ZoneAttr(32, "finish", "完结动画", 13)); // 已完结的动画番剧合集
+ zones.Add(new ZoneAttr(51, "information", "资讯", 13)); // 动画番剧相关资讯视频
+ zones.Add(new ZoneAttr(152, "offical", "官方延伸", 13)); // 动画番剧为主题的宣传节目、采访视频,及声优相关视频
+
+ //国创
+ zones.Add(new ZoneAttr(167, "guochuang", "国创")); // 主分区
+ zones.Add(new ZoneAttr(153, "chinese", "国产动画", 167)); // 我国出品的PGC动画
+ zones.Add(new ZoneAttr(168, "original", "国产原创相关", 167)); //
+ zones.Add(new ZoneAttr(169, "puppetry", "布袋戏", 167)); //
+ zones.Add(new ZoneAttr(195, "motioncomic", "动态漫·广播剧", 167)); //
+ zones.Add(new ZoneAttr(170, "information", "资讯", 167)); //
+
+ //音乐
+ zones.Add(new ZoneAttr(3, "music", "音乐")); // 主分区
+ zones.Add(new ZoneAttr(28, "original", "原创音乐", 3)); // 原创歌曲及纯音乐,包括改编、重编曲及remix
+ zones.Add(new ZoneAttr(31, "cover", "翻唱", 3)); // 对曲目的人声再演绎视频
+ zones.Add(new ZoneAttr(59, "perform", "演奏", 3)); // 乐器和非传统乐器器材的演奏作品
+ zones.Add(new ZoneAttr(30, "vocaloid", "VOCALOID·UTAU", 3)); // 以VOCALOID等歌声合成引擎为基础,运用各类音源进行的创作
+ zones.Add(new ZoneAttr(29, "live", "音乐现场", 3)); // 音乐表演的实况视频,包括官方/个人拍摄的综艺节目、音乐剧、音乐节、演唱会等
+ zones.Add(new ZoneAttr(193, "mv", "MV", 3)); // 为音乐作品配合拍摄或制作的音乐录影带(Music Video),以及自制拍摄、剪辑、翻拍MV
+ zones.Add(new ZoneAttr(243, "commentary", "乐评盘点", 3)); // 音乐类新闻、盘点、点评、reaction、榜单、采访、幕后故事、唱片开箱等
+ zones.Add(new ZoneAttr(244, "tutorial", "音乐教学", 3)); // 以音乐教学为目的的内容
+ zones.Add(new ZoneAttr(130, "other", "音乐综合", 3)); // 所有无法被收纳到其他音乐二级分区的音乐类视频
+
+ //舞蹈
+ zones.Add(new ZoneAttr(129, "dance", "舞蹈")); // 主分区
+ zones.Add(new ZoneAttr(20, "otaku", "宅舞", 129)); // 与ACG相关的翻跳、原创舞蹈
+ zones.Add(new ZoneAttr(198, "hiphop", "街舞", 129)); // 收录街舞相关内容,包括赛事现场、舞室作品、个人翻跳、FREESTYLE等
+ zones.Add(new ZoneAttr(199, "star", "明星舞蹈", 129)); // 国内外明星发布的官方舞蹈及其翻跳内容
+ zones.Add(new ZoneAttr(200, "china", "中国舞", 129)); // 传承中国艺术文化的舞蹈内容,包括古典舞、民族民间舞、汉唐舞、古风舞等
+ zones.Add(new ZoneAttr(154, "three_d", "舞蹈综合", 129)); // 收录无法定义到其他舞蹈子分区的舞蹈视频
+ zones.Add(new ZoneAttr(156, "demo", "舞蹈教程", 129)); // 镜面慢速,动作分解,基础教程等具有教学意义的舞蹈视频
+
+ //游戏
+ zones.Add(new ZoneAttr(4, "game", "游戏")); // 主分区
+ zones.Add(new ZoneAttr(17, "stand_alone", "单机游戏",
+ 4)); // 以所有平台(PC、主机、移动端)的单机或联机游戏为主的视频内容,包括游戏预告、CG、实况解说及相关的评测、杂谈与视频剪辑等
+ zones.Add(new ZoneAttr(171, "esports", "电子竞技", 4)); // 具有高对抗性的电子竞技游戏项目,其相关的赛事、实况、攻略、解说、短剧等视频。
+ zones.Add(new ZoneAttr(172, "mobile", "手机游戏", 4)); // 以手机及平板设备为主要平台的游戏,其相关的实况、攻略、解说、短剧、演示等视频。
+ zones.Add(new ZoneAttr(65, "online", "网络游戏", 4)); // 由网络运营商运营的多人在线游戏,以及电子竞技的相关游戏内容。包括赛事、攻略、实况、解说等相关视频
+ zones.Add(new ZoneAttr(173, "board", "桌游棋牌", 4)); // 桌游、棋牌、卡牌对战等及其相关电子版游戏的实况、攻略、解说、演示等视频。
+ zones.Add(new ZoneAttr(121, "gmv", "GMV", 4)); // 由游戏素材制作的MV视频。以游戏内容或CG为主制作的,具有一定创作程度的MV类型的视频
+ zones.Add(new ZoneAttr(136, "music", "音游", 4)); // 各个平台上,通过配合音乐与节奏而进行的音乐类游戏视频
+ zones.Add(new ZoneAttr(19, "mugen", "Mugen", 4)); // 以Mugen引擎为平台制作、或与Mugen相关的游戏视频
+
+ //知识
+ zones.Add(new ZoneAttr(36, "knowledge", "知识")); // 主分区
+ zones.Add(new ZoneAttr(201, "science", "科学科普", 36)); // 回答你的十万个为什么
+ zones.Add(new ZoneAttr(124, "social_science", "社科·法律·心理", 36)); // 基于社会科学、法学、心理学展开或个人观点输出的知识视频
+ zones.Add(new ZoneAttr(228, "humanity_history", "人文历史", 36)); // 看看古今人物,聊聊历史过往,品品文学典籍
+ zones.Add(new ZoneAttr(207, "business", "财经商业", 36)); // 说金融市场,谈宏观经济,一起畅聊商业故事
+ zones.Add(new ZoneAttr(208, "campus", "校园学习", 36)); // 老师很有趣,学生也有才,我们一起搞学习
+ zones.Add(new ZoneAttr(209, "career", "职业职场", 36)); // 职业分享、升级指南,一起成为最有料的职场人
+ zones.Add(new ZoneAttr(229, "design", "设计·创意", 36)); // 天马行空,创意设计,都在这里
+ zones.Add(new ZoneAttr(122, "skill", "野生技能协会", 36)); // 技能党集合,是时候展示真正的技术了
+
+ //科技
+ zones.Add(new ZoneAttr(188, "tech", "科技")); // 主分区
+ zones.Add(new ZoneAttr(95, "digital", "数码", 188)); // 科技数码产品大全,一起来做发烧友
+ zones.Add(new ZoneAttr(230, "application", "软件应用", 188)); // 超全软件应用指南
+ zones.Add(new ZoneAttr(231, "computer_tech", "计算机技术", 188)); // 研究分析、教学演示、经验分享......有关计算机技术的都在这里
+ zones.Add(new ZoneAttr(232, "industry", "科工机械", 188)); // 从小芯片到大工程,一起见证科工力量
+ zones.Add(new ZoneAttr(233, "diy", "极客DIY", 188)); // 炫酷技能,极客文化,硬核技巧,准备好你的惊讶
+
+ //运动
+ zones.Add(new ZoneAttr(234, "sports", "运动")); // 主分区
+ zones.Add(new ZoneAttr(235, "basketball", "篮球", 234)); // 与篮球相关的视频,包括但不限于篮球赛事、教学、评述、剪辑、剧情等相关内容
+ zones.Add(new ZoneAttr(249, "football", "足球", 234)); // 与足球相关的视频,包括但不限于足球赛事、教学、评述、剪辑、剧情等相关内容
+ zones.Add(new ZoneAttr(164, "aerobics", "健身", 234)); // 与健身相关的视频,包括但不限于瑜伽、CrossFit、健美、力量举、普拉提、街健等相关内容
+ zones.Add(new ZoneAttr(236, "athletic", "竞技体育",
+ 234)); // 与竞技体育相关的视频,包括但不限于乒乓、羽毛球、排球、赛车等竞技项目的赛事、评述、剪辑、剧情等相关内容
+ zones.Add(new ZoneAttr(237, "culture", "运动文化",
+ 234)); // 与运动文化相关的视频,包络但不限于球鞋、球衣、球星卡等运动衍生品的分享、解读,体育产业的分析、科普等相关内容
+ zones.Add(new ZoneAttr(238, "comprehensive", "运动综合", 234)); // 与运动综合相关的视频,包括但不限于钓鱼、骑行、滑板等日常运动分享、教学、Vlog等相关内容
+
+ //汽车
+ zones.Add(new ZoneAttr(223, "car", "汽车")); // 主分区
+ zones.Add(new ZoneAttr(245, "racing", "赛车", 223)); // F1等汽车运动相关
+ zones.Add(new ZoneAttr(246, "modifiedvehicle", "改装玩车", 223)); // 汽车文化及改装车相关内容,包括改装车、老车修复介绍、汽车聚会分享等内容
+ zones.Add(new ZoneAttr(247, "newenergyvehicle", "新能源车",
+ 223)); // 新能源汽车相关内容,包括电动汽车、混合动力汽车等车型种类,包含不限于新车资讯、试驾体验、专业评测、技术解读、知识科普等内容
+ zones.Add(new ZoneAttr(248, "touringcar", "房车", 223)); // 房车及营地相关内容,包括不限于产品介绍、驾驶体验、房车生活和房车旅行等内容
+ zones.Add(new ZoneAttr(240, "motorcycle", "摩托车", 223)); // 骑士们集合啦
+ zones.Add(new ZoneAttr(227, "strategy", "购车攻略", 223)); // 丰富详实的购车建议和新车体验
+ zones.Add(new ZoneAttr(176, "life", "汽车生活", 223)); // 分享汽车及出行相关的生活体验类视频
+
+ //生活
+ zones.Add(new ZoneAttr(160, "life", "生活")); // 主分区
+ zones.Add(new ZoneAttr(138, "funny", "搞笑", 160)); // 各种沙雕有趣的搞笑剪辑,挑战,表演,配音等视频
+ zones.Add(new ZoneAttr(250, "travel", "Energy", 160)); // 为达到观光游览、休闲娱乐为目的的远途旅行、中近途户外生活、本地探店
+ zones.Add(new ZoneAttr(251, "rurallife", "三农", 160)); // 分享美好农村生活
+ zones.Add(new ZoneAttr(239, "home", "家居房产", 160)); // 与买房、装修、居家生活相关的分享
+ zones.Add(new ZoneAttr(161, "handmake", "手工", 160)); // 手工制品的制作过程或成品展示、教程、测评类视频
+ zones.Add(new ZoneAttr(162, "painting", "绘画", 160)); // 绘画过程或绘画教程,以及绘画相关的所有视频
+ zones.Add(new ZoneAttr(21, "daily", "日常", 160)); // 记录日常生活,分享生活故事
+
+ //美食
+ zones.Add(new ZoneAttr(211, "food", "美食")); // 主分区
+ zones.Add(new ZoneAttr(76, "make", "美食制作", 211)); // 学做人间美味,展示精湛厨艺
+ zones.Add(new ZoneAttr(212, "detective", "美食侦探", 211)); // 寻找美味餐厅,发现街头美食
+ zones.Add(new ZoneAttr(213, "measurement", "美食测评", 211)); // 吃货世界,品尝世间美味
+ zones.Add(new ZoneAttr(214, "rural", "田园美食", 211)); // 品味乡野美食,寻找山与海的味道
+ zones.Add(new ZoneAttr(215, "record", "美食记录", 211)); // 记录一日三餐,给生活添一点幸福感
+
+ //动物圈
+ zones.Add(new ZoneAttr(217, "animal", "动物圈")); // 主分区
+ zones.Add(new ZoneAttr(218, "cat", "喵星人", 217)); // 喵喵喵喵喵
+ zones.Add(new ZoneAttr(219, "dog", "汪星人", 217)); // 汪汪汪汪汪
+ zones.Add(new ZoneAttr(220, "panda", "大熊猫", 217)); // 芝麻汤圆营业中
+ zones.Add(new ZoneAttr(221, "wild_animal", "野生动物", 217)); // 内有“猛兽”出没
+ zones.Add(new ZoneAttr(222, "reptiles", "爬宠", 217)); // 鳞甲有灵
+ zones.Add(new ZoneAttr(75, "animal_composite", "动物综合", 217)); // 收录除上述子分区外,其余动物相关视频以及非动物主体或多个动物主体的动物相关延伸内容
+
+ //鬼畜
+ zones.Add(new ZoneAttr(119, "kichiku", "鬼畜")); // 主分区
+ zones.Add(new ZoneAttr(22, "guide", "鬼畜调教", 119)); // 使用素材在音频、画面上做一定处理,达到与BGM一定的同步感
+ zones.Add(new ZoneAttr(26, "mad", "音MAD", 119)); // 使用素材音频进行一定的二次创作来达到还原原曲的非商业性质稿件
+ zones.Add(new ZoneAttr(126, "manual_vocaloid", "人力VOCALOID",
+ 119)); // 将人物或者角色的无伴奏素材进行人工调音,使其就像VOCALOID一样歌唱的技术
+ zones.Add(new ZoneAttr(216, "theatre", "鬼畜剧场", 119)); // 使用素材进行人工剪辑编排的有剧情的作品
+ zones.Add(new ZoneAttr(127, "course", "教程演示", 119)); // 鬼畜相关的教程演示
+
+ //时尚
+ zones.Add(new ZoneAttr(155, "fashion", "时尚")); // 主分区
+ zones.Add(new ZoneAttr(157, "makeup", "美妆护肤", 155)); // 彩妆护肤、美甲美发、仿妆、医美相关内容分享或产品测评
+ zones.Add(new ZoneAttr(252, "cos", "仿妆cos", 155)); // 对二次元、三次元人物角色进行模仿、还原、展示、演绎的内容
+ zones.Add(new ZoneAttr(158, "clothing", "穿搭", 155)); // 穿搭风格、穿搭技巧的展示分享,涵盖衣服、鞋靴、箱包配件、配饰(帽子、钟表、珠宝首饰)等
+ zones.Add(new ZoneAttr(159, "trend", "时尚潮流", 155)); // 时尚街拍、时装周、时尚大片,时尚品牌、潮流等行业相关记录及知识科普
+
+ //资讯
+ zones.Add(new ZoneAttr(202, "information", "资讯")); // 主分区
+ zones.Add(new ZoneAttr(203, "hotspot", "热点", 202)); // 全民关注的时政热门资讯
+ zones.Add(new ZoneAttr(204, "global", "环球", 202)); // 全球范围内发生的具有重大影响力的事件动态
+ zones.Add(new ZoneAttr(205, "social", "社会", 202)); // 日常生活的社会事件、社会问题、社会风貌的报道
+ zones.Add(new ZoneAttr(206, "multiple", "综合", 202)); // 除上述领域外其它垂直领域的综合资讯
+
+ //娱乐
+ zones.Add(new ZoneAttr(5, "ent", "娱乐")); // 主分区
+ zones.Add(new ZoneAttr(71, "variety", "综艺", 5)); // 所有综艺相关,全部一手掌握!
+ zones.Add(new ZoneAttr(241, "talker", "娱乐杂谈", 5)); // 娱乐人物解读、娱乐热点点评、娱乐行业分析
+ zones.Add(new ZoneAttr(242, "fans", "粉丝创作", 5)); // 粉丝向创作视频
+ zones.Add(new ZoneAttr(137, "celebrity", "明星综合", 5)); // 娱乐圈动态、明星资讯相关
+
+ //影视
+ zones.Add(new ZoneAttr(181, "cinephile", "影视")); // 主分区
+ zones.Add(new ZoneAttr(182, "cinecism", "影视杂谈", 181)); // 影视评论、解说、吐槽、科普等
+ zones.Add(new ZoneAttr(183, "montage", "影视剪辑", 181)); // 对影视素材进行剪辑再创作的视频
+ zones.Add(new ZoneAttr(85, "shortfilm", "小剧场", 181)); // 有场景、有剧情的演绎类内容
+ zones.Add(new ZoneAttr(184, "trailer_info", "预告·资讯", 181)); // 影视类相关资讯,预告,花絮等视频
+
+ //纪录片
+ zones.Add(new ZoneAttr(177, "documentary", "纪录片")); // 主分区
+ zones.Add(new ZoneAttr(37, "history", "人文·历史", 177)); //
+ zones.Add(new ZoneAttr(178, "science", "科学·探索·自然", 177)); //
+ zones.Add(new ZoneAttr(179, "military", "军事", 177)); //
+ zones.Add(new ZoneAttr(180, "travel", "社会·美食·旅行", 177)); //
+
+ //电影
+ zones.Add(new ZoneAttr(23, "movie", "电影")); // 主分区
+ zones.Add(new ZoneAttr(147, "chinese", "华语电影", 23)); //
+ zones.Add(new ZoneAttr(145, "west", "欧美电影", 23)); //
+ zones.Add(new ZoneAttr(146, "japan", "日本电影", 23)); //
+ zones.Add(new ZoneAttr(83, "movie", "其他国家", 23)); //
+
+ //电视剧
+ zones.Add(new ZoneAttr(11, "tv", "电视剧")); // 主分区
+ zones.Add(new ZoneAttr(185, "mainland", "国产剧", 11)); //
+ zones.Add(new ZoneAttr(187, "overseas", "海外剧", 11)); //
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Zone/VideoZoneIcon.cs b/DownKyi.Core/BiliApi/Zone/VideoZoneIcon.cs
new file mode 100644
index 0000000..15c3c32
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Zone/VideoZoneIcon.cs
@@ -0,0 +1,89 @@
+namespace DownKyi.Core.BiliApi.Zone;
+
+///
+/// 视频分区图标
+///
+public class VideoZoneIcon
+{
+ private static VideoZoneIcon instance;
+
+ ///
+ /// 获取VideoZoneIcon实例
+ ///
+ ///
+ public static VideoZoneIcon Instance()
+ {
+ if (instance == null)
+ {
+ instance = new VideoZoneIcon();
+ }
+
+ return instance;
+ }
+
+ ///
+ /// 隐藏VideoZoneIcon()方法,必须使用单例模式
+ ///
+ private VideoZoneIcon()
+ {
+ }
+
+ ///
+ /// 根据tid,获取视频分区图标
+ ///
+ ///
+ ///
+ public string GetZoneImageKey(int tid)
+ {
+ switch (tid)
+ {
+ // 课堂
+ case -10:
+ return "Zone.cheeseDrawingImage";
+ case 1:
+ return "Zone.dougaDrawingImage";
+ case 13:
+ return "Zone.animeDrawingImage";
+ case 167:
+ return "Zone.guochuangDrawingImage";
+ case 3:
+ return "Zone.musicDrawingImage";
+ case 129:
+ return "Zone.danceDrawingImage";
+ case 4:
+ return "Zone.gameDrawingImage";
+ case 36:
+ return "Zone.techDrawingImage";
+ case 188:
+ return "Zone.digitalDrawingImage";
+ case 234:
+ return "Zone.sportsDrawingImage";
+ case 223:
+ return "Zone.carDrawingImage";
+ case 160:
+ return "Zone.lifeDrawingImage";
+ case 211:
+ return "Zone.foodDrawingImage";
+ case 217:
+ return "Zone.animalDrawingImage";
+ case 119:
+ return "Zone.kichikuDrawingImage";
+ case 155:
+ return "Zone.fashionDrawingImage";
+ case 202:
+ return "Zone.informationDrawingImage";
+ case 5:
+ return "Zone.entDrawingImage";
+ case 181:
+ return "Zone.cinephileDrawingImage";
+ case 177:
+ return "Zone.documentaryDrawingImage";
+ case 23:
+ return "Zone.movieDrawingImage";
+ case 11:
+ return "Zone.teleplayDrawingImage";
+ default:
+ return "videoUpDrawingImage";
+ }
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Zone/ZoneAttr.cs b/DownKyi.Core/BiliApi/Zone/ZoneAttr.cs
new file mode 100644
index 0000000..619b609
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Zone/ZoneAttr.cs
@@ -0,0 +1,17 @@
+namespace DownKyi.Core.BiliApi.Zone;
+
+public class ZoneAttr
+{
+ public int Id { get; }
+ public string Type { get; }
+ public string Name { get; }
+ public int ParentId { get; }
+
+ public ZoneAttr(int id, string type, string name, int parentId = 0)
+ {
+ Id = id;
+ Type = type;
+ Name = name;
+ ParentId = parentId;
+ }
+}
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/Zone/ZoneImages.axaml b/DownKyi.Core/BiliApi/Zone/ZoneImages.axaml
new file mode 100644
index 0000000..5ba7cee
--- /dev/null
+++ b/DownKyi.Core/BiliApi/Zone/ZoneImages.axaml
@@ -0,0 +1,432 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DownKyi.Core/BiliApi/protobuf/bilibili/community/service/dm/v1/Dm.cs b/DownKyi.Core/BiliApi/protobuf/bilibili/community/service/dm/v1/Dm.cs
new file mode 100644
index 0000000..a423dbb
--- /dev/null
+++ b/DownKyi.Core/BiliApi/protobuf/bilibili/community/service/dm/v1/Dm.cs
@@ -0,0 +1,14819 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: bilibili/community/service/dm/v1/dm.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Bilibili.Community.Service.Dm.V1 {
+
+ /// Holder for reflection information generated from bilibili/community/service/dm/v1/dm.proto
+ public static partial class DmReflection {
+
+ #region Descriptor
+ /// File descriptor for bilibili/community/service/dm/v1/dm.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static DmReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CiliaWxpYmlsaS9jb21tdW5pdHkvc2VydmljZS9kbS92MS9kbS5wcm90bxIg",
+ "YmlsaWJpbGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEiTAoLRG1TZWdTREtS",
+ "ZXESCwoDcGlkGAEgASgDEgsKA29pZBgCIAEoAxIMCgR0eXBlGAMgASgFEhUK",
+ "DXNlZ21lbnRfaW5kZXgYBCABKAMiXQoNRG1TZWdTREtSZXBseRIOCgZjbG9z",
+ "ZWQYASABKAgSPAoFZWxlbXMYAiADKAsyLS5iaWxpYmlsaS5jb21tdW5pdHku",
+ "c2VydmljZS5kbS52MS5EYW5tYWt1RWxlbSJMCgtEbVNlZ090dFJlcRILCgNw",
+ "aWQYASABKAMSCwoDb2lkGAIgASgDEgwKBHR5cGUYAyABKAUSFQoNc2VnbWVu",
+ "dF9pbmRleBgEIAEoAyJdCg1EbVNlZ090dFJlcGx5Eg4KBmNsb3NlZBgBIAEo",
+ "CBI8CgVlbGVtcxgCIAMoCzItLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNl",
+ "LmRtLnYxLkRhbm1ha3VFbGVtImcKDkRtU2VnTW9iaWxlUmVxEgsKA3BpZBgB",
+ "IAEoAxILCgNvaWQYAiABKAMSDAoEdHlwZRgDIAEoBRIVCg1zZWdtZW50X2lu",
+ "ZGV4GAQgASgDEhYKDnRlZW5hZ2Vyc19tb2RlGAUgASgFIqEBChBEbVNlZ01v",
+ "YmlsZVJlcGx5EjwKBWVsZW1zGAEgAygLMi0uYmlsaWJpbGkuY29tbXVuaXR5",
+ "LnNlcnZpY2UuZG0udjEuRGFubWFrdUVsZW0SDQoFc3RhdGUYAiABKAUSQAoH",
+ "YWlfZmxhZxgDIAEoCzIvLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRt",
+ "LnYxLkRhbm1ha3VBSUZsYWciWAoJRG1WaWV3UmVxEgsKA3BpZBgBIAEoAxIL",
+ "CgNvaWQYAiABKAMSDAoEdHlwZRgDIAEoBRINCgVzcG1pZBgEIAEoCRIUCgxp",
+ "c19oYXJkX2Jvb3QYBSABKAUi8AMKC0RtVmlld1JlcGx5Eg4KBmNsb3NlZBgB",
+ "IAEoCBI5CgRtYXNrGAIgASgLMisuYmlsaWJpbGkuY29tbXVuaXR5LnNlcnZp",
+ "Y2UuZG0udjEuVmlkZW9NYXNrEkEKCHN1YnRpdGxlGAMgASgLMi8uYmlsaWJp",
+ "bGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEuVmlkZW9TdWJ0aXRsZRITCgtz",
+ "cGVjaWFsX2RtcxgEIAMoCRJECgdhaV9mbGFnGAUgASgLMjMuYmlsaWJpbGku",
+ "Y29tbXVuaXR5LnNlcnZpY2UuZG0udjEuRGFubWFrdUZsYWdDb25maWcSTgoN",
+ "cGxheWVyX2NvbmZpZxgGIAEoCzI3LmJpbGliaWxpLmNvbW11bml0eS5zZXJ2",
+ "aWNlLmRtLnYxLkRhbm11UGxheWVyVmlld0NvbmZpZxIWCg5zZW5kX2JveF9z",
+ "dHlsZRgHIAEoBRINCgVhbGxvdxgIIAEoCBIRCgljaGVja19ib3gYCSABKAkS",
+ "GgoSY2hlY2tfYm94X3Nob3dfbXNnGAogASgJEhgKEHRleHRfcGxhY2Vob2xk",
+ "ZXIYCyABKAkSGQoRaW5wdXRfcGxhY2Vob2xkZXIYDCABKAkSHQoVcmVwb3J0",
+ "X2ZpbHRlcl9jb250ZW50GA0gAygJIqgDCg5EbVdlYlZpZXdSZXBseRINCgVz",
+ "dGF0ZRgBIAEoBRIMCgR0ZXh0GAIgASgJEhEKCXRleHRfc2lkZRgDIAEoCRI9",
+ "CgZkbV9zZ2UYBCABKAsyLS5iaWxpYmlsaS5jb21tdW5pdHkuc2VydmljZS5k",
+ "bS52MS5EbVNlZ0NvbmZpZxJBCgRmbGFnGAUgASgLMjMuYmlsaWJpbGkuY29t",
+ "bXVuaXR5LnNlcnZpY2UuZG0udjEuRGFubWFrdUZsYWdDb25maWcSEwoLc3Bl",
+ "Y2lhbF9kbXMYBiADKAkSEQoJY2hlY2tfYm94GAcgASgIEg0KBWNvdW50GAgg",
+ "ASgDEj8KCmNvbW1hbmREbXMYCSADKAsyKy5iaWxpYmlsaS5jb21tdW5pdHku",
+ "c2VydmljZS5kbS52MS5Db21tYW5kRG0STQoNcGxheWVyX2NvbmZpZxgKIAEo",
+ "CzI2LmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLkRhbm11V2Vi",
+ "UGxheWVyQ29uZmlnEh0KFXJlcG9ydF9maWx0ZXJfY29udGVudBgLIAMoCSKh",
+ "AQoJQ29tbWFuZERtEgoKAmlkGAEgASgDEgsKA29pZBgCIAEoAxILCgNtaWQY",
+ "AyABKAkSDwoHY29tbWFuZBgEIAEoCRIPCgdjb250ZW50GAUgASgJEhAKCHBy",
+ "b2dyZXNzGAYgASgFEg0KBWN0aW1lGAcgASgJEg0KBW10aW1lGAggASgJEg0K",
+ "BWV4dHJhGAkgASgJEg0KBWlkU3RyGAogASgJIi8KC0RtU2VnQ29uZmlnEhEK",
+ "CXBhZ2Vfc2l6ZRgBIAEoAxINCgV0b3RhbBgCIAEoAyJTCglWaWRlb01hc2sS",
+ "CwoDY2lkGAEgASgDEgwKBHBsYXQYAiABKAUSCwoDZnBzGAMgASgFEgwKBHRp",
+ "bWUYBCABKAMSEAoIbWFza191cmwYBSABKAkibwoNVmlkZW9TdWJ0aXRsZRIL",
+ "CgNsYW4YASABKAkSDgoGbGFuRG9jGAIgASgJEkEKCXN1YnRpdGxlcxgDIAMo",
+ "CzIuLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLlN1YnRpdGxl",
+ "SXRlbSKPAwoURGFubXVXZWJQbGF5ZXJDb25maWcSEQoJZG1fc3dpdGNoGAEg",
+ "ASgIEhEKCWFpX3N3aXRjaBgCIAEoCBIQCghhaV9sZXZlbBgDIAEoBRIQCghi",
+ "bG9ja3RvcBgEIAEoCBITCgtibG9ja3Njcm9sbBgFIAEoCBITCgtibG9ja2Jv",
+ "dHRvbRgGIAEoCBISCgpibG9ja2NvbG9yGAcgASgIEhQKDGJsb2Nrc3BlY2lh",
+ "bBgIIAEoCBIUCgxwcmV2ZW50c2hhZGUYCSABKAgSDQoFZG1hc2sYCiABKAgS",
+ "DwoHb3BhY2l0eRgLIAEoAhIOCgZkbWFyZWEYDCABKAUSEQoJc3BlZWRwbHVz",
+ "GA0gASgCEhAKCGZvbnRzaXplGA4gASgCEhIKCnNjcmVlbnN5bmMYDyABKAgS",
+ "EQoJc3BlZWRzeW5jGBAgASgIEhIKCmZvbnRmYW1pbHkYESABKAkSDAoEYm9s",
+ "ZBgSIAEoCBISCgpmb250Ym9yZGVyGBMgASgFEhEKCWRyYXdfdHlwZRgUIAEo",
+ "CSKaAQoMU3VidGl0bGVJdGVtEgoKAmlkGAEgASgDEg4KBmlkX3N0chgCIAEo",
+ "CRILCgNsYW4YAyABKAkSDwoHbGFuX2RvYxgEIAEoCRIUCgxzdWJ0aXRsZV91",
+ "cmwYBSABKAkSOgoGYXV0aG9yGAYgASgLMiouYmlsaWJpbGkuY29tbXVuaXR5",
+ "LnNlcnZpY2UuZG0udjEuVXNlckluZm8iXAoIVXNlckluZm8SCwoDbWlkGAEg",
+ "ASgDEgwKBG5hbWUYAiABKAkSCwoDc2V4GAMgASgJEgwKBGZhY2UYBCABKAkS",
+ "DAoEc2lnbhgFIAEoCRIMCgRyYW5rGAYgASgFItYBCgtEYW5tYWt1RWxlbRIK",
+ "CgJpZBgBIAEoAxIQCghwcm9ncmVzcxgCIAEoBRIMCgRtb2RlGAMgASgFEhAK",
+ "CGZvbnRzaXplGAQgASgFEg0KBWNvbG9yGAUgASgNEg8KB21pZEhhc2gYBiAB",
+ "KAkSDwoHY29udGVudBgHIAEoCRINCgVjdGltZRgIIAEoAxIOCgZ3ZWlnaHQY",
+ "CSABKAUSDgoGYWN0aW9uGAogASgJEgwKBHBvb2wYCyABKAUSDQoFaWRTdHIY",
+ "DCABKAkSDAoEYXR0chgNIAEoBSKgCwoRRG1QbGF5ZXJDb25maWdSZXESCgoC",
+ "dHMYASABKAMSRQoGc3dpdGNoGAIgASgLMjUuYmlsaWJpbGkuY29tbXVuaXR5",
+ "LnNlcnZpY2UuZG0udjEuUGxheWVyRGFubWFrdVN3aXRjaBJOCgtzd2l0Y2hf",
+ "c2F2ZRgDIAEoCzI5LmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYx",
+ "LlBsYXllckRhbm1ha3VTd2l0Y2hTYXZlElsKEnVzZV9kZWZhdWx0X2NvbmZp",
+ "ZxgEIAEoCzI/LmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLlBs",
+ "YXllckRhbm1ha3VVc2VEZWZhdWx0Q29uZmlnEmEKFWFpX3JlY29tbWVuZGVk",
+ "X3N3aXRjaBgFIAEoCzJCLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRt",
+ "LnYxLlBsYXllckRhbm1ha3VBaVJlY29tbWVuZGVkU3dpdGNoEl8KFGFpX3Jl",
+ "Y29tbWVuZGVkX2xldmVsGAYgASgLMkEuYmlsaWJpbGkuY29tbXVuaXR5LnNl",
+ "cnZpY2UuZG0udjEuUGxheWVyRGFubWFrdUFpUmVjb21tZW5kZWRMZXZlbBJJ",
+ "CghibG9ja3RvcBgHIAEoCzI3LmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNl",
+ "LmRtLnYxLlBsYXllckRhbm1ha3VCbG9ja3RvcBJPCgtibG9ja3Njcm9sbBgI",
+ "IAEoCzI6LmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLlBsYXll",
+ "ckRhbm1ha3VCbG9ja3Njcm9sbBJPCgtibG9ja2JvdHRvbRgJIAEoCzI6LmJp",
+ "bGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLlBsYXllckRhbm1ha3VC",
+ "bG9ja2JvdHRvbRJTCg1ibG9ja2NvbG9yZnVsGAogASgLMjwuYmlsaWJpbGku",
+ "Y29tbXVuaXR5LnNlcnZpY2UuZG0udjEuUGxheWVyRGFubWFrdUJsb2NrY29s",
+ "b3JmdWwSTwoLYmxvY2tyZXBlYXQYCyABKAsyOi5iaWxpYmlsaS5jb21tdW5p",
+ "dHkuc2VydmljZS5kbS52MS5QbGF5ZXJEYW5tYWt1QmxvY2tyZXBlYXQSUQoM",
+ "YmxvY2tzcGVjaWFsGAwgASgLMjsuYmlsaWJpbGkuY29tbXVuaXR5LnNlcnZp",
+ "Y2UuZG0udjEuUGxheWVyRGFubWFrdUJsb2Nrc3BlY2lhbBJHCgdvcGFjaXR5",
+ "GA0gASgLMjYuYmlsaWJpbGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEuUGxh",
+ "eWVyRGFubWFrdU9wYWNpdHkSUwoNc2NhbGluZ2ZhY3RvchgOIAEoCzI8LmJp",
+ "bGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLlBsYXllckRhbm1ha3VT",
+ "Y2FsaW5nZmFjdG9yEkUKBmRvbWFpbhgPIAEoCzI1LmJpbGliaWxpLmNvbW11",
+ "bml0eS5zZXJ2aWNlLmRtLnYxLlBsYXllckRhbm1ha3VEb21haW4SQwoFc3Bl",
+ "ZWQYECABKAsyNC5iaWxpYmlsaS5jb21tdW5pdHkuc2VydmljZS5kbS52MS5Q",
+ "bGF5ZXJEYW5tYWt1U3BlZWQSVwoPZW5hYmxlYmxvY2tsaXN0GBEgASgLMj4u",
+ "YmlsaWJpbGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEuUGxheWVyRGFubWFr",
+ "dUVuYWJsZWJsb2NrbGlzdBJeChlpbmxpbmVQbGF5ZXJEYW5tYWt1U3dpdGNo",
+ "GBIgASgLMjsuYmlsaWJpbGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEuSW5s",
+ "aW5lUGxheWVyRGFubWFrdVN3aXRjaCIpCghSZXNwb25zZRIMCgRjb2RlGAEg",
+ "ASgFEg8KB21lc3NhZ2UYAiABKAkiKQoLRGFubWFrdUZsYWcSDAoEZG1pZBgB",
+ "IAEoAxIMCgRmbGFnGAIgASgNIksKEURhbm1ha3VGbGFnQ29uZmlnEhAKCHJl",
+ "Y19mbGFnGAEgASgFEhAKCHJlY190ZXh0GAIgASgJEhIKCnJlY19zd2l0Y2gY",
+ "AyABKAUiUAoNRGFubWFrdUFJRmxhZxI/CghkbV9mbGFncxgBIAMoCzItLmJp",
+ "bGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLkRhbm1ha3VGbGFnIrEC",
+ "ChVEYW5tdVBsYXllclZpZXdDb25maWcSYQodZGFubXVrdV9kZWZhdWx0X3Bs",
+ "YXllcl9jb25maWcYASABKAsyOi5iaWxpYmlsaS5jb21tdW5pdHkuc2Vydmlj",
+ "ZS5kbS52MS5EYW5tdURlZmF1bHRQbGF5ZXJDb25maWcSUgoVZGFubXVrdV9w",
+ "bGF5ZXJfY29uZmlnGAIgASgLMjMuYmlsaWJpbGkuY29tbXVuaXR5LnNlcnZp",
+ "Y2UuZG0udjEuRGFubXVQbGF5ZXJDb25maWcSYQodZGFubXVrdV9wbGF5ZXJf",
+ "ZHluYW1pY19jb25maWcYAyADKAsyOi5iaWxpYmlsaS5jb21tdW5pdHkuc2Vy",
+ "dmljZS5kbS52MS5EYW5tdVBsYXllckR5bmFtaWNDb25maWcioQQKGERhbm11",
+ "RGVmYXVsdFBsYXllckNvbmZpZxIpCiFwbGF5ZXJfZGFubWFrdV91c2VfZGVm",
+ "YXVsdF9jb25maWcYASABKAgSLAokcGxheWVyX2Rhbm1ha3VfYWlfcmVjb21t",
+ "ZW5kZWRfc3dpdGNoGAQgASgIEisKI3BsYXllcl9kYW5tYWt1X2FpX3JlY29t",
+ "bWVuZGVkX2xldmVsGAUgASgFEh8KF3BsYXllcl9kYW5tYWt1X2Jsb2NrdG9w",
+ "GAYgASgIEiIKGnBsYXllcl9kYW5tYWt1X2Jsb2Nrc2Nyb2xsGAcgASgIEiIK",
+ "GnBsYXllcl9kYW5tYWt1X2Jsb2NrYm90dG9tGAggASgIEiQKHHBsYXllcl9k",
+ "YW5tYWt1X2Jsb2NrY29sb3JmdWwYCSABKAgSIgoacGxheWVyX2Rhbm1ha3Vf",
+ "YmxvY2tyZXBlYXQYCiABKAgSIwobcGxheWVyX2Rhbm1ha3VfYmxvY2tzcGVj",
+ "aWFsGAsgASgIEh4KFnBsYXllcl9kYW5tYWt1X29wYWNpdHkYDCABKAISJAoc",
+ "cGxheWVyX2Rhbm1ha3Vfc2NhbGluZ2ZhY3RvchgNIAEoAhIdChVwbGF5ZXJf",
+ "ZGFubWFrdV9kb21haW4YDiABKAISHAoUcGxheWVyX2Rhbm1ha3Vfc3BlZWQY",
+ "DyABKAUSJAocaW5saW5lX3BsYXllcl9kYW5tYWt1X3N3aXRjaBgQIAEoCCKr",
+ "BQoRRGFubXVQbGF5ZXJDb25maWcSHQoVcGxheWVyX2Rhbm1ha3Vfc3dpdGNo",
+ "GAEgASgIEiIKGnBsYXllcl9kYW5tYWt1X3N3aXRjaF9zYXZlGAIgASgIEikK",
+ "IXBsYXllcl9kYW5tYWt1X3VzZV9kZWZhdWx0X2NvbmZpZxgDIAEoCBIsCiRw",
+ "bGF5ZXJfZGFubWFrdV9haV9yZWNvbW1lbmRlZF9zd2l0Y2gYBCABKAgSKwoj",
+ "cGxheWVyX2Rhbm1ha3VfYWlfcmVjb21tZW5kZWRfbGV2ZWwYBSABKAUSHwoX",
+ "cGxheWVyX2Rhbm1ha3VfYmxvY2t0b3AYBiABKAgSIgoacGxheWVyX2Rhbm1h",
+ "a3VfYmxvY2tzY3JvbGwYByABKAgSIgoacGxheWVyX2Rhbm1ha3VfYmxvY2ti",
+ "b3R0b20YCCABKAgSJAoccGxheWVyX2Rhbm1ha3VfYmxvY2tjb2xvcmZ1bBgJ",
+ "IAEoCBIiChpwbGF5ZXJfZGFubWFrdV9ibG9ja3JlcGVhdBgKIAEoCBIjChtw",
+ "bGF5ZXJfZGFubWFrdV9ibG9ja3NwZWNpYWwYCyABKAgSHgoWcGxheWVyX2Rh",
+ "bm1ha3Vfb3BhY2l0eRgMIAEoAhIkChxwbGF5ZXJfZGFubWFrdV9zY2FsaW5n",
+ "ZmFjdG9yGA0gASgCEh0KFXBsYXllcl9kYW5tYWt1X2RvbWFpbhgOIAEoAhIc",
+ "ChRwbGF5ZXJfZGFubWFrdV9zcGVlZBgPIAEoBRImCh5wbGF5ZXJfZGFubWFr",
+ "dV9lbmFibGVibG9ja2xpc3QYECABKAgSJAocaW5saW5lX3BsYXllcl9kYW5t",
+ "YWt1X3N3aXRjaBgRIAEoCBIkChxpbmxpbmVfcGxheWVyX2Rhbm1ha3VfY29u",
+ "ZmlnGBIgASgFIksKGERhbm11UGxheWVyRHluYW1pY0NvbmZpZxIQCghwcm9n",
+ "cmVzcxgBIAEoBRIdChVwbGF5ZXJfZGFubWFrdV9kb21haW4YAiABKAIiNwoT",
+ "UGxheWVyRGFubWFrdVN3aXRjaBINCgV2YWx1ZRgBIAEoCBIRCgljYW5JZ25v",
+ "cmUYAiABKAgiKAoXUGxheWVyRGFubWFrdVN3aXRjaFNhdmUSDQoFdmFsdWUY",
+ "ASABKAgiLgodUGxheWVyRGFubWFrdVVzZURlZmF1bHRDb25maWcSDQoFdmFs",
+ "dWUYASABKAgiMQogUGxheWVyRGFubWFrdUFpUmVjb21tZW5kZWRTd2l0Y2gS",
+ "DQoFdmFsdWUYASABKAgiMAofUGxheWVyRGFubWFrdUFpUmVjb21tZW5kZWRM",
+ "ZXZlbBINCgV2YWx1ZRgBIAEoCCImChVQbGF5ZXJEYW5tYWt1QmxvY2t0b3AS",
+ "DQoFdmFsdWUYASABKAgiKQoYUGxheWVyRGFubWFrdUJsb2Nrc2Nyb2xsEg0K",
+ "BXZhbHVlGAEgASgIIikKGFBsYXllckRhbm1ha3VCbG9ja2JvdHRvbRINCgV2",
+ "YWx1ZRgBIAEoCCIrChpQbGF5ZXJEYW5tYWt1QmxvY2tjb2xvcmZ1bBINCgV2",
+ "YWx1ZRgBIAEoCCIpChhQbGF5ZXJEYW5tYWt1QmxvY2tyZXBlYXQSDQoFdmFs",
+ "dWUYASABKAgiKgoZUGxheWVyRGFubWFrdUJsb2Nrc3BlY2lhbBINCgV2YWx1",
+ "ZRgBIAEoCCIlChRQbGF5ZXJEYW5tYWt1T3BhY2l0eRINCgV2YWx1ZRgBIAEo",
+ "AiIrChpQbGF5ZXJEYW5tYWt1U2NhbGluZ2ZhY3RvchINCgV2YWx1ZRgBIAEo",
+ "AiIkChNQbGF5ZXJEYW5tYWt1RG9tYWluEg0KBXZhbHVlGAEgASgCIiMKElBs",
+ "YXllckRhbm1ha3VTcGVlZBINCgV2YWx1ZRgBIAEoBSItChxQbGF5ZXJEYW5t",
+ "YWt1RW5hYmxlYmxvY2tsaXN0Eg0KBXZhbHVlGAEgASgIIioKGUlubGluZVBs",
+ "YXllckRhbm1ha3VTd2l0Y2gSDQoFdmFsdWUYASABKAgqTAoJRE1BdHRyQml0",
+ "EhQKEERNQXR0ckJpdFByb3RlY3QQABIVChFETUF0dHJCaXRGcm9tTGl2ZRAB",
+ "EhIKDkRNQXR0ckhpZ2hMaWtlEAIyqgQKAkRNEnMKC0RtU2VnTW9iaWxlEjAu",
+ "YmlsaWJpbGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEuRG1TZWdNb2JpbGVS",
+ "ZXEaMi5iaWxpYmlsaS5jb21tdW5pdHkuc2VydmljZS5kbS52MS5EbVNlZ01v",
+ "YmlsZVJlcGx5EmQKBkRtVmlldxIrLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2",
+ "aWNlLmRtLnYxLkRtVmlld1JlcRotLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2",
+ "aWNlLmRtLnYxLkRtVmlld1JlcGx5EnEKDkRtUGxheWVyQ29uZmlnEjMuYmls",
+ "aWJpbGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEuRG1QbGF5ZXJDb25maWdS",
+ "ZXEaKi5iaWxpYmlsaS5jb21tdW5pdHkuc2VydmljZS5kbS52MS5SZXNwb25z",
+ "ZRJqCghEbVNlZ090dBItLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRt",
+ "LnYxLkRtU2VnT3R0UmVxGi8uYmlsaWJpbGkuY29tbXVuaXR5LnNlcnZpY2Uu",
+ "ZG0udjEuRG1TZWdPdHRSZXBseRJqCghEbVNlZ1NESxItLmJpbGliaWxpLmNv",
+ "bW11bml0eS5zZXJ2aWNlLmRtLnYxLkRtU2VnU0RLUmVxGi8uYmlsaWJpbGku",
+ "Y29tbXVuaXR5LnNlcnZpY2UuZG0udjEuRG1TZWdTREtSZXBseWIGcHJvdG8z"));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Bilibili.Community.Service.Dm.V1.DMAttrBit), }, null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmSegSDKReq), global::Bilibili.Community.Service.Dm.V1.DmSegSDKReq.Parser, new[]{ "Pid", "Oid", "Type", "SegmentIndex" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmSegSDKReply), global::Bilibili.Community.Service.Dm.V1.DmSegSDKReply.Parser, new[]{ "Closed", "Elems" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmSegOttReq), global::Bilibili.Community.Service.Dm.V1.DmSegOttReq.Parser, new[]{ "Pid", "Oid", "Type", "SegmentIndex" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmSegOttReply), global::Bilibili.Community.Service.Dm.V1.DmSegOttReply.Parser, new[]{ "Closed", "Elems" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmSegMobileReq), global::Bilibili.Community.Service.Dm.V1.DmSegMobileReq.Parser, new[]{ "Pid", "Oid", "Type", "SegmentIndex", "TeenagersMode" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmSegMobileReply), global::Bilibili.Community.Service.Dm.V1.DmSegMobileReply.Parser, new[]{ "Elems", "State", "AiFlag" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmViewReq), global::Bilibili.Community.Service.Dm.V1.DmViewReq.Parser, new[]{ "Pid", "Oid", "Type", "Spmid", "IsHardBoot" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmViewReply), global::Bilibili.Community.Service.Dm.V1.DmViewReply.Parser, new[]{ "Closed", "Mask", "Subtitle", "SpecialDms", "AiFlag", "PlayerConfig", "SendBoxStyle", "Allow", "CheckBox", "CheckBoxShowMsg", "TextPlaceholder", "InputPlaceholder", "ReportFilterContent" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmWebViewReply), global::Bilibili.Community.Service.Dm.V1.DmWebViewReply.Parser, new[]{ "State", "Text", "TextSide", "DmSge", "Flag", "SpecialDms", "CheckBox", "Count", "CommandDms", "PlayerConfig", "ReportFilterContent" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.CommandDm), global::Bilibili.Community.Service.Dm.V1.CommandDm.Parser, new[]{ "Id", "Oid", "Mid", "Command", "Content", "Progress", "Ctime", "Mtime", "Extra", "IdStr" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmSegConfig), global::Bilibili.Community.Service.Dm.V1.DmSegConfig.Parser, new[]{ "PageSize", "Total" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.VideoMask), global::Bilibili.Community.Service.Dm.V1.VideoMask.Parser, new[]{ "Cid", "Plat", "Fps", "Time", "MaskUrl" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.VideoSubtitle), global::Bilibili.Community.Service.Dm.V1.VideoSubtitle.Parser, new[]{ "Lan", "LanDoc", "Subtitles" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DanmuWebPlayerConfig), global::Bilibili.Community.Service.Dm.V1.DanmuWebPlayerConfig.Parser, new[]{ "DmSwitch", "AiSwitch", "AiLevel", "Blocktop", "Blockscroll", "Blockbottom", "Blockcolor", "Blockspecial", "Preventshade", "Dmask", "Opacity", "Dmarea", "Speedplus", "Fontsize", "Screensync", "Speedsync", "Fontfamily", "Bold", "Fontborder", "DrawType" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.SubtitleItem), global::Bilibili.Community.Service.Dm.V1.SubtitleItem.Parser, new[]{ "Id", "IdStr", "Lan", "LanDoc", "SubtitleUrl", "Author" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.UserInfo), global::Bilibili.Community.Service.Dm.V1.UserInfo.Parser, new[]{ "Mid", "Name", "Sex", "Face", "Sign", "Rank" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DanmakuElem), global::Bilibili.Community.Service.Dm.V1.DanmakuElem.Parser, new[]{ "Id", "Progress", "Mode", "Fontsize", "Color", "MidHash", "Content", "Ctime", "Weight", "Action", "Pool", "IdStr", "Attr" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DmPlayerConfigReq), global::Bilibili.Community.Service.Dm.V1.DmPlayerConfigReq.Parser, new[]{ "Ts", "Switch", "SwitchSave", "UseDefaultConfig", "AiRecommendedSwitch", "AiRecommendedLevel", "Blocktop", "Blockscroll", "Blockbottom", "Blockcolorful", "Blockrepeat", "Blockspecial", "Opacity", "Scalingfactor", "Domain", "Speed", "Enableblocklist", "InlinePlayerDanmakuSwitch" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.Response), global::Bilibili.Community.Service.Dm.V1.Response.Parser, new[]{ "Code", "Message" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DanmakuFlag), global::Bilibili.Community.Service.Dm.V1.DanmakuFlag.Parser, new[]{ "Dmid", "Flag" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DanmakuFlagConfig), global::Bilibili.Community.Service.Dm.V1.DanmakuFlagConfig.Parser, new[]{ "RecFlag", "RecText", "RecSwitch" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DanmakuAIFlag), global::Bilibili.Community.Service.Dm.V1.DanmakuAIFlag.Parser, new[]{ "DmFlags" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DanmuPlayerViewConfig), global::Bilibili.Community.Service.Dm.V1.DanmuPlayerViewConfig.Parser, new[]{ "DanmukuDefaultPlayerConfig", "DanmukuPlayerConfig", "DanmukuPlayerDynamicConfig" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DanmuDefaultPlayerConfig), global::Bilibili.Community.Service.Dm.V1.DanmuDefaultPlayerConfig.Parser, new[]{ "PlayerDanmakuUseDefaultConfig", "PlayerDanmakuAiRecommendedSwitch", "PlayerDanmakuAiRecommendedLevel", "PlayerDanmakuBlocktop", "PlayerDanmakuBlockscroll", "PlayerDanmakuBlockbottom", "PlayerDanmakuBlockcolorful", "PlayerDanmakuBlockrepeat", "PlayerDanmakuBlockspecial", "PlayerDanmakuOpacity", "PlayerDanmakuScalingfactor", "PlayerDanmakuDomain", "PlayerDanmakuSpeed", "InlinePlayerDanmakuSwitch" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DanmuPlayerConfig), global::Bilibili.Community.Service.Dm.V1.DanmuPlayerConfig.Parser, new[]{ "PlayerDanmakuSwitch", "PlayerDanmakuSwitchSave", "PlayerDanmakuUseDefaultConfig", "PlayerDanmakuAiRecommendedSwitch", "PlayerDanmakuAiRecommendedLevel", "PlayerDanmakuBlocktop", "PlayerDanmakuBlockscroll", "PlayerDanmakuBlockbottom", "PlayerDanmakuBlockcolorful", "PlayerDanmakuBlockrepeat", "PlayerDanmakuBlockspecial", "PlayerDanmakuOpacity", "PlayerDanmakuScalingfactor", "PlayerDanmakuDomain", "PlayerDanmakuSpeed", "PlayerDanmakuEnableblocklist", "InlinePlayerDanmakuSwitch", "InlinePlayerDanmakuConfig" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.DanmuPlayerDynamicConfig), global::Bilibili.Community.Service.Dm.V1.DanmuPlayerDynamicConfig.Parser, new[]{ "Progress", "PlayerDanmakuDomain" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuSwitch), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuSwitch.Parser, new[]{ "Value", "CanIgnore" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuSwitchSave), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuSwitchSave.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuUseDefaultConfig), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuUseDefaultConfig.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuAiRecommendedSwitch), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuAiRecommendedSwitch.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuAiRecommendedLevel), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuAiRecommendedLevel.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlocktop), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlocktop.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlockscroll), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlockscroll.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlockbottom), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlockbottom.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlockcolorful), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlockcolorful.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlockrepeat), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlockrepeat.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlockspecial), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuBlockspecial.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuOpacity), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuOpacity.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuScalingfactor), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuScalingfactor.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuDomain), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuDomain.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuSpeed), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuSpeed.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuEnableblocklist), global::Bilibili.Community.Service.Dm.V1.PlayerDanmakuEnableblocklist.Parser, new[]{ "Value" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Bilibili.Community.Service.Dm.V1.InlinePlayerDanmakuSwitch), global::Bilibili.Community.Service.Dm.V1.InlinePlayerDanmakuSwitch.Parser, new[]{ "Value" }, null, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Enums
+ ///
+ /// 弹幕属性位值
+ ///
+ public enum DMAttrBit {
+ ///
+ /// 保护弹幕
+ ///
+ [pbr::OriginalName("DMAttrBitProtect")] Protect = 0,
+ ///
+ /// 直播弹幕
+ ///
+ [pbr::OriginalName("DMAttrBitFromLive")] FromLive = 1,
+ ///
+ /// 高赞弹幕
+ ///
+ [pbr::OriginalName("DMAttrHighLike")] DmattrHighLike = 2,
+ }
+
+ #endregion
+
+ #region Messages
+ ///
+ /// 弹幕SDK-请求
+ ///
+ public sealed partial class DmSegSDKReq : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DmSegSDKReq());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Bilibili.Community.Service.Dm.V1.DmReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegSDKReq() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegSDKReq(DmSegSDKReq other) : this() {
+ pid_ = other.pid_;
+ oid_ = other.oid_;
+ type_ = other.type_;
+ segmentIndex_ = other.segmentIndex_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegSDKReq Clone() {
+ return new DmSegSDKReq(this);
+ }
+
+ /// Field number for the "pid" field.
+ public const int PidFieldNumber = 1;
+ private long pid_;
+ ///
+ /// 稿件avid/漫画epid
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Pid {
+ get { return pid_; }
+ set {
+ pid_ = value;
+ }
+ }
+
+ /// Field number for the "oid" field.
+ public const int OidFieldNumber = 2;
+ private long oid_;
+ ///
+ /// 视频cid/漫画cid
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Oid {
+ get { return oid_; }
+ set {
+ oid_ = value;
+ }
+ }
+
+ /// Field number for the "type" field.
+ public const int TypeFieldNumber = 3;
+ private int type_;
+ ///
+ /// 弹幕类型
+ /// 1:视频 2:漫画
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int Type {
+ get { return type_; }
+ set {
+ type_ = value;
+ }
+ }
+
+ /// Field number for the "segment_index" field.
+ public const int SegmentIndexFieldNumber = 4;
+ private long segmentIndex_;
+ ///
+ /// 分段(6min)
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long SegmentIndex {
+ get { return segmentIndex_; }
+ set {
+ segmentIndex_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as DmSegSDKReq);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(DmSegSDKReq other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Pid != other.Pid) return false;
+ if (Oid != other.Oid) return false;
+ if (Type != other.Type) return false;
+ if (SegmentIndex != other.SegmentIndex) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Pid != 0L) hash ^= Pid.GetHashCode();
+ if (Oid != 0L) hash ^= Oid.GetHashCode();
+ if (Type != 0) hash ^= Type.GetHashCode();
+ if (SegmentIndex != 0L) hash ^= SegmentIndex.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Pid != 0L) {
+ output.WriteRawTag(8);
+ output.WriteInt64(Pid);
+ }
+ if (Oid != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Oid);
+ }
+ if (Type != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(Type);
+ }
+ if (SegmentIndex != 0L) {
+ output.WriteRawTag(32);
+ output.WriteInt64(SegmentIndex);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Pid != 0L) {
+ output.WriteRawTag(8);
+ output.WriteInt64(Pid);
+ }
+ if (Oid != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Oid);
+ }
+ if (Type != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(Type);
+ }
+ if (SegmentIndex != 0L) {
+ output.WriteRawTag(32);
+ output.WriteInt64(SegmentIndex);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Pid != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Pid);
+ }
+ if (Oid != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Oid);
+ }
+ if (Type != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Type);
+ }
+ if (SegmentIndex != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(SegmentIndex);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(DmSegSDKReq other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Pid != 0L) {
+ Pid = other.Pid;
+ }
+ if (other.Oid != 0L) {
+ Oid = other.Oid;
+ }
+ if (other.Type != 0) {
+ Type = other.Type;
+ }
+ if (other.SegmentIndex != 0L) {
+ SegmentIndex = other.SegmentIndex;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Pid = input.ReadInt64();
+ break;
+ }
+ case 16: {
+ Oid = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ Type = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ SegmentIndex = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ Pid = input.ReadInt64();
+ break;
+ }
+ case 16: {
+ Oid = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ Type = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ SegmentIndex = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// 弹幕SDK-响应
+ ///
+ public sealed partial class DmSegSDKReply : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DmSegSDKReply());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Bilibili.Community.Service.Dm.V1.DmReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegSDKReply() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegSDKReply(DmSegSDKReply other) : this() {
+ closed_ = other.closed_;
+ elems_ = other.elems_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegSDKReply Clone() {
+ return new DmSegSDKReply(this);
+ }
+
+ /// Field number for the "closed" field.
+ public const int ClosedFieldNumber = 1;
+ private bool closed_;
+ ///
+ /// 是否已关闭弹幕
+ /// 0:未关闭 1:已关闭
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Closed {
+ get { return closed_; }
+ set {
+ closed_ = value;
+ }
+ }
+
+ /// Field number for the "elems" field.
+ public const int ElemsFieldNumber = 2;
+ private static readonly pb::FieldCodec _repeated_elems_codec
+ = pb::FieldCodec.ForMessage(18, global::Bilibili.Community.Service.Dm.V1.DanmakuElem.Parser);
+ private readonly pbc::RepeatedField elems_ = new pbc::RepeatedField();
+ ///
+ /// 弹幕列表
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public pbc::RepeatedField Elems {
+ get { return elems_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as DmSegSDKReply);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(DmSegSDKReply other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Closed != other.Closed) return false;
+ if(!elems_.Equals(other.elems_)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Closed != false) hash ^= Closed.GetHashCode();
+ hash ^= elems_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Closed != false) {
+ output.WriteRawTag(8);
+ output.WriteBool(Closed);
+ }
+ elems_.WriteTo(output, _repeated_elems_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Closed != false) {
+ output.WriteRawTag(8);
+ output.WriteBool(Closed);
+ }
+ elems_.WriteTo(ref output, _repeated_elems_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Closed != false) {
+ size += 1 + 1;
+ }
+ size += elems_.CalculateSize(_repeated_elems_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(DmSegSDKReply other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Closed != false) {
+ Closed = other.Closed;
+ }
+ elems_.Add(other.elems_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Closed = input.ReadBool();
+ break;
+ }
+ case 18: {
+ elems_.AddEntriesFrom(input, _repeated_elems_codec);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ Closed = input.ReadBool();
+ break;
+ }
+ case 18: {
+ elems_.AddEntriesFrom(ref input, _repeated_elems_codec);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// ott弹幕列表-请求
+ ///
+ public sealed partial class DmSegOttReq : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DmSegOttReq());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Bilibili.Community.Service.Dm.V1.DmReflection.Descriptor.MessageTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegOttReq() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegOttReq(DmSegOttReq other) : this() {
+ pid_ = other.pid_;
+ oid_ = other.oid_;
+ type_ = other.type_;
+ segmentIndex_ = other.segmentIndex_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegOttReq Clone() {
+ return new DmSegOttReq(this);
+ }
+
+ /// Field number for the "pid" field.
+ public const int PidFieldNumber = 1;
+ private long pid_;
+ ///
+ /// 稿件avid/漫画epid
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Pid {
+ get { return pid_; }
+ set {
+ pid_ = value;
+ }
+ }
+
+ /// Field number for the "oid" field.
+ public const int OidFieldNumber = 2;
+ private long oid_;
+ ///
+ /// 视频cid/漫画cid
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Oid {
+ get { return oid_; }
+ set {
+ oid_ = value;
+ }
+ }
+
+ /// Field number for the "type" field.
+ public const int TypeFieldNumber = 3;
+ private int type_;
+ ///
+ /// 弹幕类型
+ /// 1:视频 2:漫画
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int Type {
+ get { return type_; }
+ set {
+ type_ = value;
+ }
+ }
+
+ /// Field number for the "segment_index" field.
+ public const int SegmentIndexFieldNumber = 4;
+ private long segmentIndex_;
+ ///
+ /// 分段(6min)
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long SegmentIndex {
+ get { return segmentIndex_; }
+ set {
+ segmentIndex_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as DmSegOttReq);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(DmSegOttReq other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Pid != other.Pid) return false;
+ if (Oid != other.Oid) return false;
+ if (Type != other.Type) return false;
+ if (SegmentIndex != other.SegmentIndex) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Pid != 0L) hash ^= Pid.GetHashCode();
+ if (Oid != 0L) hash ^= Oid.GetHashCode();
+ if (Type != 0) hash ^= Type.GetHashCode();
+ if (SegmentIndex != 0L) hash ^= SegmentIndex.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Pid != 0L) {
+ output.WriteRawTag(8);
+ output.WriteInt64(Pid);
+ }
+ if (Oid != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Oid);
+ }
+ if (Type != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(Type);
+ }
+ if (SegmentIndex != 0L) {
+ output.WriteRawTag(32);
+ output.WriteInt64(SegmentIndex);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Pid != 0L) {
+ output.WriteRawTag(8);
+ output.WriteInt64(Pid);
+ }
+ if (Oid != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Oid);
+ }
+ if (Type != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(Type);
+ }
+ if (SegmentIndex != 0L) {
+ output.WriteRawTag(32);
+ output.WriteInt64(SegmentIndex);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Pid != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Pid);
+ }
+ if (Oid != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Oid);
+ }
+ if (Type != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Type);
+ }
+ if (SegmentIndex != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(SegmentIndex);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(DmSegOttReq other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Pid != 0L) {
+ Pid = other.Pid;
+ }
+ if (other.Oid != 0L) {
+ Oid = other.Oid;
+ }
+ if (other.Type != 0) {
+ Type = other.Type;
+ }
+ if (other.SegmentIndex != 0L) {
+ SegmentIndex = other.SegmentIndex;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Pid = input.ReadInt64();
+ break;
+ }
+ case 16: {
+ Oid = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ Type = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ SegmentIndex = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ Pid = input.ReadInt64();
+ break;
+ }
+ case 16: {
+ Oid = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ Type = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ SegmentIndex = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// ott弹幕列表-响应
+ ///
+ public sealed partial class DmSegOttReply : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DmSegOttReply());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Bilibili.Community.Service.Dm.V1.DmReflection.Descriptor.MessageTypes[3]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegOttReply() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegOttReply(DmSegOttReply other) : this() {
+ closed_ = other.closed_;
+ elems_ = other.elems_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegOttReply Clone() {
+ return new DmSegOttReply(this);
+ }
+
+ /// Field number for the "closed" field.
+ public const int ClosedFieldNumber = 1;
+ private bool closed_;
+ ///
+ /// 是否已关闭弹幕
+ /// 0:未关闭 1:已关闭
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Closed {
+ get { return closed_; }
+ set {
+ closed_ = value;
+ }
+ }
+
+ /// Field number for the "elems" field.
+ public const int ElemsFieldNumber = 2;
+ private static readonly pb::FieldCodec _repeated_elems_codec
+ = pb::FieldCodec.ForMessage(18, global::Bilibili.Community.Service.Dm.V1.DanmakuElem.Parser);
+ private readonly pbc::RepeatedField elems_ = new pbc::RepeatedField();
+ ///
+ /// 弹幕列表
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public pbc::RepeatedField Elems {
+ get { return elems_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as DmSegOttReply);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(DmSegOttReply other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Closed != other.Closed) return false;
+ if(!elems_.Equals(other.elems_)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Closed != false) hash ^= Closed.GetHashCode();
+ hash ^= elems_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Closed != false) {
+ output.WriteRawTag(8);
+ output.WriteBool(Closed);
+ }
+ elems_.WriteTo(output, _repeated_elems_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Closed != false) {
+ output.WriteRawTag(8);
+ output.WriteBool(Closed);
+ }
+ elems_.WriteTo(ref output, _repeated_elems_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Closed != false) {
+ size += 1 + 1;
+ }
+ size += elems_.CalculateSize(_repeated_elems_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(DmSegOttReply other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Closed != false) {
+ Closed = other.Closed;
+ }
+ elems_.Add(other.elems_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Closed = input.ReadBool();
+ break;
+ }
+ case 18: {
+ elems_.AddEntriesFrom(input, _repeated_elems_codec);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ Closed = input.ReadBool();
+ break;
+ }
+ case 18: {
+ elems_.AddEntriesFrom(ref input, _repeated_elems_codec);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// 获取弹幕-请求
+ ///
+ public sealed partial class DmSegMobileReq : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DmSegMobileReq());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Bilibili.Community.Service.Dm.V1.DmReflection.Descriptor.MessageTypes[4]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegMobileReq() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegMobileReq(DmSegMobileReq other) : this() {
+ pid_ = other.pid_;
+ oid_ = other.oid_;
+ type_ = other.type_;
+ segmentIndex_ = other.segmentIndex_;
+ teenagersMode_ = other.teenagersMode_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegMobileReq Clone() {
+ return new DmSegMobileReq(this);
+ }
+
+ /// Field number for the "pid" field.
+ public const int PidFieldNumber = 1;
+ private long pid_;
+ ///
+ /// 稿件avid/漫画epid
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Pid {
+ get { return pid_; }
+ set {
+ pid_ = value;
+ }
+ }
+
+ /// Field number for the "oid" field.
+ public const int OidFieldNumber = 2;
+ private long oid_;
+ ///
+ /// 视频cid/漫画cid
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Oid {
+ get { return oid_; }
+ set {
+ oid_ = value;
+ }
+ }
+
+ /// Field number for the "type" field.
+ public const int TypeFieldNumber = 3;
+ private int type_;
+ ///
+ /// 弹幕类型
+ /// 1:视频 2:漫画
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int Type {
+ get { return type_; }
+ set {
+ type_ = value;
+ }
+ }
+
+ /// Field number for the "segment_index" field.
+ public const int SegmentIndexFieldNumber = 4;
+ private long segmentIndex_;
+ ///
+ /// 分段(6min)
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long SegmentIndex {
+ get { return segmentIndex_; }
+ set {
+ segmentIndex_ = value;
+ }
+ }
+
+ /// Field number for the "teenagers_mode" field.
+ public const int TeenagersModeFieldNumber = 5;
+ private int teenagersMode_;
+ ///
+ /// 是否青少年模式
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int TeenagersMode {
+ get { return teenagersMode_; }
+ set {
+ teenagersMode_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as DmSegMobileReq);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(DmSegMobileReq other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Pid != other.Pid) return false;
+ if (Oid != other.Oid) return false;
+ if (Type != other.Type) return false;
+ if (SegmentIndex != other.SegmentIndex) return false;
+ if (TeenagersMode != other.TeenagersMode) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Pid != 0L) hash ^= Pid.GetHashCode();
+ if (Oid != 0L) hash ^= Oid.GetHashCode();
+ if (Type != 0) hash ^= Type.GetHashCode();
+ if (SegmentIndex != 0L) hash ^= SegmentIndex.GetHashCode();
+ if (TeenagersMode != 0) hash ^= TeenagersMode.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Pid != 0L) {
+ output.WriteRawTag(8);
+ output.WriteInt64(Pid);
+ }
+ if (Oid != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Oid);
+ }
+ if (Type != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(Type);
+ }
+ if (SegmentIndex != 0L) {
+ output.WriteRawTag(32);
+ output.WriteInt64(SegmentIndex);
+ }
+ if (TeenagersMode != 0) {
+ output.WriteRawTag(40);
+ output.WriteInt32(TeenagersMode);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Pid != 0L) {
+ output.WriteRawTag(8);
+ output.WriteInt64(Pid);
+ }
+ if (Oid != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Oid);
+ }
+ if (Type != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(Type);
+ }
+ if (SegmentIndex != 0L) {
+ output.WriteRawTag(32);
+ output.WriteInt64(SegmentIndex);
+ }
+ if (TeenagersMode != 0) {
+ output.WriteRawTag(40);
+ output.WriteInt32(TeenagersMode);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Pid != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Pid);
+ }
+ if (Oid != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Oid);
+ }
+ if (Type != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Type);
+ }
+ if (SegmentIndex != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(SegmentIndex);
+ }
+ if (TeenagersMode != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(TeenagersMode);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(DmSegMobileReq other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Pid != 0L) {
+ Pid = other.Pid;
+ }
+ if (other.Oid != 0L) {
+ Oid = other.Oid;
+ }
+ if (other.Type != 0) {
+ Type = other.Type;
+ }
+ if (other.SegmentIndex != 0L) {
+ SegmentIndex = other.SegmentIndex;
+ }
+ if (other.TeenagersMode != 0) {
+ TeenagersMode = other.TeenagersMode;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Pid = input.ReadInt64();
+ break;
+ }
+ case 16: {
+ Oid = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ Type = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ SegmentIndex = input.ReadInt64();
+ break;
+ }
+ case 40: {
+ TeenagersMode = input.ReadInt32();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ Pid = input.ReadInt64();
+ break;
+ }
+ case 16: {
+ Oid = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ Type = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ SegmentIndex = input.ReadInt64();
+ break;
+ }
+ case 40: {
+ TeenagersMode = input.ReadInt32();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// 获取弹幕-响应
+ ///
+ public sealed partial class DmSegMobileReply : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DmSegMobileReply());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Bilibili.Community.Service.Dm.V1.DmReflection.Descriptor.MessageTypes[5]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegMobileReply() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegMobileReply(DmSegMobileReply other) : this() {
+ elems_ = other.elems_.Clone();
+ state_ = other.state_;
+ aiFlag_ = other.aiFlag_ != null ? other.aiFlag_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmSegMobileReply Clone() {
+ return new DmSegMobileReply(this);
+ }
+
+ /// Field number for the "elems" field.
+ public const int ElemsFieldNumber = 1;
+ private static readonly pb::FieldCodec _repeated_elems_codec
+ = pb::FieldCodec.ForMessage(10, global::Bilibili.Community.Service.Dm.V1.DanmakuElem.Parser);
+ private readonly pbc::RepeatedField elems_ = new pbc::RepeatedField();
+ ///
+ /// 弹幕列表
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public pbc::RepeatedField Elems {
+ get { return elems_; }
+ }
+
+ /// Field number for the "state" field.
+ public const int StateFieldNumber = 2;
+ private int state_;
+ ///
+ /// 是否已关闭弹幕
+ /// 0:未关闭 1:已关闭
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int State {
+ get { return state_; }
+ set {
+ state_ = value;
+ }
+ }
+
+ /// Field number for the "ai_flag" field.
+ public const int AiFlagFieldNumber = 3;
+ private global::Bilibili.Community.Service.Dm.V1.DanmakuAIFlag aiFlag_;
+ ///
+ /// 弹幕云屏蔽ai评分值
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Bilibili.Community.Service.Dm.V1.DanmakuAIFlag AiFlag {
+ get { return aiFlag_; }
+ set {
+ aiFlag_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as DmSegMobileReply);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(DmSegMobileReply other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if(!elems_.Equals(other.elems_)) return false;
+ if (State != other.State) return false;
+ if (!object.Equals(AiFlag, other.AiFlag)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ hash ^= elems_.GetHashCode();
+ if (State != 0) hash ^= State.GetHashCode();
+ if (aiFlag_ != null) hash ^= AiFlag.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ elems_.WriteTo(output, _repeated_elems_codec);
+ if (State != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(State);
+ }
+ if (aiFlag_ != null) {
+ output.WriteRawTag(26);
+ output.WriteMessage(AiFlag);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ elems_.WriteTo(ref output, _repeated_elems_codec);
+ if (State != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(State);
+ }
+ if (aiFlag_ != null) {
+ output.WriteRawTag(26);
+ output.WriteMessage(AiFlag);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ size += elems_.CalculateSize(_repeated_elems_codec);
+ if (State != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(State);
+ }
+ if (aiFlag_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(AiFlag);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(DmSegMobileReply other) {
+ if (other == null) {
+ return;
+ }
+ elems_.Add(other.elems_);
+ if (other.State != 0) {
+ State = other.State;
+ }
+ if (other.aiFlag_ != null) {
+ if (aiFlag_ == null) {
+ AiFlag = new global::Bilibili.Community.Service.Dm.V1.DanmakuAIFlag();
+ }
+ AiFlag.MergeFrom(other.AiFlag);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ elems_.AddEntriesFrom(input, _repeated_elems_codec);
+ break;
+ }
+ case 16: {
+ State = input.ReadInt32();
+ break;
+ }
+ case 26: {
+ if (aiFlag_ == null) {
+ AiFlag = new global::Bilibili.Community.Service.Dm.V1.DanmakuAIFlag();
+ }
+ input.ReadMessage(AiFlag);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ elems_.AddEntriesFrom(ref input, _repeated_elems_codec);
+ break;
+ }
+ case 16: {
+ State = input.ReadInt32();
+ break;
+ }
+ case 26: {
+ if (aiFlag_ == null) {
+ AiFlag = new global::Bilibili.Community.Service.Dm.V1.DanmakuAIFlag();
+ }
+ input.ReadMessage(AiFlag);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// 客户端弹幕元数据-请求
+ ///
+ public sealed partial class DmViewReq : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DmViewReq());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Bilibili.Community.Service.Dm.V1.DmReflection.Descriptor.MessageTypes[6]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmViewReq() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmViewReq(DmViewReq other) : this() {
+ pid_ = other.pid_;
+ oid_ = other.oid_;
+ type_ = other.type_;
+ spmid_ = other.spmid_;
+ isHardBoot_ = other.isHardBoot_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmViewReq Clone() {
+ return new DmViewReq(this);
+ }
+
+ /// Field number for the "pid" field.
+ public const int PidFieldNumber = 1;
+ private long pid_;
+ ///
+ /// 稿件avid/漫画epid
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Pid {
+ get { return pid_; }
+ set {
+ pid_ = value;
+ }
+ }
+
+ /// Field number for the "oid" field.
+ public const int OidFieldNumber = 2;
+ private long oid_;
+ ///
+ /// 视频cid/漫画cid
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Oid {
+ get { return oid_; }
+ set {
+ oid_ = value;
+ }
+ }
+
+ /// Field number for the "type" field.
+ public const int TypeFieldNumber = 3;
+ private int type_;
+ ///
+ /// 弹幕类型
+ /// 1:视频 2:漫画
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int Type {
+ get { return type_; }
+ set {
+ type_ = value;
+ }
+ }
+
+ /// Field number for the "spmid" field.
+ public const int SpmidFieldNumber = 4;
+ private string spmid_ = "";
+ ///
+ /// 页面spm
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string Spmid {
+ get { return spmid_; }
+ set {
+ spmid_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "is_hard_boot" field.
+ public const int IsHardBootFieldNumber = 5;
+ private int isHardBoot_;
+ ///
+ /// 是否冷启
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int IsHardBoot {
+ get { return isHardBoot_; }
+ set {
+ isHardBoot_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as DmViewReq);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(DmViewReq other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Pid != other.Pid) return false;
+ if (Oid != other.Oid) return false;
+ if (Type != other.Type) return false;
+ if (Spmid != other.Spmid) return false;
+ if (IsHardBoot != other.IsHardBoot) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Pid != 0L) hash ^= Pid.GetHashCode();
+ if (Oid != 0L) hash ^= Oid.GetHashCode();
+ if (Type != 0) hash ^= Type.GetHashCode();
+ if (Spmid.Length != 0) hash ^= Spmid.GetHashCode();
+ if (IsHardBoot != 0) hash ^= IsHardBoot.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Pid != 0L) {
+ output.WriteRawTag(8);
+ output.WriteInt64(Pid);
+ }
+ if (Oid != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Oid);
+ }
+ if (Type != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(Type);
+ }
+ if (Spmid.Length != 0) {
+ output.WriteRawTag(34);
+ output.WriteString(Spmid);
+ }
+ if (IsHardBoot != 0) {
+ output.WriteRawTag(40);
+ output.WriteInt32(IsHardBoot);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Pid != 0L) {
+ output.WriteRawTag(8);
+ output.WriteInt64(Pid);
+ }
+ if (Oid != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Oid);
+ }
+ if (Type != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(Type);
+ }
+ if (Spmid.Length != 0) {
+ output.WriteRawTag(34);
+ output.WriteString(Spmid);
+ }
+ if (IsHardBoot != 0) {
+ output.WriteRawTag(40);
+ output.WriteInt32(IsHardBoot);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Pid != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Pid);
+ }
+ if (Oid != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Oid);
+ }
+ if (Type != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Type);
+ }
+ if (Spmid.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Spmid);
+ }
+ if (IsHardBoot != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(IsHardBoot);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(DmViewReq other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Pid != 0L) {
+ Pid = other.Pid;
+ }
+ if (other.Oid != 0L) {
+ Oid = other.Oid;
+ }
+ if (other.Type != 0) {
+ Type = other.Type;
+ }
+ if (other.Spmid.Length != 0) {
+ Spmid = other.Spmid;
+ }
+ if (other.IsHardBoot != 0) {
+ IsHardBoot = other.IsHardBoot;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Pid = input.ReadInt64();
+ break;
+ }
+ case 16: {
+ Oid = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ Type = input.ReadInt32();
+ break;
+ }
+ case 34: {
+ Spmid = input.ReadString();
+ break;
+ }
+ case 40: {
+ IsHardBoot = input.ReadInt32();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ Pid = input.ReadInt64();
+ break;
+ }
+ case 16: {
+ Oid = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ Type = input.ReadInt32();
+ break;
+ }
+ case 34: {
+ Spmid = input.ReadString();
+ break;
+ }
+ case 40: {
+ IsHardBoot = input.ReadInt32();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// 客户端弹幕元数据-响应
+ ///
+ public sealed partial class DmViewReply : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DmViewReply());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Bilibili.Community.Service.Dm.V1.DmReflection.Descriptor.MessageTypes[7]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmViewReply() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmViewReply(DmViewReply other) : this() {
+ closed_ = other.closed_;
+ mask_ = other.mask_ != null ? other.mask_.Clone() : null;
+ subtitle_ = other.subtitle_ != null ? other.subtitle_.Clone() : null;
+ specialDms_ = other.specialDms_.Clone();
+ aiFlag_ = other.aiFlag_ != null ? other.aiFlag_.Clone() : null;
+ playerConfig_ = other.playerConfig_ != null ? other.playerConfig_.Clone() : null;
+ sendBoxStyle_ = other.sendBoxStyle_;
+ allow_ = other.allow_;
+ checkBox_ = other.checkBox_;
+ checkBoxShowMsg_ = other.checkBoxShowMsg_;
+ textPlaceholder_ = other.textPlaceholder_;
+ inputPlaceholder_ = other.inputPlaceholder_;
+ reportFilterContent_ = other.reportFilterContent_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmViewReply Clone() {
+ return new DmViewReply(this);
+ }
+
+ /// Field number for the "closed" field.
+ public const int ClosedFieldNumber = 1;
+ private bool closed_;
+ ///
+ /// 是否已关闭弹幕
+ /// 0:未关闭 1:已关闭
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Closed {
+ get { return closed_; }
+ set {
+ closed_ = value;
+ }
+ }
+
+ /// Field number for the "mask" field.
+ public const int MaskFieldNumber = 2;
+ private global::Bilibili.Community.Service.Dm.V1.VideoMask mask_;
+ ///
+ /// 智能防挡弹幕蒙版信息
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Bilibili.Community.Service.Dm.V1.VideoMask Mask {
+ get { return mask_; }
+ set {
+ mask_ = value;
+ }
+ }
+
+ /// Field number for the "subtitle" field.
+ public const int SubtitleFieldNumber = 3;
+ private global::Bilibili.Community.Service.Dm.V1.VideoSubtitle subtitle_;
+ ///
+ /// 视频字幕
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Bilibili.Community.Service.Dm.V1.VideoSubtitle Subtitle {
+ get { return subtitle_; }
+ set {
+ subtitle_ = value;
+ }
+ }
+
+ /// Field number for the "special_dms" field.
+ public const int SpecialDmsFieldNumber = 4;
+ private static readonly pb::FieldCodec _repeated_specialDms_codec
+ = pb::FieldCodec.ForString(34);
+ private readonly pbc::RepeatedField specialDms_ = new pbc::RepeatedField();
+ ///
+ /// 高级弹幕专包url(bfs)
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public pbc::RepeatedField SpecialDms {
+ get { return specialDms_; }
+ }
+
+ /// Field number for the "ai_flag" field.
+ public const int AiFlagFieldNumber = 5;
+ private global::Bilibili.Community.Service.Dm.V1.DanmakuFlagConfig aiFlag_;
+ ///
+ /// 云屏蔽配置信息
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Bilibili.Community.Service.Dm.V1.DanmakuFlagConfig AiFlag {
+ get { return aiFlag_; }
+ set {
+ aiFlag_ = value;
+ }
+ }
+
+ /// Field number for the "player_config" field.
+ public const int PlayerConfigFieldNumber = 6;
+ private global::Bilibili.Community.Service.Dm.V1.DanmuPlayerViewConfig playerConfig_;
+ ///
+ /// 弹幕配置信息
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Bilibili.Community.Service.Dm.V1.DanmuPlayerViewConfig PlayerConfig {
+ get { return playerConfig_; }
+ set {
+ playerConfig_ = value;
+ }
+ }
+
+ /// Field number for the "send_box_style" field.
+ public const int SendBoxStyleFieldNumber = 7;
+ private int sendBoxStyle_;
+ ///
+ /// 弹幕发送框样式
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int SendBoxStyle {
+ get { return sendBoxStyle_; }
+ set {
+ sendBoxStyle_ = value;
+ }
+ }
+
+ /// Field number for the "allow" field.
+ public const int AllowFieldNumber = 8;
+ private bool allow_;
+ ///
+ /// 是否允许
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Allow {
+ get { return allow_; }
+ set {
+ allow_ = value;
+ }
+ }
+
+ /// Field number for the "check_box" field.
+ public const int CheckBoxFieldNumber = 9;
+ private string checkBox_ = "";
+ ///
+ /// check box 是否展示
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string CheckBox {
+ get { return checkBox_; }
+ set {
+ checkBox_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "check_box_show_msg" field.
+ public const int CheckBoxShowMsgFieldNumber = 10;
+ private string checkBoxShowMsg_ = "";
+ ///
+ /// check box 展示文本
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string CheckBoxShowMsg {
+ get { return checkBoxShowMsg_; }
+ set {
+ checkBoxShowMsg_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "text_placeholder" field.
+ public const int TextPlaceholderFieldNumber = 11;
+ private string textPlaceholder_ = "";
+ ///
+ /// 展示文案
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string TextPlaceholder {
+ get { return textPlaceholder_; }
+ set {
+ textPlaceholder_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "input_placeholder" field.
+ public const int InputPlaceholderFieldNumber = 12;
+ private string inputPlaceholder_ = "";
+ ///
+ /// 弹幕输入框文案
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string InputPlaceholder {
+ get { return inputPlaceholder_; }
+ set {
+ inputPlaceholder_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "report_filter_content" field.
+ public const int ReportFilterContentFieldNumber = 13;
+ private static readonly pb::FieldCodec _repeated_reportFilterContent_codec
+ = pb::FieldCodec.ForString(106);
+ private readonly pbc::RepeatedField reportFilterContent_ = new pbc::RepeatedField();
+ ///
+ /// 用户举报弹幕 cid维度屏蔽的正则规则
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public pbc::RepeatedField ReportFilterContent {
+ get { return reportFilterContent_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as DmViewReply);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(DmViewReply other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Closed != other.Closed) return false;
+ if (!object.Equals(Mask, other.Mask)) return false;
+ if (!object.Equals(Subtitle, other.Subtitle)) return false;
+ if(!specialDms_.Equals(other.specialDms_)) return false;
+ if (!object.Equals(AiFlag, other.AiFlag)) return false;
+ if (!object.Equals(PlayerConfig, other.PlayerConfig)) return false;
+ if (SendBoxStyle != other.SendBoxStyle) return false;
+ if (Allow != other.Allow) return false;
+ if (CheckBox != other.CheckBox) return false;
+ if (CheckBoxShowMsg != other.CheckBoxShowMsg) return false;
+ if (TextPlaceholder != other.TextPlaceholder) return false;
+ if (InputPlaceholder != other.InputPlaceholder) return false;
+ if(!reportFilterContent_.Equals(other.reportFilterContent_)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Closed != false) hash ^= Closed.GetHashCode();
+ if (mask_ != null) hash ^= Mask.GetHashCode();
+ if (subtitle_ != null) hash ^= Subtitle.GetHashCode();
+ hash ^= specialDms_.GetHashCode();
+ if (aiFlag_ != null) hash ^= AiFlag.GetHashCode();
+ if (playerConfig_ != null) hash ^= PlayerConfig.GetHashCode();
+ if (SendBoxStyle != 0) hash ^= SendBoxStyle.GetHashCode();
+ if (Allow != false) hash ^= Allow.GetHashCode();
+ if (CheckBox.Length != 0) hash ^= CheckBox.GetHashCode();
+ if (CheckBoxShowMsg.Length != 0) hash ^= CheckBoxShowMsg.GetHashCode();
+ if (TextPlaceholder.Length != 0) hash ^= TextPlaceholder.GetHashCode();
+ if (InputPlaceholder.Length != 0) hash ^= InputPlaceholder.GetHashCode();
+ hash ^= reportFilterContent_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Closed != false) {
+ output.WriteRawTag(8);
+ output.WriteBool(Closed);
+ }
+ if (mask_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(Mask);
+ }
+ if (subtitle_ != null) {
+ output.WriteRawTag(26);
+ output.WriteMessage(Subtitle);
+ }
+ specialDms_.WriteTo(output, _repeated_specialDms_codec);
+ if (aiFlag_ != null) {
+ output.WriteRawTag(42);
+ output.WriteMessage(AiFlag);
+ }
+ if (playerConfig_ != null) {
+ output.WriteRawTag(50);
+ output.WriteMessage(PlayerConfig);
+ }
+ if (SendBoxStyle != 0) {
+ output.WriteRawTag(56);
+ output.WriteInt32(SendBoxStyle);
+ }
+ if (Allow != false) {
+ output.WriteRawTag(64);
+ output.WriteBool(Allow);
+ }
+ if (CheckBox.Length != 0) {
+ output.WriteRawTag(74);
+ output.WriteString(CheckBox);
+ }
+ if (CheckBoxShowMsg.Length != 0) {
+ output.WriteRawTag(82);
+ output.WriteString(CheckBoxShowMsg);
+ }
+ if (TextPlaceholder.Length != 0) {
+ output.WriteRawTag(90);
+ output.WriteString(TextPlaceholder);
+ }
+ if (InputPlaceholder.Length != 0) {
+ output.WriteRawTag(98);
+ output.WriteString(InputPlaceholder);
+ }
+ reportFilterContent_.WriteTo(output, _repeated_reportFilterContent_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Closed != false) {
+ output.WriteRawTag(8);
+ output.WriteBool(Closed);
+ }
+ if (mask_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(Mask);
+ }
+ if (subtitle_ != null) {
+ output.WriteRawTag(26);
+ output.WriteMessage(Subtitle);
+ }
+ specialDms_.WriteTo(ref output, _repeated_specialDms_codec);
+ if (aiFlag_ != null) {
+ output.WriteRawTag(42);
+ output.WriteMessage(AiFlag);
+ }
+ if (playerConfig_ != null) {
+ output.WriteRawTag(50);
+ output.WriteMessage(PlayerConfig);
+ }
+ if (SendBoxStyle != 0) {
+ output.WriteRawTag(56);
+ output.WriteInt32(SendBoxStyle);
+ }
+ if (Allow != false) {
+ output.WriteRawTag(64);
+ output.WriteBool(Allow);
+ }
+ if (CheckBox.Length != 0) {
+ output.WriteRawTag(74);
+ output.WriteString(CheckBox);
+ }
+ if (CheckBoxShowMsg.Length != 0) {
+ output.WriteRawTag(82);
+ output.WriteString(CheckBoxShowMsg);
+ }
+ if (TextPlaceholder.Length != 0) {
+ output.WriteRawTag(90);
+ output.WriteString(TextPlaceholder);
+ }
+ if (InputPlaceholder.Length != 0) {
+ output.WriteRawTag(98);
+ output.WriteString(InputPlaceholder);
+ }
+ reportFilterContent_.WriteTo(ref output, _repeated_reportFilterContent_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Closed != false) {
+ size += 1 + 1;
+ }
+ if (mask_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Mask);
+ }
+ if (subtitle_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Subtitle);
+ }
+ size += specialDms_.CalculateSize(_repeated_specialDms_codec);
+ if (aiFlag_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(AiFlag);
+ }
+ if (playerConfig_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(PlayerConfig);
+ }
+ if (SendBoxStyle != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(SendBoxStyle);
+ }
+ if (Allow != false) {
+ size += 1 + 1;
+ }
+ if (CheckBox.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(CheckBox);
+ }
+ if (CheckBoxShowMsg.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(CheckBoxShowMsg);
+ }
+ if (TextPlaceholder.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(TextPlaceholder);
+ }
+ if (InputPlaceholder.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(InputPlaceholder);
+ }
+ size += reportFilterContent_.CalculateSize(_repeated_reportFilterContent_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(DmViewReply other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Closed != false) {
+ Closed = other.Closed;
+ }
+ if (other.mask_ != null) {
+ if (mask_ == null) {
+ Mask = new global::Bilibili.Community.Service.Dm.V1.VideoMask();
+ }
+ Mask.MergeFrom(other.Mask);
+ }
+ if (other.subtitle_ != null) {
+ if (subtitle_ == null) {
+ Subtitle = new global::Bilibili.Community.Service.Dm.V1.VideoSubtitle();
+ }
+ Subtitle.MergeFrom(other.Subtitle);
+ }
+ specialDms_.Add(other.specialDms_);
+ if (other.aiFlag_ != null) {
+ if (aiFlag_ == null) {
+ AiFlag = new global::Bilibili.Community.Service.Dm.V1.DanmakuFlagConfig();
+ }
+ AiFlag.MergeFrom(other.AiFlag);
+ }
+ if (other.playerConfig_ != null) {
+ if (playerConfig_ == null) {
+ PlayerConfig = new global::Bilibili.Community.Service.Dm.V1.DanmuPlayerViewConfig();
+ }
+ PlayerConfig.MergeFrom(other.PlayerConfig);
+ }
+ if (other.SendBoxStyle != 0) {
+ SendBoxStyle = other.SendBoxStyle;
+ }
+ if (other.Allow != false) {
+ Allow = other.Allow;
+ }
+ if (other.CheckBox.Length != 0) {
+ CheckBox = other.CheckBox;
+ }
+ if (other.CheckBoxShowMsg.Length != 0) {
+ CheckBoxShowMsg = other.CheckBoxShowMsg;
+ }
+ if (other.TextPlaceholder.Length != 0) {
+ TextPlaceholder = other.TextPlaceholder;
+ }
+ if (other.InputPlaceholder.Length != 0) {
+ InputPlaceholder = other.InputPlaceholder;
+ }
+ reportFilterContent_.Add(other.reportFilterContent_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Closed = input.ReadBool();
+ break;
+ }
+ case 18: {
+ if (mask_ == null) {
+ Mask = new global::Bilibili.Community.Service.Dm.V1.VideoMask();
+ }
+ input.ReadMessage(Mask);
+ break;
+ }
+ case 26: {
+ if (subtitle_ == null) {
+ Subtitle = new global::Bilibili.Community.Service.Dm.V1.VideoSubtitle();
+ }
+ input.ReadMessage(Subtitle);
+ break;
+ }
+ case 34: {
+ specialDms_.AddEntriesFrom(input, _repeated_specialDms_codec);
+ break;
+ }
+ case 42: {
+ if (aiFlag_ == null) {
+ AiFlag = new global::Bilibili.Community.Service.Dm.V1.DanmakuFlagConfig();
+ }
+ input.ReadMessage(AiFlag);
+ break;
+ }
+ case 50: {
+ if (playerConfig_ == null) {
+ PlayerConfig = new global::Bilibili.Community.Service.Dm.V1.DanmuPlayerViewConfig();
+ }
+ input.ReadMessage(PlayerConfig);
+ break;
+ }
+ case 56: {
+ SendBoxStyle = input.ReadInt32();
+ break;
+ }
+ case 64: {
+ Allow = input.ReadBool();
+ break;
+ }
+ case 74: {
+ CheckBox = input.ReadString();
+ break;
+ }
+ case 82: {
+ CheckBoxShowMsg = input.ReadString();
+ break;
+ }
+ case 90: {
+ TextPlaceholder = input.ReadString();
+ break;
+ }
+ case 98: {
+ InputPlaceholder = input.ReadString();
+ break;
+ }
+ case 106: {
+ reportFilterContent_.AddEntriesFrom(input, _repeated_reportFilterContent_codec);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ Closed = input.ReadBool();
+ break;
+ }
+ case 18: {
+ if (mask_ == null) {
+ Mask = new global::Bilibili.Community.Service.Dm.V1.VideoMask();
+ }
+ input.ReadMessage(Mask);
+ break;
+ }
+ case 26: {
+ if (subtitle_ == null) {
+ Subtitle = new global::Bilibili.Community.Service.Dm.V1.VideoSubtitle();
+ }
+ input.ReadMessage(Subtitle);
+ break;
+ }
+ case 34: {
+ specialDms_.AddEntriesFrom(ref input, _repeated_specialDms_codec);
+ break;
+ }
+ case 42: {
+ if (aiFlag_ == null) {
+ AiFlag = new global::Bilibili.Community.Service.Dm.V1.DanmakuFlagConfig();
+ }
+ input.ReadMessage(AiFlag);
+ break;
+ }
+ case 50: {
+ if (playerConfig_ == null) {
+ PlayerConfig = new global::Bilibili.Community.Service.Dm.V1.DanmuPlayerViewConfig();
+ }
+ input.ReadMessage(PlayerConfig);
+ break;
+ }
+ case 56: {
+ SendBoxStyle = input.ReadInt32();
+ break;
+ }
+ case 64: {
+ Allow = input.ReadBool();
+ break;
+ }
+ case 74: {
+ CheckBox = input.ReadString();
+ break;
+ }
+ case 82: {
+ CheckBoxShowMsg = input.ReadString();
+ break;
+ }
+ case 90: {
+ TextPlaceholder = input.ReadString();
+ break;
+ }
+ case 98: {
+ InputPlaceholder = input.ReadString();
+ break;
+ }
+ case 106: {
+ reportFilterContent_.AddEntriesFrom(ref input, _repeated_reportFilterContent_codec);
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// web端弹幕元数据-响应
+ ///
+ public sealed partial class DmWebViewReply : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DmWebViewReply());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Bilibili.Community.Service.Dm.V1.DmReflection.Descriptor.MessageTypes[8]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmWebViewReply() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmWebViewReply(DmWebViewReply other) : this() {
+ state_ = other.state_;
+ text_ = other.text_;
+ textSide_ = other.textSide_;
+ dmSge_ = other.dmSge_ != null ? other.dmSge_.Clone() : null;
+ flag_ = other.flag_ != null ? other.flag_.Clone() : null;
+ specialDms_ = other.specialDms_.Clone();
+ checkBox_ = other.checkBox_;
+ count_ = other.count_;
+ commandDms_ = other.commandDms_.Clone();
+ playerConfig_ = other.playerConfig_ != null ? other.playerConfig_.Clone() : null;
+ reportFilterContent_ = other.reportFilterContent_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public DmWebViewReply Clone() {
+ return new DmWebViewReply(this);
+ }
+
+ /// Field number for the "state" field.
+ public const int StateFieldNumber = 1;
+ private int state_;
+ ///
+ /// 是否已关闭弹幕
+ /// 0:未关闭 1:已关闭
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int State {
+ get { return state_; }
+ set {
+ state_ = value;
+ }
+ }
+
+ /// Field number for the "text" field.
+ public const int TextFieldNumber = 2;
+ private string text_ = "";
+ ///
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string Text {
+ get { return text_; }
+ set {
+ text_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "text_side" field.
+ public const int TextSideFieldNumber = 3;
+ private string textSide_ = "";
+ ///
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string TextSide {
+ get { return textSide_; }
+ set {
+ textSide_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "dm_sge" field.
+ public const int DmSgeFieldNumber = 4;
+ private global::Bilibili.Community.Service.Dm.V1.DmSegConfig dmSge_;
+ ///
+ /// 分段弹幕配置
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Bilibili.Community.Service.Dm.V1.DmSegConfig DmSge {
+ get { return dmSge_; }
+ set {
+ dmSge_ = value;
+ }
+ }
+
+ /// Field number for the "flag" field.
+ public const int FlagFieldNumber = 5;
+ private global::Bilibili.Community.Service.Dm.V1.DanmakuFlagConfig flag_;
+ ///
+ /// 云屏蔽配置信息
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Bilibili.Community.Service.Dm.V1.DanmakuFlagConfig Flag {
+ get { return flag_; }
+ set {
+ flag_ = value;
+ }
+ }
+
+ /// Field number for the "special_dms" field.
+ public const int SpecialDmsFieldNumber = 6;
+ private static readonly pb::FieldCodec _repeated_specialDms_codec
+ = pb::FieldCodec.ForString(50);
+ private readonly pbc::RepeatedField specialDms_ = new pbc::RepeatedField();
+ ///