1、去重

2、分享
3、视频播放
4、批量删除,重新下载
5、自定义标题(仅博主视频)
6、授权页面去掉博主添加,新增关注列表
7、图文视频合成优化
8、其他优化
This commit is contained in:
jianzhichu
2025-11-30 00:42:25 +08:00
parent 63b51d211e
commit e6e9ff3cc3
94 changed files with 8155 additions and 1544 deletions
+25 -2
View File
@@ -1,4 +1,5 @@
using SqlSugar;
using System.Text.RegularExpressions;
namespace dy.net.model
{
@@ -14,7 +15,7 @@ namespace dy.net.model
public string Id { get; set; }
[SugarColumn(Length =200,IsNullable =true)]
public string Cron { get; set; }
public int Cron { get; set; }
/// <summary>
/// 每次查询数量
@@ -46,10 +47,32 @@ namespace dy.net.model
/// 日志保留天数,防止容器日志太多,默认10天
/// </summary>
public int LogKeepDay { get; set; } = 10;
/// <summary>
/// 关注的视频标题命名模板{id}{VideoTitle}{SyncTime}{ReleaseTime}{FileHash}{Resolution}{FileSize}
/// </summary>
public string FollowedTitleTemplate { get; set; }
/// <summary>
/// 分隔符
/// </summary>
public string FollowedTitleSeparator { get; set; }
/// <summary>
/// 完整的标题模板,包含分隔符
/// </summary>
public string FullFollowedTitleTemplate { get; set; }
/// <summary>
/// 图文视频是否单独存放,否的话则按原类型存储位置存放,比如收藏夹、喜欢等
/// </summary>
public bool ImageViedoSaveAlone { get; set; }
[SugarColumn(IsIgnore=true)]
public bool DownImageVideoFromEnv { get; set; }
/// <summary>
/// 自动去重-逻辑是遇到相同ID的视频直接跳过
/// </summary>
public bool AutoDistinct { get; set; }
}
}
+142
View File
@@ -0,0 +1,142 @@
using dy.net.dto;
using Newtonsoft.Json;
using SqlSugar;
namespace dy.net.model
{
[SugarTable(TableName = "dy_cookie")]
public class DouyinCookie
{
[SugarColumn(IsPrimaryKey = true)]
public string Id { get; set; }
/// <summary>
/// 用户抖音ID,对应我关注信息里面的myself_user_id
/// </summary>
public string MyUserId { get; set; }
/// <summary>
/// 用户描述
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 用户抖音Cookie
/// </summary>
[SugarColumn(Length =-1,IsNullable =true)]
public string Cookies { get; set; }
/// <summary>
/// 存储路径
/// </summary>
[SugarColumn(Length =255,IsNullable =true)]
public string SavePath { get; set; }
public int Status { get; set; }
/// <summary>
/// 同步喜欢的视频需要sec_user_id
/// </summary>
[SugarColumn(Length =500,IsNullable =true)]
public string SecUserId { get; set; }
/// <summary>
/// 喜欢的视频存储路径
/// </summary>
[SugarColumn(Length =500,IsNullable =true)]
public string FavSavePath { get; set; }
///// <summary>
///// 最新收藏夹的分页页码
///// </summary>
//[SugarColumn(Length =500,IsNullable =true)]
//public string CollectMaxCursor { get; set; }
///// <summary>
///// 最新我喜欢的分页页码
///// </summary>
//[SugarColumn(Length = 500, IsNullable = true)]
//public string FavoriteMaxCursor { get; set; }
/// <summary>
/// 是否已经同步过了(就是是否是第一次同步) 0-未同步 1-已同步
/// 如果是0,则同步时会获取全部数据;如果是1,则同步时只获取最新的数据(也就是只查一次)
/// 接口可以将该值改为0,下次开始同步就会重新获取全部数据
/// </summary>
public int CollHasSyncd { get; set; }
public int FavHasSyncd { get; set; }
public int UperSyncd { get; set; }
/// <summary>
/// 关注的用户sec_user_id列表 json字符串存储
/// </summary>
//[SugarColumn(Length =-1,IsNullable =true)]
//public string UpSecUserIds { get; set; }
/// <summary>
/// Up主发布的视频存储路径
/// </summary>
[SugarColumn(Length = 500, IsNullable = true)]
public string UpSavePath { get; set; }
/// <summary>
/// 图片视频存储路径
/// </summary>
[SugarColumn(Length = 500, IsNullable = true)]
public string ImgSavePath { get; set; }
//[SugarColumn(IsIgnore = true)]
//public List<DouyinUpSecUserIdDto> UpSecUserIdsJson
//{
// get
// {
// // 反序列化逻辑(保持不变)
// if (string.IsNullOrWhiteSpace(UpSecUserIds))
// {
// return new List<DouyinUpSecUserIdDto>();
// }
// try
// {
// return JsonConvert.DeserializeObject<List<DouyinUpSecUserIdDto>>(UpSecUserIds);
// }
// catch (JsonSerializationException ex)
// {
// // 日志记录(按需添加)
// // Logger.Error($"反序列化失败:{ex.Message},原始值:{UpSecUserIds}");
// return new List<DouyinUpSecUserIdDto>();
// }
// catch (Exception ex)
// {
// // 日志记录(按需添加)
// // Logger.Error($"处理异常:{ex.Message}");
// return new List<DouyinUpSecUserIdDto>();
// }
// }
// set
// {
// // 序列化逻辑:将列表转为JSON字符串,赋值给UpSecUserIds
// try
// {
// // 若传入的列表为null,直接设为空字符串(避免序列化后出现"null"字符串)
// UpSecUserIds = value == null
// ? string.Empty
// : JsonConvert.SerializeObject(value);
// }
// catch (JsonSerializationException ex)
// {
// // 捕获序列化异常(如对象循环引用、不支持的类型等)
// // Logger.Error($"序列化失败:{ex.Message},列表值:{value}");
// // 异常时默认设为空字符串,避免存储错误的JSON
// UpSecUserIds = string.Empty;
// }
// catch (Exception ex)
// {
// // 捕获其他未知异常
// // Logger.Error($"设置值异常:{ex.Message}");
// UpSecUserIds = string.Empty;
// }
// }
//}
}
}
+71
View File
@@ -0,0 +1,71 @@
using Newtonsoft.Json;
using SqlSugar;
namespace dy.net.model
{
[SugarTable(TableName = "dy_follow")]
public class DouyinFollowed
{
/// <summary>
///
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public string Id { get; set; }
//[SugarColumn(IsNullable = false,Length =200)]
//public string UperId { get; set; }
/// <summary>
/// 博主sec_uid
/// </summary>
[SugarColumn(IsNullable = false,Length =500)]
public string SecUid { get; set; }
[SugarColumn(IsNullable = false, Length =200)]
public string UperName { get; set; }
[SugarColumn(IsNullable = true, Length =1000)]
public string UperAvatar { get; set; }
/// <summary>
/// 官方账号(企业认证)
/// </summary>
[SugarColumn(IsNullable = true, Length =200)]
public string Enterprise { get; set; }
/// <summary>
/// 是否开启同步
/// </summary>
public bool OpenSync { get; set; }
/// <summary>
/// 是否全量同步
/// </summary>
public bool FullSync { get; set; }
/// <summary>
/// 最后更新时间
/// </summary>
public DateTime LastSyncTime { get; set; }
/// <summary>
/// 我的userId,关注者的抖音userid
/// </summary>
[SugarColumn(IsNullable = false,Length =200)]
public string mySelfId { get; set; }
/// <summary>
/// 签名
/// </summary>
[SugarColumn(IsNullable = true,Length =500)]
public string Signature { get; set; }
/// <summary>
/// 同步文件保存路径
/// </summary>
[SugarColumn(IsNullable = true,Length =500)]
public string SavePath { get; set; }
/// <summary>
/// 博主Id
/// </summary>
[SugarColumn(IsNullable = true,Length =100)]
public string UperId { get; set; }
}
}
-142
View File
@@ -1,142 +0,0 @@
using dy.net.dto;
using Newtonsoft.Json;
using SqlSugar;
namespace dy.net.model
{
[SugarTable(TableName = "dy_cookie")]
public class DouyinUserCookie
{
[SugarColumn(IsPrimaryKey = true)]
public string Id { get; set; }
/// <summary>
/// 用户账号-唯一就行,手机号啥的
/// </summary>
//public string UserId { get; set; }
/// <summary>
/// 用户描述
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 用户抖音Cookie
/// </summary>
[SugarColumn(Length =-1,IsNullable =true)]
public string Cookies { get; set; }
/// <summary>
/// 存储路径
/// </summary>
[SugarColumn(Length =255,IsNullable =true)]
public string SavePath { get; set; }
public int Status { get; set; }
/// <summary>
/// 同步喜欢的视频需要sec_user_id
/// </summary>
[SugarColumn(Length =500,IsNullable =true)]
public string SecUserId { get; set; }
/// <summary>
/// 喜欢的视频存储路径
/// </summary>
[SugarColumn(Length =500,IsNullable =true)]
public string FavSavePath { get; set; }
///// <summary>
///// 最新收藏夹的分页页码
///// </summary>
//[SugarColumn(Length =500,IsNullable =true)]
//public string CollectMaxCursor { get; set; }
///// <summary>
///// 最新我喜欢的分页页码
///// </summary>
//[SugarColumn(Length = 500, IsNullable = true)]
//public string FavoriteMaxCursor { get; set; }
/// <summary>
/// 是否已经同步过了(就是是否是第一次同步) 0-未同步 1-已同步
/// 如果是0,则同步时会获取全部数据;如果是1,则同步时只获取最新的数据(也就是只查一次)
/// 接口可以将该值改为0,下次开始同步就会重新获取全部数据
/// </summary>
public int CollHasSyncd { get; set; }
public int FavHasSyncd { get; set; }
public int UperSyncd { get; set; }
/// <summary>
/// 关注的用户sec_user_id列表 json字符串存储
/// </summary>
[SugarColumn(Length =-1,IsNullable =true)]
public string UpSecUserIds { get; set; }
/// <summary>
/// Up主发布的视频存储路径
/// </summary>
[SugarColumn(Length = 500, IsNullable = true)]
public string UpSavePath { get; set; }
/// <summary>
/// 图片视频存储路径
/// </summary>
[SugarColumn(Length = 500, IsNullable = true)]
public string ImgSavePath { get; set; }
[SugarColumn(IsIgnore = true)]
public List<DouyinUpSecUserIdDto> UpSecUserIdsJson
{
get
{
// 反序列化逻辑(保持不变)
if (string.IsNullOrWhiteSpace(UpSecUserIds))
{
return new List<DouyinUpSecUserIdDto>();
}
try
{
return JsonConvert.DeserializeObject<List<DouyinUpSecUserIdDto>>(UpSecUserIds);
}
catch (JsonSerializationException ex)
{
// 日志记录(按需添加)
// Logger.Error($"反序列化失败:{ex.Message},原始值:{UpSecUserIds}");
return new List<DouyinUpSecUserIdDto>();
}
catch (Exception ex)
{
// 日志记录(按需添加)
// Logger.Error($"处理异常:{ex.Message}");
return new List<DouyinUpSecUserIdDto>();
}
}
set
{
// 序列化逻辑:将列表转为JSON字符串,赋值给UpSecUserIds
try
{
// 若传入的列表为null,直接设为空字符串(避免序列化后出现"null"字符串)
UpSecUserIds = value == null
? string.Empty
: JsonConvert.SerializeObject(value);
}
catch (JsonSerializationException ex)
{
// 捕获序列化异常(如对象循环引用、不支持的类型等)
// Logger.Error($"序列化失败:{ex.Message},列表值:{value}");
// 异常时默认设为空字符串,避免存储错误的JSON
UpSecUserIds = string.Empty;
}
catch (Exception ex)
{
// 捕获其他未知异常
// Logger.Error($"设置值异常:{ex.Message}");
UpSecUserIds = string.Empty;
}
}
}
}
}
+37
View File
@@ -0,0 +1,37 @@
using SqlSugar;
namespace dy.net.model
{
/// <summary>
/// 重新下载的列表
/// </summary>
[SugarTable(TableName = "dy_rd_video")]
public class ViedoReDown
{
/// <summary>
///
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public string Id { get; set; }
/// <summary>
/// 原视频Id
/// </summary>
[SugarColumn(IsNullable =true,Length =50)]
public string ViedoId { get; set; }
/// <summary>
/// 原保存目录
/// </summary>
[SugarColumn(IsNullable =true,Length =1000)]
public string SavePath { get; set; }
public string CookieId { get; set; }
/// <summary>
/// 0-未下载 1-下载成功 2-下载失败
/// </summary>
public int Status { get; set; }
public DateTime CreateTime { get; set; }
public DateTime DownTime { get; set; }
public DateTime UpdateTime { get; set; }
}
}