mirror of
https://github.com/leiurayer/downkyi.git
synced 2025-01-14 05:40:19 +08:00
v1.3.6
This commit is contained in:
parent
4b305230a4
commit
975b2a1969
@ -1,5 +1,14 @@
|
||||
# 更新日志
|
||||
|
||||
* `2021/03/04` v1.3.6
|
||||
1. [修复] 下载FLV时失败的问题。
|
||||
2. [修复] 主页的登录信息更新不及时的问题。
|
||||
3. [优化] 主页下方按钮居中。
|
||||
4. [优化] 首页搜索框添加搜索按钮,点击可进行搜索。
|
||||
5. [新增] 监听剪贴板。
|
||||
6. [新增] 已下载视频列表排序。
|
||||
7. [新增] 下载管理页面增加全部暂停、全部开始、全部删除。
|
||||
|
||||
* `2021/02/21` v1.3.5
|
||||
1. [修复] 分P标题相同时会下载失败的问题。
|
||||
2. [修复] 个人空间中的头像可能显示不全的问题。
|
||||
|
22
README.md
22
README.md
@ -38,7 +38,8 @@
|
||||
|
||||
哔哩下载姬支持多种复制于浏览器或APP的网址格式,在程序主页输入并按回车键即可开始检索。
|
||||
|
||||
- 检索只获取视频的基本信息,视频下载链接需点击解析(v1.3.5)。
|
||||
- 检索只获取视频的基本信息,视频下载链接需点击解析。(v1.3.5)
|
||||
- 监听剪贴板,复制即可开始检索。(v1.3.6)
|
||||
- 视频详情页中,先选中视频再下载,如果该视频已经在下载队列或者已下载列表中,则不会被添加。
|
||||
- 用户收藏夹、订阅、稍后再看、历史记录中,点击下载后,会默认下载选中视频的所有分P。
|
||||
|
||||
@ -59,17 +60,14 @@
|
||||
|
||||
[全部更新日志](https://github.com/FlySelfLog/downkyi/blob/main/CHANGELOG.md)
|
||||
|
||||
* `2021/02/21` v1.3.5
|
||||
1. [修复] 分P标题相同时会下载失败的问题。
|
||||
2. [修复] 个人空间中的头像可能显示不全的问题。
|
||||
3. [优化] 订阅页面采用分页显示。
|
||||
4. [优化] 增强程序健壮性。
|
||||
5. [优化] 部分界面UI。
|
||||
6. [优化] 视频详情页获取视频后不自动解析下载链接。
|
||||
7. [新增] 视频详情页“自动解析”选项,“解析视频”按钮,列表右键菜单“解析”。
|
||||
8. [新增] 视频详情页支持输入av号和BV号。
|
||||
9. [新增] 视频详情页的UP主头像增加进入用户空间的入口。
|
||||
10. [新增] 历史记录和稍后再看的up主头像增加进入用户空间的入口。
|
||||
* `2021/03/04` v1.3.6
|
||||
1. [修复] 下载FLV时失败的问题。
|
||||
2. [修复] 主页的登录信息更新不及时的问题。
|
||||
3. [优化] 主页下方按钮居中。
|
||||
4. [优化] 首页搜索框添加搜索按钮,点击可进行搜索。
|
||||
5. [新增] 监听剪贴板。
|
||||
6. [新增] 已下载视频列表排序。
|
||||
7. [新增] 下载管理页面增加全部暂停、全部开始、全部删除。
|
||||
|
||||
## 下载
|
||||
|
||||
|
90
src/Core/api/history/History.cs
Normal file
90
src/Core/api/history/History.cs
Normal file
@ -0,0 +1,90 @@
|
||||
using Core.entity2.history;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Core.api.history
|
||||
{
|
||||
/// <summary>
|
||||
/// 历史记录
|
||||
/// </summary>
|
||||
public class History
|
||||
{
|
||||
private static History instance;
|
||||
|
||||
/// <summary>
|
||||
/// 获取UserInfo实例
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static History GetInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new History();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// History()方法,必须使用单例模式
|
||||
/// </summary>
|
||||
private History() { }
|
||||
|
||||
/// <summary>
|
||||
/// 获取历史记录列表(视频、直播、专栏)
|
||||
/// startId和startTime必须同时使用才有效,分别对应结果中的max和view_at,默认为0
|
||||
/// </summary>
|
||||
/// <param name="startId">历史记录开始目标ID</param>
|
||||
/// <param name="startTime">历史记录开始时间</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <param name="business">历史记录ID类型</param>
|
||||
/// <returns></returns>
|
||||
public 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 = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var history = JsonConvert.DeserializeObject<HistoryOrigin>(response);
|
||||
if (history == null || history.Data == null) { return null; }
|
||||
return history.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetHistory()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum HistoryBusiness
|
||||
{
|
||||
ARCHIVE = 1, // 稿件
|
||||
PGC, // 番剧(影视)
|
||||
LIVE, // 直播
|
||||
ARTICLE_LIST, // 文集
|
||||
ARTICLE, // 文章
|
||||
}
|
||||
|
||||
}
|
58
src/Core/api/history/ToView.cs
Normal file
58
src/Core/api/history/ToView.cs
Normal file
@ -0,0 +1,58 @@
|
||||
using Core.entity2.history;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.api.history
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取稍后再看列表
|
||||
/// </summary>
|
||||
public class ToView
|
||||
{
|
||||
private static ToView instance;
|
||||
|
||||
/// <summary>
|
||||
/// 获取ToView实例
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ToView GetInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new ToView();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏ToView()方法,必须使用单例模式
|
||||
/// </summary>
|
||||
private ToView() { }
|
||||
|
||||
/// <summary>
|
||||
/// 获取稍后再看视频列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ToViewDataList> GetHistoryToView()
|
||||
{
|
||||
string url = "https://api.bilibili.com/x/v2/history/toview/web";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var toView = JsonConvert.DeserializeObject<ToViewOrigin>(response);
|
||||
if (toView == null || toView.Data == null) { return null; }
|
||||
return toView.Data.List;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetHistoryToView()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
58
src/Core/api/login/LoginInfo.cs
Normal file
58
src/Core/api/login/LoginInfo.cs
Normal file
@ -0,0 +1,58 @@
|
||||
using Core.entity2.login;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Core.api.login
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录基本信息
|
||||
/// </summary>
|
||||
public class LoginInfo
|
||||
{
|
||||
private static LoginInfo instance;
|
||||
|
||||
/// <summary>
|
||||
/// 获取UserInfo实例
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static LoginInfo GetInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new LoginInfo();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏LoginInfo()方法,必须使用单例模式
|
||||
/// </summary>
|
||||
private LoginInfo() { }
|
||||
|
||||
/// <summary>
|
||||
/// 导航栏用户信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public UserInfoForNavigation GetUserInfoForNavigation()
|
||||
{
|
||||
string url = "https://api.bilibili.com/x/web-interface/nav";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var userInfo = JsonConvert.DeserializeObject<UserInfoForNavigationOrigin>(response);
|
||||
if (userInfo == null || userInfo.Data == null) { return null; }
|
||||
|
||||
if (userInfo.Data.IsLogin) { return userInfo.Data; }
|
||||
else { return null; }
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetUserInfoForNavigation()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
81
src/Core/api/users/UserInfo.cs
Normal file
81
src/Core/api/users/UserInfo.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using Core.entity2.users;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Core.api.users
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户基本信息
|
||||
/// </summary>
|
||||
public class UserInfo
|
||||
{
|
||||
private static UserInfo instance;
|
||||
|
||||
/// <summary>
|
||||
/// 获取UserInfo实例
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static UserInfo GetInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new UserInfo();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏UserInfo()方法,必须使用单例模式
|
||||
/// </summary>
|
||||
private UserInfo() { }
|
||||
|
||||
/// <summary>
|
||||
/// 用户详细信息1 (用于空间)
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <returns></returns>
|
||||
public SpaceInfo GetInfoForSpace(long mid)
|
||||
{
|
||||
string url = $"https://api.bilibili.com/x/space/acc/info?mid={mid}";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var spaceInfo = JsonConvert.DeserializeObject<SpaceInfoOrigin>(response);
|
||||
if (spaceInfo == null || spaceInfo.Data == null) { return null; }
|
||||
return spaceInfo.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetInfoForSpace()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 本用户详细信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public MyInfo GetMyInfo()
|
||||
{
|
||||
string url = "https://api.bilibili.com/x/space/myinfo";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var myInfo = JsonConvert.DeserializeObject<MyInfoOrigin>(response);
|
||||
if (myInfo == null || myInfo.Data == null) { return null; }
|
||||
return myInfo.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetMyInfo()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
290
src/Core/api/users/UserRelation.cs
Normal file
290
src/Core/api/users/UserRelation.cs
Normal file
@ -0,0 +1,290 @@
|
||||
using Core.entity2.users;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.api.users
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户关系相关
|
||||
/// </summary>
|
||||
public class UserRelation
|
||||
{
|
||||
private static UserRelation instance;
|
||||
|
||||
/// <summary>
|
||||
/// 获取UserRelation实例
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static UserRelation GetInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new UserRelation();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏UserRelation()方法,必须使用单例模式
|
||||
/// </summary>
|
||||
private UserRelation() { }
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户粉丝明细
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <param name="pn">页码</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <returns></returns>
|
||||
public 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 = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var relationFollower = JsonConvert.DeserializeObject<RelationFollowOrigin>(response);
|
||||
if (relationFollower == null || relationFollower.Data == null) { return null; }
|
||||
return relationFollower.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetFollowers()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户所有的粉丝明细
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <returns></returns>
|
||||
public List<RelationFollowInfo> GetAllFollowers(long mid)
|
||||
{
|
||||
List<RelationFollowInfo> result = new List<RelationFollowInfo>();
|
||||
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
i++;
|
||||
int ps = 50;
|
||||
|
||||
var data = GetFollowers(mid, i, ps);
|
||||
//if (data == null) { continue; }
|
||||
|
||||
if (data == null || data.List == null || data.List.Count == 0)
|
||||
{ break; }
|
||||
|
||||
result.AddRange(data.List);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户关注明细
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <param name="pn">页码</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <param name="order">排序方式</param>
|
||||
/// <returns></returns>
|
||||
public 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 = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var relationFollower = JsonConvert.DeserializeObject<RelationFollowOrigin>(response);
|
||||
if (relationFollower == null || relationFollower.Data == null) { return null; }
|
||||
return relationFollower.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetFollowings()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户所有的关注明细
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <param name="order">排序方式</param>
|
||||
/// <returns></returns>
|
||||
public List<RelationFollowInfo> GetAllFollowings(long mid, FollowingOrder order = FollowingOrder.DEFAULT)
|
||||
{
|
||||
List<RelationFollowInfo> result = new List<RelationFollowInfo>();
|
||||
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
i++;
|
||||
int ps = 50;
|
||||
|
||||
var data = GetFollowings(mid, i, ps, order);
|
||||
//if (data == null) { continue; }
|
||||
|
||||
if (data == null || data.List == null || data.List.Count == 0)
|
||||
{ break; }
|
||||
|
||||
result.AddRange(data.List);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询悄悄关注明细
|
||||
/// </summary>
|
||||
/// <param name="pn">页码</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <returns></returns>
|
||||
public List<RelationWhisper> 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 = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var relationWhisper = JsonConvert.DeserializeObject<RelationWhisperOrigin>(response);
|
||||
if (relationWhisper == null || relationWhisper.Data == null) { return null; }
|
||||
return relationWhisper.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetWhispers()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询黑名单明细
|
||||
/// </summary>
|
||||
/// <param name="pn">页码</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <returns></returns>
|
||||
public List<RelationBlack> 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 = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var relationBlack = JsonConvert.DeserializeObject<RelationBlackOrigin>(response);
|
||||
if (relationBlack == null || relationBlack.Data == null) { return null; }
|
||||
return relationBlack.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetBlacks()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// 关注分组相关,只能查询当前登录账户的信息
|
||||
|
||||
/// <summary>
|
||||
/// 查询关注分组列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<FollowingGroup> GetFollowingGroup()
|
||||
{
|
||||
string url = $"https://api.bilibili.com/x/relation/tags";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var followingGroup = JsonConvert.DeserializeObject<FollowingGroupOrigin>(response);
|
||||
if (followingGroup == null || followingGroup.Data == null) { return null; }
|
||||
return followingGroup.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetFollowingGroup()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询关注分组明细
|
||||
/// </summary>
|
||||
/// <param name="tagId">分组ID</param>
|
||||
/// <param name="pn">页数</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <param name="order">排序方式</param>
|
||||
/// <returns></returns>
|
||||
public List<FollowingGroupContent> GetFollowingGroupContent(int 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 = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var content = JsonConvert.DeserializeObject<FollowingGroupContentOrigin>(response);
|
||||
if (content == null || content.Data == null) { return null; }
|
||||
return content.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetFollowingGroupContent()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询所有的关注分组明细
|
||||
/// </summary>
|
||||
/// <param name="tagId">分组ID</param>
|
||||
/// <param name="order">排序方式</param>
|
||||
/// <returns></returns>
|
||||
public List<FollowingGroupContent> GetAllFollowingGroupContent(int tagId, FollowingOrder order = FollowingOrder.DEFAULT)
|
||||
{
|
||||
List<FollowingGroupContent> result = new List<FollowingGroupContent>();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum FollowingOrder
|
||||
{
|
||||
DEFAULT = 1, // 按照关注顺序排列,默认
|
||||
ATTENTION // 按照最常访问排列
|
||||
}
|
||||
|
||||
}
|
502
src/Core/api/users/UserSpace.cs
Normal file
502
src/Core/api/users/UserSpace.cs
Normal file
@ -0,0 +1,502 @@
|
||||
using Core.entity2.users;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.api.users
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户空间信息
|
||||
/// </summary>
|
||||
public class UserSpace
|
||||
{
|
||||
private static UserSpace instance;
|
||||
|
||||
/// <summary>
|
||||
/// 获取UserSpace实例
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static UserSpace GetInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new UserSpace();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏UserSpace()方法,必须使用单例模式
|
||||
/// </summary>
|
||||
private UserSpace() { }
|
||||
|
||||
/// <summary>
|
||||
/// 查询空间设置
|
||||
/// </summary>
|
||||
/// <param name="mid"></param>
|
||||
/// <returns></returns>
|
||||
public SpaceSettings GetSpaceSettings(long mid)
|
||||
{
|
||||
string url = $"https://space.bilibili.com/ajax/settings/getSettings?mid={mid}";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var settings = JsonConvert.DeserializeObject<SpaceSettingsOrigin>(response);
|
||||
if (settings == null || settings.Data == null || !settings.Status) { return null; }
|
||||
|
||||
return settings.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetSpaceSettings()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户投稿视频的所有分区
|
||||
/// </summary>
|
||||
/// <param name="mid">用户id</param>
|
||||
/// <returns></returns>
|
||||
public List<SpacePublicationListTypeVideoZone> GetPublicationType(long mid)
|
||||
{
|
||||
int pn = 1;
|
||||
int ps = 1;
|
||||
var publication = GetPublication(mid, pn, ps);
|
||||
return GetPublicationType(publication);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户投稿视频的所有分区
|
||||
/// </summary>
|
||||
/// <param name="mid">用户id</param>
|
||||
/// <returns></returns>
|
||||
public List<SpacePublicationListTypeVideoZone> GetPublicationType(SpacePublicationList publication)
|
||||
{
|
||||
if (publication == null || publication.Tlist == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<SpacePublicationListTypeVideoZone> result = new List<SpacePublicationListTypeVideoZone>();
|
||||
JObject typeList = JObject.Parse(publication.Tlist.ToString("N"));
|
||||
foreach (var item in typeList)
|
||||
{
|
||||
var value = JsonConvert.DeserializeObject<SpacePublicationListTypeVideoZone>(item.Value.ToString());
|
||||
result.Add(value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户所有的投稿视频明细
|
||||
/// </summary>
|
||||
/// <param name="mid">用户id</param>
|
||||
/// <param name="order">排序</param>
|
||||
/// <param name="tid">视频分区</param>
|
||||
/// <param name="keyword">搜索关键词</param>
|
||||
/// <returns></returns>
|
||||
public List<SpacePublicationListVideo> GetAllPublication(long mid, PublicationOrder order = PublicationOrder.PUBDATE, int tid = 0, string keyword = "")
|
||||
{
|
||||
List<SpacePublicationListVideo> result = new List<SpacePublicationListVideo>();
|
||||
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
i++;
|
||||
int ps = 100;
|
||||
|
||||
var data = GetPublication(mid, i, ps, tid, order, keyword);
|
||||
//if (data == null) { continue; }
|
||||
|
||||
if (data == null || data.Vlist == null || data.Vlist.Count == 0)
|
||||
{ break; }
|
||||
|
||||
result.AddRange(data.Vlist);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户投稿视频明细
|
||||
/// </summary>
|
||||
/// <param name="mid">用户id</param>
|
||||
/// <param name="pn">页码</param>
|
||||
/// <param name="ps">每页的视频数</param>
|
||||
/// <param name="order">排序</param>
|
||||
/// <param name="tid">视频分区</param>
|
||||
/// <param name="keyword">搜索关键词</param>
|
||||
/// <returns></returns>
|
||||
public SpacePublicationList GetPublication(long mid, int pn, int ps, int tid = 0, PublicationOrder order = PublicationOrder.PUBDATE, string keyword = "")
|
||||
{
|
||||
string url = $"https://api.bilibili.com/x/space/arc/search?mid={mid}&pn={pn}&ps={ps}&order={order.ToString("G").ToLower()}&tid={tid}&keyword={keyword}";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var spacePublication = JsonConvert.DeserializeObject<SpacePublicationOrigin>(response);
|
||||
if (spacePublication == null || spacePublication.Data == null) { return null; }
|
||||
return spacePublication.Data.List;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetPublication()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户频道列表
|
||||
/// </summary>
|
||||
/// <param name="mid">用户id</param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceChannelList> GetChannelList(long mid)
|
||||
{
|
||||
string url = $"https://api.bilibili.com/x/space/channel/list?mid={mid}";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var spaceChannel = JsonConvert.DeserializeObject<SpaceChannelOrigin>(response);
|
||||
if (spaceChannel == null || spaceChannel.Data == null) { return null; }
|
||||
return spaceChannel.Data.List;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetChannelList()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户频道中的所有视频
|
||||
/// </summary>
|
||||
/// <param name="mid"></param>
|
||||
/// <param name="cid"></param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceChannelVideoArchive> GetAllChannelVideoList(long mid, long cid)
|
||||
{
|
||||
List<SpaceChannelVideoArchive> result = new List<SpaceChannelVideoArchive>();
|
||||
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
i++;
|
||||
int ps = 100;
|
||||
|
||||
var data = GetChannelVideoList(mid, cid, i, ps);
|
||||
if (data == null || data.Count == 0)
|
||||
{ break; }
|
||||
|
||||
result.AddRange(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户频道中的视频
|
||||
/// </summary>
|
||||
/// <param name="mid"></param>
|
||||
/// <param name="cid"></param>
|
||||
/// <param name="pn"></param>
|
||||
/// <param name="ps"></param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceChannelVideoArchive> 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 = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var spaceChannelVideo = JsonConvert.DeserializeObject<SpaceChannelVideoOrigin>(response);
|
||||
if (spaceChannelVideo == null || spaceChannelVideo.Data == null || spaceChannelVideo.Data.List == null)
|
||||
{ return null; }
|
||||
return spaceChannelVideo.Data.List.Archives;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetChannelVideoList()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户创建的视频收藏夹
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <param name="pn">页码</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceFavoriteFolderList> GetCreatedFavoriteFolder(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 = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var favoriteFolder = JsonConvert.DeserializeObject<SpaceFavoriteFolderOrigin>(response);
|
||||
if (favoriteFolder == null || favoriteFolder.Data == null || favoriteFolder.Data.List == null)
|
||||
{ return null; }
|
||||
return favoriteFolder.Data.List;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetCreatedFavoriteFolder()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询所有的用户创建的视频收藏夹
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceFavoriteFolderList> GetAllCreatedFavoriteFolder(long mid)
|
||||
{
|
||||
List<SpaceFavoriteFolderList> result = new List<SpaceFavoriteFolderList>();
|
||||
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
i++;
|
||||
int ps = 50;
|
||||
|
||||
var data = GetCreatedFavoriteFolder(mid, i, ps);
|
||||
if (data == null || data.Count == 0)
|
||||
{ break; }
|
||||
|
||||
result.AddRange(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户收藏的视频收藏夹
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <param name="pn">页码</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceFavoriteFolderList> GetCollectedFavoriteFolder(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 = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var favoriteFolder = JsonConvert.DeserializeObject<SpaceFavoriteFolderOrigin>(response);
|
||||
if (favoriteFolder == null || favoriteFolder.Data == null || favoriteFolder.Data.List == null)
|
||||
{ return null; }
|
||||
return favoriteFolder.Data.List;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetCollectedFavoriteFolder()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询所有的用户收藏的视频收藏夹
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceFavoriteFolderList> GetAllCollectedFavoriteFolder(long mid)
|
||||
{
|
||||
List<SpaceFavoriteFolderList> result = new List<SpaceFavoriteFolderList>();
|
||||
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
i++;
|
||||
int ps = 50;
|
||||
|
||||
var data = GetCollectedFavoriteFolder(mid, i, ps);
|
||||
if (data == null || data.Count == 0)
|
||||
{ break; }
|
||||
|
||||
result.AddRange(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询视频收藏夹的内容
|
||||
/// </summary>
|
||||
/// <param name="mediaId">收藏夹ID</param>
|
||||
/// <param name="pn">页码</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceFavoriteFolderMedia> GetFavoriteFolderResource(long mediaId, int pn, int ps)
|
||||
{
|
||||
string url = $"https://api.bilibili.com/x/v3/fav/resource/list?media_id={mediaId}&pn={pn}&ps={ps}";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var resource = JsonConvert.DeserializeObject<SpaceFavoriteFolderResourceOrigin>(response);
|
||||
if (resource == null || resource.Data == null || resource.Data.Medias == null)
|
||||
{ return null; }
|
||||
return resource.Data.Medias;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetFavoriteFolderResource()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询视频收藏夹的所有内容
|
||||
/// </summary>
|
||||
/// <param name="mediaId">收藏夹ID</param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceFavoriteFolderMedia> GetAllFavoriteFolderResource(long mediaId)
|
||||
{
|
||||
List<SpaceFavoriteFolderMedia> result = new List<SpaceFavoriteFolderMedia>();
|
||||
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
i++;
|
||||
int ps = 20;
|
||||
|
||||
var data = GetFavoriteFolderResource(mediaId, i, ps);
|
||||
if (data == null || data.Count == 0)
|
||||
{ break; }
|
||||
|
||||
result.AddRange(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户发布的课程列表
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <param name="pn">页码</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceCheese> 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 = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var cheese = JsonConvert.DeserializeObject<SpaceCheeseOrigin>(response);
|
||||
if (cheese == null || cheese.Data == null || cheese.Data.Items == null)
|
||||
{ return null; }
|
||||
return cheese.Data.Items;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetCheese()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户发布的所有课程列表
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <returns></returns>
|
||||
public List<SpaceCheese> GetAllCheese(long mid)
|
||||
{
|
||||
List<SpaceCheese> result = new List<SpaceCheese>();
|
||||
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
i++;
|
||||
int ps = 50;
|
||||
|
||||
var data = GetCheese(mid, i, ps);
|
||||
if (data == null || data.Count == 0)
|
||||
{ break; }
|
||||
|
||||
result.AddRange(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户追番(追剧)明细
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <param name="type">查询类型</param>
|
||||
/// <param name="pn">页码</param>
|
||||
/// <param name="ps">每页项数</param>
|
||||
/// <returns></returns>
|
||||
public 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.ToString("D")}&pn={pn}&ps={ps}";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var bangumiFollow = JsonConvert.DeserializeObject<BangumiFollowOrigin>(response);
|
||||
if (bangumiFollow == null || bangumiFollow.Data == null)
|
||||
{ return null; }
|
||||
return bangumiFollow.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetBangumiFollow()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户所有的追番(追剧)明细
|
||||
/// </summary>
|
||||
/// <param name="mid">目标用户UID</param>
|
||||
/// <param name="type">查询类型</param>
|
||||
/// <returns></returns>
|
||||
public List<BangumiFollow> GetAllBangumiFollow(long mid, BangumiType type)
|
||||
{
|
||||
List<BangumiFollow> result = new List<BangumiFollow>();
|
||||
|
||||
int i = 0;
|
||||
while (true)
|
||||
{
|
||||
i++;
|
||||
int ps = 30;
|
||||
|
||||
var data = GetBangumiFollow(mid, type, i, ps);
|
||||
if (data == null || data.List == null || data.List.Count == 0)
|
||||
{ break; }
|
||||
|
||||
result.AddRange(data.List);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public enum PublicationOrder
|
||||
{
|
||||
PUBDATE = 1, // 最新发布,默认
|
||||
CLICK, // 最多播放
|
||||
STOW // 最多收藏
|
||||
}
|
||||
|
||||
public enum BangumiType
|
||||
{
|
||||
ANIME = 1, // 番剧
|
||||
EPISODE = 2 // 剧集、电影
|
||||
}
|
||||
|
||||
}
|
83
src/Core/api/users/UserStatus.cs
Normal file
83
src/Core/api/users/UserStatus.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using Core.entity2.users;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
namespace Core.api.users
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户状态数
|
||||
/// </summary>
|
||||
public class UserStatus
|
||||
{
|
||||
private static UserStatus instance;
|
||||
|
||||
/// <summary>
|
||||
/// 获取UserStatus实例
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static UserStatus GetInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new UserStatus();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏UserStatus()方法,必须使用单例模式
|
||||
/// </summary>
|
||||
private UserStatus() { }
|
||||
|
||||
/// <summary>
|
||||
/// 关系状态数
|
||||
/// </summary>
|
||||
/// <param name="mid"></param>
|
||||
/// <returns></returns>
|
||||
public UserRelationStat GetUserRelationStat(long mid)
|
||||
{
|
||||
string url = $"https://api.bilibili.com/x/relation/stat?vmid={mid}";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var userRelationStat = JsonConvert.DeserializeObject<UserRelationStatOrigin>(response);
|
||||
if (userRelationStat == null || userRelationStat.Data == null) { return null; }
|
||||
return userRelationStat.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetUserRelationStat()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UP主状态数
|
||||
///
|
||||
/// 注:该接口需要任意用户登录,否则不会返回任何数据
|
||||
/// </summary>
|
||||
/// <param name="mid"></param>
|
||||
/// <returns></returns>
|
||||
public UpStat GetUpStat(long mid)
|
||||
{
|
||||
string url = $"https://api.bilibili.com/x/space/upstat?mid={mid}";
|
||||
string referer = "https://www.bilibili.com";
|
||||
string response = Utils.RequestWeb(url, referer);
|
||||
|
||||
try
|
||||
{
|
||||
var upStat = JsonConvert.DeserializeObject<UpStatOrigin>(response);
|
||||
if (upStat == null || upStat.Data == null) { return null; }
|
||||
return upStat.Data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("GetUpStat()发生异常: {0}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
63
src/Core/api/utils/BvId.cs
Normal file
63
src/Core/api/utils/BvId.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using System;
|
||||
|
||||
namespace Core.api.utils
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// bvid转avid
|
||||
/// </summary>
|
||||
/// <param name="bvid"></param>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// avid转bvid
|
||||
/// </summary>
|
||||
/// <param name="av"></param>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
149
src/Core/api/utils/DanmakuSender.cs
Normal file
149
src/Core/api/utils/DanmakuSender.cs
Normal file
@ -0,0 +1,149 @@
|
||||
using System;
|
||||
|
||||
namespace Core.api.utils
|
||||
{
|
||||
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]}";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
30
src/Core/entity2/BaseEntity.cs
Normal file
30
src/Core/entity2/BaseEntity.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Core.entity2
|
||||
{
|
||||
public abstract class BaseEntity
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
101
src/Core/entity2/history/History.cs
Normal file
101
src/Core/entity2/history/History.cs
Normal file
@ -0,0 +1,101 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.history
|
||||
{
|
||||
// https://api.bilibili.com/x/web-interface/history/cursor?max={startId}&view_at={startTime}&ps={ps}&business={businessStr}
|
||||
[JsonObject]
|
||||
public class HistoryOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public HistoryData Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class HistoryData : BaseEntity
|
||||
{
|
||||
[JsonProperty("cursor")]
|
||||
public HistoryDataCursor Cursor { get; set; }
|
||||
[JsonProperty("list")]
|
||||
public List<HistoryDataList> List { get; set; }
|
||||
//public List<HistoryDataTab> tab { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class HistoryDataCursor : BaseEntity
|
||||
{
|
||||
[JsonProperty("business")]
|
||||
public string Business { get; set; }
|
||||
[JsonProperty("max")]
|
||||
public long Max { get; set; }
|
||||
[JsonProperty("ps")]
|
||||
public int Ps { get; set; }
|
||||
[JsonProperty("view_at")]
|
||||
public long ViewAt { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class HistoryDataList : BaseEntity
|
||||
{
|
||||
[JsonProperty("author_face")]
|
||||
public string AuthorFace { get; set; }
|
||||
[JsonProperty("author_mid")]
|
||||
public long AuthorMid { get; set; }
|
||||
[JsonProperty("author_name")]
|
||||
public string AuthorName { get; set; }
|
||||
// ...
|
||||
[JsonProperty("cover")]
|
||||
public string Cover { get; set; }
|
||||
// ...
|
||||
[JsonProperty("duration")]
|
||||
public long Duration { get; set; }
|
||||
[JsonProperty("history")]
|
||||
public HistoryDataListHistory History { get; set; }
|
||||
// ...
|
||||
[JsonProperty("new_desc")]
|
||||
public string NewDesc { get; set; }
|
||||
[JsonProperty("progress")]
|
||||
public long Progress { get; set; }
|
||||
[JsonProperty("show_title")]
|
||||
public string ShowTitle { get; set; }
|
||||
[JsonProperty("tag_name")]
|
||||
public string TagName { get; set; }
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
// ...
|
||||
[JsonProperty("uri")]
|
||||
public string Uri { get; set; }
|
||||
[JsonProperty("videos")]
|
||||
public int Videos { get; set; }
|
||||
[JsonProperty("view_at")]
|
||||
public long ViewAt { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class HistoryDataListHistory : BaseEntity
|
||||
{
|
||||
[JsonProperty("business")]
|
||||
public string Business { get; set; }
|
||||
[JsonProperty("bvid")]
|
||||
public string Bvid { get; set; }
|
||||
[JsonProperty("cid")]
|
||||
public long Cid { get; set; }
|
||||
[JsonProperty("dt")]
|
||||
public int Dt { get; set; }
|
||||
[JsonProperty("epid")]
|
||||
public long Epid { get; set; }
|
||||
[JsonProperty("oid")]
|
||||
public long Oid { get; set; }
|
||||
[JsonProperty("page")]
|
||||
public int Page { get; set; }
|
||||
[JsonProperty("part")]
|
||||
public string Part { get; set; }
|
||||
}
|
||||
|
||||
}
|
60
src/Core/entity2/history/ToView.cs
Normal file
60
src/Core/entity2/history/ToView.cs
Normal file
@ -0,0 +1,60 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.history
|
||||
{
|
||||
// https://api.bilibili.com/x/v2/history/toview/web
|
||||
[JsonObject]
|
||||
public class ToViewOrigin : BaseEntity
|
||||
{
|
||||
//public int code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public ToViewData Data { get; set; }
|
||||
//public string message { get; set; }
|
||||
//public int ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class ToViewData : BaseEntity
|
||||
{
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
[JsonProperty("list")]
|
||||
public List<ToViewDataList> List { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class ToViewDataList : BaseEntity
|
||||
{
|
||||
[JsonProperty("add_at")]
|
||||
public long AddAt { get; set; }
|
||||
[JsonProperty("aid")]
|
||||
public long Aid { get; set; }
|
||||
//public long attribute { get; set; }
|
||||
[JsonProperty("bvid")]
|
||||
public string Bvid { get; set; }
|
||||
[JsonProperty("cid")]
|
||||
public long Cid { get; set; }
|
||||
// ...
|
||||
[JsonProperty("owner")]
|
||||
public ToViewDataListOwner Owner { get; set; }
|
||||
// ...
|
||||
[JsonProperty("pic")]
|
||||
public string Cover { get; set; }
|
||||
// ...
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class ToViewDataListOwner : BaseEntity
|
||||
{
|
||||
[JsonProperty("face")]
|
||||
public string Face { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
}
|
108
src/Core/entity2/login/UserInfoForNavigation.cs
Normal file
108
src/Core/entity2/login/UserInfoForNavigation.cs
Normal file
@ -0,0 +1,108 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Core.entity2.login
|
||||
{
|
||||
// https://api.bilibili.com/x/web-interface/nav
|
||||
[JsonObject]
|
||||
public class UserInfoForNavigationOrigin : BaseEntity
|
||||
{
|
||||
//[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 : BaseEntity
|
||||
{
|
||||
//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; }
|
||||
}
|
||||
|
||||
//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 : BaseEntity
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
|
||||
}
|
103
src/Core/entity2/users/BangumiFollow.cs
Normal file
103
src/Core/entity2/users/BangumiFollow.cs
Normal file
@ -0,0 +1,103 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/space/bangumi/follow/list?vmid={mid}&type={type}&pn={pn}&ps={ps}
|
||||
[JsonObject]
|
||||
public class BangumiFollowOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public BangumiFollowData Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class BangumiFollowData : BaseEntity
|
||||
{
|
||||
[JsonProperty("list")]
|
||||
public List<BangumiFollow> List { get; set; }
|
||||
[JsonProperty("pn")]
|
||||
public int Pn { get; set; }
|
||||
[JsonProperty("ps")]
|
||||
public int Ps { get; set; }
|
||||
[JsonProperty("total")]
|
||||
public int Total { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class BangumiFollow : BaseEntity
|
||||
{
|
||||
[JsonProperty("areas")]
|
||||
public List<BangumiFollowAreas> Areas { get; set; }
|
||||
[JsonProperty("badge")]
|
||||
public string Badge { get; set; }
|
||||
[JsonProperty("badge_ep")]
|
||||
public string BadgeEp { get; set; }
|
||||
// ...
|
||||
[JsonProperty("cover")]
|
||||
public string Cover { get; set; }
|
||||
[JsonProperty("evaluate")]
|
||||
public string Evaluate { get; set; }
|
||||
// ...
|
||||
[JsonProperty("media_id")]
|
||||
public long MediaId { get; set; }
|
||||
// ...
|
||||
[JsonProperty("new_ep")]
|
||||
public BangumiFollowNewEp NewEp { get; set; }
|
||||
[JsonProperty("progress")]
|
||||
public string Progress { get; set; }
|
||||
// ...
|
||||
[JsonProperty("season_id")]
|
||||
public long SeasonId { get; set; }
|
||||
[JsonProperty("season_status")]
|
||||
public int SeasonStatus { get; set; }
|
||||
[JsonProperty("season_title")]
|
||||
public string SeasonTitle { 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("total_count")]
|
||||
public int TotalCount { get; set; }
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class BangumiFollowAreas : BaseEntity
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class BangumiFollowNewEp : BaseEntity
|
||||
{
|
||||
[JsonProperty("cover")]
|
||||
public string Cover { get; set; }
|
||||
[JsonProperty("duration")]
|
||||
public long Duration { get; set; }
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; }
|
||||
[JsonProperty("index_show")]
|
||||
public string IndexShow { get; set; }
|
||||
[JsonProperty("long_title")]
|
||||
public string LongTitle { get; set; }
|
||||
[JsonProperty("pub_time")]
|
||||
public string PubTime { get; set; }
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
}
|
||||
|
||||
}
|
33
src/Core/entity2/users/FollowingGroup.cs
Normal file
33
src/Core/entity2/users/FollowingGroup.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/relation/tags
|
||||
[JsonObject]
|
||||
public class FollowingGroupOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public List<FollowingGroup> Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class FollowingGroup : BaseEntity
|
||||
{
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("tagid")]
|
||||
public int TagId { get; set; }
|
||||
[JsonProperty("tip")]
|
||||
public string Tip { get; set; }
|
||||
}
|
||||
|
||||
}
|
42
src/Core/entity2/users/FollowingGroupContent.cs
Normal file
42
src/Core/entity2/users/FollowingGroupContent.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/relation/tag?tagid={tagId}&pn={pn}&ps={ps}&order_type={orderType}
|
||||
[JsonObject]
|
||||
public class FollowingGroupContentOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public List<FollowingGroupContent> Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class FollowingGroupContent : BaseEntity
|
||||
{
|
||||
[JsonProperty("attribute")]
|
||||
public int Attribute { get; set; }
|
||||
// ...
|
||||
[JsonProperty("face")]
|
||||
public string Face { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
// ...
|
||||
[JsonProperty("sign")]
|
||||
public string Sign { get; set; }
|
||||
[JsonProperty("special")]
|
||||
public int Special { get; set; }
|
||||
[JsonProperty("tag")]
|
||||
public List<long> Tag { get; set; }
|
||||
[JsonProperty("uname")]
|
||||
public string Name { get; set; }
|
||||
// ...
|
||||
}
|
||||
|
||||
}
|
166
src/Core/entity2/users/MyInfo.cs
Normal file
166
src/Core/entity2/users/MyInfo.cs
Normal file
@ -0,0 +1,166 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/space/myinfo
|
||||
[JsonObject]
|
||||
public class MyInfoOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public MyInfo Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class MyInfo : BaseEntity
|
||||
{
|
||||
[JsonProperty("birthday")]
|
||||
public long Birthday { get; set; }
|
||||
[JsonProperty("coins")]
|
||||
public float Coins { get; set; }
|
||||
[JsonProperty("email_status")]
|
||||
public int EmailStatus { get; set; }
|
||||
[JsonProperty("face")]
|
||||
public string Face { get; set; }
|
||||
[JsonProperty("follower")]
|
||||
public int Follower { get; set; }
|
||||
[JsonProperty("following")]
|
||||
public int Following { get; set; }
|
||||
[JsonProperty("identification")]
|
||||
public int Identification { get; set; }
|
||||
[JsonProperty("is_deleted")]
|
||||
public int IsDeleted { get; set; }
|
||||
[JsonProperty("is_fake_account")]
|
||||
public int IsFakeAccount { get; set; }
|
||||
[JsonProperty("is_tourist")]
|
||||
public int IsTourist { get; set; }
|
||||
[JsonProperty("jointime")]
|
||||
public int Jointime { get; set; }
|
||||
[JsonProperty("level")]
|
||||
public int Level { get; set; }
|
||||
[JsonProperty("level_exp")]
|
||||
public MyInfoLevelExp LevelExp { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("moral")]
|
||||
public int Moral { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("nameplate")]
|
||||
public MyInfoNamePlate Nameplate { get; set; }
|
||||
[JsonProperty("official")]
|
||||
public MyInfoOfficial Official { get; set; }
|
||||
[JsonProperty("pendant")]
|
||||
public MyInfoPendant Pendant { get; set; }
|
||||
[JsonProperty("pin_prompting")]
|
||||
public int PinPrompting { get; set; }
|
||||
[JsonProperty("rank")]
|
||||
public int Rank { get; set; }
|
||||
[JsonProperty("sex")]
|
||||
public string Sex { get; set; }
|
||||
[JsonProperty("sign")]
|
||||
public string Sign { get; set; }
|
||||
[JsonProperty("silence")]
|
||||
public int Silence { get; set; }
|
||||
[JsonProperty("tel_status")]
|
||||
public int TelStatus { get; set; }
|
||||
[JsonProperty("vip")]
|
||||
public MyInfoVip Vip { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class MyInfoLevelExp : BaseEntity
|
||||
{
|
||||
[JsonProperty("current_exp")]
|
||||
public int CurrentExp { get; set; }
|
||||
[JsonProperty("current_level")]
|
||||
public int CurrentLevel { get; set; }
|
||||
[JsonProperty("current_min")]
|
||||
public int CurrentMin { get; set; }
|
||||
[JsonProperty("next_exp")]
|
||||
public int NextExp { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class MyInfoNamePlate : BaseEntity
|
||||
{
|
||||
[JsonProperty("condition")]
|
||||
public string Condition { get; set; }
|
||||
[JsonProperty("image")]
|
||||
public string Image { get; set; }
|
||||
[JsonProperty("image_small")]
|
||||
public string ImageSmall { get; set; }
|
||||
[JsonProperty("level")]
|
||||
public string Level { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("nid")]
|
||||
public int Nid { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class MyInfoOfficial : BaseEntity
|
||||
{
|
||||
[JsonProperty("desc")]
|
||||
public string Desc { get; set; }
|
||||
[JsonProperty("role")]
|
||||
public int Role { get; set; }
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public int Type { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class MyInfoPendant : BaseEntity
|
||||
{
|
||||
[JsonProperty("expire")]
|
||||
public int Expire { get; set; }
|
||||
[JsonProperty("image")]
|
||||
public string Image { get; set; }
|
||||
[JsonProperty("image_enhance")]
|
||||
public string ImageEnhance { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("pid")]
|
||||
public int Pid { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class MyInfoVip : BaseEntity
|
||||
{
|
||||
[JsonProperty("avatar_subscript")]
|
||||
public int AvatarSubscript { get; set; }
|
||||
[JsonProperty("due_date")]
|
||||
public long DueDate { get; set; }
|
||||
[JsonProperty("label")]
|
||||
public MyInfoDataVipLabel Label { get; set; }
|
||||
[JsonProperty("nickname_color")]
|
||||
public string NicknameColor { get; set; }
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
[JsonProperty("theme_type")]
|
||||
public int ThemeType { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public int Type { get; set; }
|
||||
[JsonProperty("vip_pay_type")]
|
||||
public int VipPayType { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class MyInfoDataVipLabel : BaseEntity
|
||||
{
|
||||
[JsonProperty("label_theme")]
|
||||
public string LabelTheme { get; set; }
|
||||
[JsonProperty("path")]
|
||||
public string Path { get; set; }
|
||||
[JsonProperty("text")]
|
||||
public string Text { get; set; }
|
||||
}
|
||||
|
||||
}
|
43
src/Core/entity2/users/RelationBlacks.cs
Normal file
43
src/Core/entity2/users/RelationBlacks.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/relation/blacks?pn={pn}&ps={ps}
|
||||
[JsonObject]
|
||||
public class RelationBlackOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public List<RelationBlack> Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
public class RelationBlack : BaseEntity
|
||||
{
|
||||
[JsonProperty("attribute")]
|
||||
public int Attribute { get; set; }
|
||||
// ...
|
||||
[JsonProperty("face")]
|
||||
public string Face { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("mtime")]
|
||||
public long Mtime { get; set; }
|
||||
// ...
|
||||
[JsonProperty("sign")]
|
||||
public string Sign { get; set; }
|
||||
[JsonProperty("special")]
|
||||
public int Special { get; set; }
|
||||
[JsonProperty("tag")]
|
||||
public List<long> Tag { get; set; }
|
||||
[JsonProperty("uname")]
|
||||
public string Name { get; set; }
|
||||
// ...
|
||||
}
|
||||
|
||||
}
|
56
src/Core/entity2/users/RelationFollow.cs
Normal file
56
src/Core/entity2/users/RelationFollow.cs
Normal file
@ -0,0 +1,56 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// 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}
|
||||
[JsonObject]
|
||||
public class RelationFollowOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public RelationFollow Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class RelationFollow : BaseEntity
|
||||
{
|
||||
[JsonProperty("list")]
|
||||
public List<RelationFollowInfo> List { get; set; }
|
||||
//[JsonProperty("re_version")]
|
||||
//public long reVersion { get; set; }
|
||||
[JsonProperty("total")]
|
||||
public int Total { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class RelationFollowInfo : BaseEntity
|
||||
{
|
||||
[JsonProperty("attribute")]
|
||||
public int Attribute { get; set; }
|
||||
// ...
|
||||
[JsonProperty("face")]
|
||||
public string Face { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("mtime")]
|
||||
public long Mtime { get; set; }
|
||||
// ...
|
||||
[JsonProperty("sign")]
|
||||
public string Sign { get; set; }
|
||||
[JsonProperty("special")]
|
||||
public int Special { get; set; }
|
||||
[JsonProperty("tag")]
|
||||
public List<long> Tag { get; set; }
|
||||
[JsonProperty("uname")]
|
||||
public string Name { get; set; }
|
||||
// ...
|
||||
}
|
||||
|
||||
}
|
43
src/Core/entity2/users/RelationWhisper.cs
Normal file
43
src/Core/entity2/users/RelationWhisper.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/relation/whispers?pn={pn}&ps={ps}
|
||||
[JsonObject]
|
||||
public class RelationWhisperOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public List<RelationWhisper> Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
public class RelationWhisper : BaseEntity
|
||||
{
|
||||
[JsonProperty("attribute")]
|
||||
public int Attribute { get; set; }
|
||||
// ...
|
||||
[JsonProperty("face")]
|
||||
public string Face { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("mtime")]
|
||||
public long Mtime { get; set; }
|
||||
// ...
|
||||
[JsonProperty("sign")]
|
||||
public string Sign { get; set; }
|
||||
[JsonProperty("special")]
|
||||
public int Special { get; set; }
|
||||
[JsonProperty("tag")]
|
||||
public List<long> Tag { get; set; }
|
||||
[JsonProperty("uname")]
|
||||
public string Name { get; set; }
|
||||
// ...
|
||||
}
|
||||
|
||||
}
|
48
src/Core/entity2/users/SpaceChannelList.cs
Normal file
48
src/Core/entity2/users/SpaceChannelList.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/space/channel/list?mid=
|
||||
[JsonObject]
|
||||
public class SpaceChannelOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public SpaceChannel Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceChannel : BaseEntity
|
||||
{
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
[JsonProperty("list")]
|
||||
public List<SpaceChannelList> List { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceChannelList : BaseEntity
|
||||
{
|
||||
[JsonProperty("cid")]
|
||||
public long Cid { get; set; }
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
[JsonProperty("cover")]
|
||||
public string Cover { get; set; }
|
||||
[JsonProperty("intro")]
|
||||
public string Intro { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("mtime")]
|
||||
public long Mtime { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
}
|
103
src/Core/entity2/users/SpaceChannelVideo.cs
Normal file
103
src/Core/entity2/users/SpaceChannelVideo.cs
Normal file
@ -0,0 +1,103 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/space/channel/video?mid={mid}&cid={cid}&pn={pn}&ps={ps}
|
||||
[JsonObject]
|
||||
public class SpaceChannelVideoOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public SpaceChannelVideo Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceChannelVideo : BaseEntity
|
||||
{
|
||||
[JsonProperty("list")]
|
||||
public SpaceChannelVideoList List { get; set; }
|
||||
[JsonProperty("page")]
|
||||
public SpaceChannelVideoPage Page { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceChannelVideoList : BaseEntity
|
||||
{
|
||||
[JsonProperty("archives")]
|
||||
public List<SpaceChannelVideoArchive> Archives { get; set; }
|
||||
[JsonProperty("cid")]
|
||||
public long Cid { get; set; }
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
[JsonProperty("cover")]
|
||||
public string Cover { get; set; }
|
||||
[JsonProperty("intro")]
|
||||
public string Intro { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("mtime")]
|
||||
public long Mtime { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceChannelVideoPage : BaseEntity
|
||||
{
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
[JsonProperty("num")]
|
||||
public int Num { get; set; }
|
||||
[JsonProperty("size")]
|
||||
public int Size { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceChannelVideoArchive : BaseEntity
|
||||
{
|
||||
[JsonProperty("aid")]
|
||||
public long Aid { get; set; }
|
||||
[JsonProperty("bvid")]
|
||||
public string Bvid { get; set; }
|
||||
[JsonProperty("cid")]
|
||||
public long Cid { get; set; }
|
||||
// ...
|
||||
[JsonProperty("ctime")]
|
||||
public long Ctime { get; set; }
|
||||
[JsonProperty("desc")]
|
||||
public string Desc { get; set; }
|
||||
// ...
|
||||
[JsonProperty("duration")]
|
||||
public long Duration { get; set; }
|
||||
// ...
|
||||
[JsonProperty("pic")]
|
||||
public string Pic { get; set; }
|
||||
[JsonProperty("pubdate")]
|
||||
public long Pubdate { get; set; }
|
||||
// ...
|
||||
[JsonProperty("stat")]
|
||||
public SpaceChannelVideoArchiveStat Stat { get; set; }
|
||||
// ...
|
||||
[JsonProperty("tid")]
|
||||
public int Tid { get; set; }
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
[JsonProperty("tname")]
|
||||
public string Tname { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceChannelVideoArchiveStat : BaseEntity
|
||||
{
|
||||
// ...
|
||||
[JsonProperty("view")]
|
||||
public long View { get; set; }
|
||||
}
|
||||
|
||||
}
|
65
src/Core/entity2/users/SpaceCheese.cs
Normal file
65
src/Core/entity2/users/SpaceCheese.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/pugv/app/web/season/page?mid={mid}&pn={pn}&ps={ps}
|
||||
[JsonObject]
|
||||
public class SpaceCheeseOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public SpaceCheeseList Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceCheeseList : BaseEntity
|
||||
{
|
||||
[JsonProperty("items")]
|
||||
public List<SpaceCheese> Items { get; set; }
|
||||
[JsonProperty("page")]
|
||||
public SpaceCheesePage Page { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceCheese : BaseEntity
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceCheesePage : BaseEntity
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
|
||||
}
|
79
src/Core/entity2/users/SpaceFavoriteFolder.cs
Normal file
79
src/Core/entity2/users/SpaceFavoriteFolder.cs
Normal file
@ -0,0 +1,79 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/v3/fav/folder/created/list?up_mid={mid}&pn={pn}&ps={ps}
|
||||
// https://api.bilibili.com/x/v3/fav/folder/collected/list?up_mid={mid}&pn={pn}&ps={ps}
|
||||
[JsonObject]
|
||||
public class SpaceFavoriteFolderOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public SpaceFavoriteFolder Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceFavoriteFolder : BaseEntity
|
||||
{
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
[JsonProperty("has_more")]
|
||||
public int HasMore { get; set; }
|
||||
[JsonProperty("list")]
|
||||
public List<SpaceFavoriteFolderList> List { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceFavoriteFolderList : BaseEntity
|
||||
{
|
||||
[JsonProperty("attr")]
|
||||
public int Attr { get; set; }
|
||||
[JsonProperty("cover")]
|
||||
public string Cover { get; set; }
|
||||
[JsonProperty("cover_type")]
|
||||
public int CoverType { get; set; }
|
||||
[JsonProperty("ctime")]
|
||||
public long Ctime { get; set; }
|
||||
[JsonProperty("fav_state")]
|
||||
public int FavState { get; set; }
|
||||
[JsonProperty("fid")]
|
||||
public long Fid { get; set; }
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; }
|
||||
[JsonProperty("intro")]
|
||||
public string Intro { get; set; }
|
||||
[JsonProperty("link")]
|
||||
public string Link { get; set; }
|
||||
[JsonProperty("media_count")]
|
||||
public int MediaCount { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("mtime")]
|
||||
public long Mtime { get; set; }
|
||||
[JsonProperty("state")]
|
||||
public int State { get; set; }
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
[JsonProperty("upper")]
|
||||
public FavoriteFolderUpper Upper { get; set; }
|
||||
// ...
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class FavoriteFolderUpper : BaseEntity
|
||||
{
|
||||
[JsonProperty("face")]
|
||||
public string Face { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
}
|
89
src/Core/entity2/users/SpaceFavoriteFolderResource.cs
Normal file
89
src/Core/entity2/users/SpaceFavoriteFolderResource.cs
Normal file
@ -0,0 +1,89 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/v3/fav/resource/list?media_id={mediaId}&pn={pn}&ps={ps}
|
||||
[JsonObject]
|
||||
public class SpaceFavoriteFolderResourceOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public SpaceFavoriteFolderResource Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceFavoriteFolderResource : BaseEntity
|
||||
{
|
||||
[JsonProperty("has_more")]
|
||||
public int HasMore { get; set; }
|
||||
// ...
|
||||
[JsonProperty("medias")]
|
||||
public List<SpaceFavoriteFolderMedia> Medias { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceFavoriteFolderMedia : BaseEntity
|
||||
{
|
||||
[JsonProperty("attr")]
|
||||
public int Attr { get; set; }
|
||||
[JsonProperty("bv_id")]
|
||||
public string BvId { get; set; }
|
||||
[JsonProperty("bvid")]
|
||||
public string Bvid { get; set; }
|
||||
[JsonProperty("cnt_info")]
|
||||
public SpaceFavoriteFolderMediaCntInfo CntInfo { get; set; }
|
||||
[JsonProperty("cover")]
|
||||
public string Cover { get; set; }
|
||||
[JsonProperty("ctime")]
|
||||
public long Ctime { get; set; }
|
||||
[JsonProperty("duration")]
|
||||
public long Duration { get; set; }
|
||||
[JsonProperty("fav_time")]
|
||||
public long FavTime { get; set; }
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; }
|
||||
[JsonProperty("intro")]
|
||||
public string Intro { get; set; }
|
||||
[JsonProperty("link")]
|
||||
public string Link { get; set; }
|
||||
[JsonProperty("page")]
|
||||
public int Page { get; set; }
|
||||
[JsonProperty("pubtime")]
|
||||
public long Pubtime { get; set; }
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public int Type { get; set; }
|
||||
[JsonProperty("upper")]
|
||||
public SpaceFavoriteFolderMediaUpper Upper { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceFavoriteFolderMediaCntInfo : BaseEntity
|
||||
{
|
||||
[JsonProperty("collect")]
|
||||
public long Collect { get; set; }
|
||||
[JsonProperty("danmaku")]
|
||||
public long Danmaku { get; set; }
|
||||
[JsonProperty("play")]
|
||||
public long Play { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceFavoriteFolderMediaUpper : BaseEntity
|
||||
{
|
||||
[JsonProperty("face")]
|
||||
public string Face { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
}
|
77
src/Core/entity2/users/SpaceInfo.cs
Normal file
77
src/Core/entity2/users/SpaceInfo.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/space/acc/info?mid={mid}
|
||||
[JsonObject]
|
||||
public class SpaceInfoOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public SpaceInfo Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceInfo : BaseEntity
|
||||
{
|
||||
// ...
|
||||
[JsonProperty("face")]
|
||||
public string Face { get; set; }
|
||||
[JsonProperty("fans_badge")]
|
||||
public bool FansBadge { get; set; }
|
||||
[JsonProperty("is_followed")]
|
||||
public bool IsFollowed { get; set; }
|
||||
// ...
|
||||
[JsonProperty("level")]
|
||||
public int Level { get; set; }
|
||||
// ...
|
||||
[JsonProperty("mid")]
|
||||
public int Mid { get; set; }
|
||||
// ...
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
// ...
|
||||
[JsonProperty("sex")]
|
||||
public string Sex { get; set; }
|
||||
// ...
|
||||
[JsonProperty("sign")]
|
||||
public string Sign { get; set; }
|
||||
// ...
|
||||
[JsonProperty("top_photo")]
|
||||
public string TopPhoto { get; set; }
|
||||
[JsonProperty("vip")]
|
||||
public SpaceInfoVip Vip { get; set; }
|
||||
}
|
||||
|
||||
public class SpaceInfoVip
|
||||
{
|
||||
[JsonProperty("avatar_subscript")]
|
||||
public int AvatarSubscript { get; set; }
|
||||
[JsonProperty("label")]
|
||||
public SpaceInfoVipLabel Label { get; set; }
|
||||
[JsonProperty("nickname_color")]
|
||||
public string NicknameColor { get; set; }
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
[JsonProperty("theme_type")]
|
||||
public int ThemeType { get; set; }
|
||||
[JsonProperty("type")]
|
||||
public int Type { get; set; }
|
||||
}
|
||||
|
||||
public class SpaceInfoVipLabel
|
||||
{
|
||||
[JsonProperty("label_theme")]
|
||||
public string LabelTheme { get; set; }
|
||||
[JsonProperty("path")]
|
||||
public string Path { get; set; }
|
||||
[JsonProperty("text")]
|
||||
public string Text { get; set; }
|
||||
}
|
||||
|
||||
}
|
148
src/Core/entity2/users/SpacePublication.cs
Normal file
148
src/Core/entity2/users/SpacePublication.cs
Normal file
@ -0,0 +1,148 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/space/arc/search
|
||||
[JsonObject]
|
||||
public class SpacePublicationOrigin : BaseEntity
|
||||
{
|
||||
//[JsonProperty("code")]
|
||||
//public int Code { get; set; }
|
||||
[JsonProperty("data")]
|
||||
public SpacePublication Data { get; set; }
|
||||
//[JsonProperty("message")]
|
||||
//public string Message { get; set; }
|
||||
//[JsonProperty("ttl")]
|
||||
//public int Ttl { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpacePublication : BaseEntity
|
||||
{
|
||||
[JsonProperty("list")]
|
||||
public SpacePublicationList List { get; set; }
|
||||
[JsonProperty("page")]
|
||||
public SpacePublicationPage Page { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpacePublicationList : BaseEntity
|
||||
{
|
||||
[JsonProperty("tlist")]
|
||||
public SpacePublicationListType Tlist { get; set; }
|
||||
[JsonProperty("vlist")]
|
||||
public List<SpacePublicationListVideo> Vlist { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpacePublicationPage : BaseEntity
|
||||
{
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
[JsonProperty("pn")]
|
||||
public int Pn { get; set; }
|
||||
[JsonProperty("ps")]
|
||||
public int Ps { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpacePublicationListType : BaseEntity
|
||||
{
|
||||
[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("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; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpacePublicationListVideo : BaseEntity
|
||||
{
|
||||
[JsonProperty("aid")]
|
||||
public long Aid { get; set; }
|
||||
//[JsonProperty("author")]
|
||||
//public string Author { get; set; }
|
||||
[JsonProperty("bvid")]
|
||||
public string Bvid { get; set; }
|
||||
//[JsonProperty("comment")]
|
||||
//public int Comment { get; set; }
|
||||
//[JsonProperty("copyright")]
|
||||
//public string Copyright { get; set; }
|
||||
[JsonProperty("created")]
|
||||
public long Created { get; set; }
|
||||
//[JsonProperty("description")]
|
||||
//public string Description { get; set; }
|
||||
//[JsonProperty("hide_click")]
|
||||
//public bool HideClick { get; set; }
|
||||
//[JsonProperty("is_pay")]
|
||||
//public int IsPay { get; set; }
|
||||
//[JsonProperty("is_steins_gate")]
|
||||
//public int IsSteinsGate { get; set; }
|
||||
//[JsonProperty("is_union_video")]
|
||||
//public int IsUnionVideo { get; set; }
|
||||
[JsonProperty("length")]
|
||||
public string Length { get; set; }
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("pic")]
|
||||
public string Pic { get; set; }
|
||||
[JsonProperty("play")]
|
||||
public int Play { get; set; }
|
||||
//[JsonProperty("review")]
|
||||
//public int Review { get; set; }
|
||||
//[JsonProperty("subtitle")]
|
||||
//public string Subtitle { get; set; }
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; }
|
||||
[JsonProperty("typeid")]
|
||||
public int Typeid { get; set; }
|
||||
//[JsonProperty("video_review")]
|
||||
//public int VideoReview { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpacePublicationListTypeVideoZone : BaseEntity
|
||||
{
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("tid")]
|
||||
public int Tid { get; set; }
|
||||
}
|
||||
|
||||
}
|
46
src/Core/entity2/users/SpaceSettings.cs
Normal file
46
src/Core/entity2/users/SpaceSettings.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://space.bilibili.com/ajax/settings/getSettings?mid={mid}
|
||||
[JsonObject]
|
||||
public class SpaceSettingsOrigin : BaseEntity
|
||||
{
|
||||
[JsonProperty("data")]
|
||||
public SpaceSettings Data { get; set; }
|
||||
[JsonProperty("status")]
|
||||
public bool Status { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceSettings : BaseEntity
|
||||
{
|
||||
// ...
|
||||
[JsonProperty("toutu")]
|
||||
public SpaceSettingsToutu Toutu { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class SpaceSettingsToutu : BaseEntity
|
||||
{
|
||||
[JsonProperty("android_img")]
|
||||
public string AndroidImg { get; set; }
|
||||
[JsonProperty("expire")]
|
||||
public long Expire { get; set; }
|
||||
[JsonProperty("ipad_img")]
|
||||
public string IpadImg { get; set; }
|
||||
[JsonProperty("iphone_img")]
|
||||
public string IphoneImg { get; set; }
|
||||
[JsonProperty("l_img")]
|
||||
public string Limg { get; set; } // 完整url为http://i0.hdslb.com/+相对路径
|
||||
[JsonProperty("platform")]
|
||||
public int Platform { get; set; }
|
||||
[JsonProperty("s_img")]
|
||||
public string Simg { get; set; } // 完整url为http://i0.hdslb.com/+相对路径
|
||||
[JsonProperty("sid")]
|
||||
public int Sid { get; set; }
|
||||
[JsonProperty("thumbnail_img")]
|
||||
public string ThumbnailImg { get; set; }
|
||||
}
|
||||
|
||||
}
|
31
src/Core/entity2/users/UpStat.cs
Normal file
31
src/Core/entity2/users/UpStat.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/space/upstat?mid={mid}
|
||||
[JsonObject]
|
||||
public class UpStatOrigin : BaseEntity
|
||||
{
|
||||
[JsonProperty("data")]
|
||||
public UpStat Data { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class UpStat : BaseEntity
|
||||
{
|
||||
[JsonProperty("archive")]
|
||||
public UpStatArchive Archive { get; set; }
|
||||
[JsonProperty("article")]
|
||||
public UpStatArchive Article { get; set; }
|
||||
[JsonProperty("likes")]
|
||||
public long Likes { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class UpStatArchive : BaseEntity
|
||||
{
|
||||
[JsonProperty("view")]
|
||||
public long View { get; set; } // 视频播放量
|
||||
}
|
||||
|
||||
}
|
28
src/Core/entity2/users/UserRelationStat.cs
Normal file
28
src/Core/entity2/users/UserRelationStat.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Core.entity2.users
|
||||
{
|
||||
// https://api.bilibili.com/x/relation/stat?vmid={mid}
|
||||
[JsonObject]
|
||||
public class UserRelationStatOrigin : BaseEntity
|
||||
{
|
||||
[JsonProperty("data")]
|
||||
public UserRelationStat Data { get; set; }
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class UserRelationStat : BaseEntity
|
||||
{
|
||||
[JsonProperty("black")]
|
||||
public long Black { get; set; }
|
||||
[JsonProperty("follower")]
|
||||
public long Follower { get; set; } // 粉丝数
|
||||
[JsonProperty("following")]
|
||||
public long Following { get; set; } // 关注数
|
||||
[JsonProperty("mid")]
|
||||
public long Mid { get; set; }
|
||||
[JsonProperty("whisper")]
|
||||
public long Whisper { get; set; }
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user