1、修复关注同步时报https证书错误问题

2、关注列表点头像跳抖音博主首页
This commit is contained in:
jianzhichu
2025-12-04 22:01:38 +08:00
parent 385e53561a
commit c03dc5beff
12 changed files with 370 additions and 134 deletions
+24 -4
View File
@@ -24,7 +24,6 @@ namespace dy.net.service
/// <summary>
/// 初始化并返回配置
/// </summary>
/// <param name="downLoadImage"></param>
/// <returns></returns>
public AppConfig InitConfig()
{
@@ -34,9 +33,10 @@ namespace dy.net.service
if (string.IsNullOrWhiteSpace(conf.PriorityLevel))
{
conf.PriorityLevel = "[{\"id\":1,\"name\":\"喜欢的视频\",\"sort\":1},{\"id\":2,\"name\":\"收藏的视频\",\"sort\":2},{\"id\":3,\"name\":\"关注的视频\",\"sort\":3}]";
sqlSugarClient.Updateable(conf).ExecuteCommand();
//兼容旧版本
}
conf.IsFirstRunning = true;//标记为程序刚启动第一次运行
sqlSugarClient.Updateable(conf).ExecuteCommand();
//兼容旧版本
return conf;
}
else
@@ -57,7 +57,8 @@ namespace dy.net.service
FullFollowedTitleTemplate = "",
FollowedTitleSeparator = "",
AutoDistinct = true,//默认开启
PriorityLevel= "[{\"id\":1,\"name\":\"喜欢的视频\",\"sort\":1},{\"id\":2,\"name\":\"收藏的视频\",\"sort\":2},{\"id\":3,\"name\":\"关注的视频\",\"sort\":3}]"
PriorityLevel = "[{\"id\":1,\"name\":\"喜欢的视频\",\"sort\":1},{\"id\":2,\"name\":\"收藏的视频\",\"sort\":2},{\"id\":3,\"name\":\"关注的视频\",\"sort\":3}]",
IsFirstRunning = true
};
sqlSugarClient.Insertable(config).ExecuteCommand();
return config;
@@ -66,6 +67,25 @@ namespace dy.net.service
}
/// <summary>
/// 更新AppConfig的IsFirstRunning属性为fasle
/// </summary>
/// <returns></returns>
public async Task SetConfigNotFirstRunning()
{
//更新IsFirstRunning为false
await sqlSugarClient.Updateable<AppConfig>()
.SetColumns(x => x.IsFirstRunning == false)
.Where(x => x.IsFirstRunning == true)
.ExecuteCommandAsync();
}
/// <summary>
/// 更新配置
/// </summary>
/// <param name="config"></param>
/// <returns></returns>
public async Task<bool> UpdateConfig(AppConfig config)
{
+2 -9
View File
@@ -293,25 +293,18 @@ namespace dy.net.service
catch (Exception ex)
{
Serilog.Log.Error($"SyncMyFollows error: {ex.Message}");
return null;
throw;
}
}
public async Task<bool> SyncReDown(string awemeId,string cookie)
{
return false;
//有空再研究把.a_bogus算法有问题
}
//AI优化2
//
/// <summary>
/// 下载文件并保存到本地(支持重试机制,优化批量下载稳定性)
/// </summary>
/// <param name="videoUrl">文件地址</param>
/// <param name="savePath">保存路径</param>
/// <param name="cookie">请求Cookie</param>
/// <param name="httpclientName">HttpClient名称(默认"dy_down1"</param>
/// <param name="cancellationToken">取消令牌(用于终止任务)</param>
/// <param name="streamTimeout">流读取超时时间(默认60秒)</param>
/// <param name="maxRetryCount">最大重试次数(默认3次)</param>
+3 -3
View File
@@ -102,15 +102,15 @@ namespace dy.net.service
// 3. 只启动第一个任务(collect),后续任务由 Listener 自动触发
var firstJobConfigKey = "collect";
var startSuccess = await StartJobAsync(firstJobConfigKey, expression);
var startSuccess = await StartJobAsync(firstJobConfigKey, expression);
if (startSuccess)
{
Log.Debug("【任务服务】任务链条启动成功!执行顺序collect → favorite → followed → follow_user", expression);
Log.Debug($"任务开始执行collect → favorite → followed → follow_user-->每{expression}分钟执行一次...");
}
else
{
Log.Error("【任务服务】任务链条启动失败(第一个任务 {FirstJob} 启动失败)", firstJobConfigKey);
Log.Error($"任务执行失败(任务 {firstJobConfigKey} 启动失败)");
}
//启动follow_user--这个与其他几个任务没有依赖关系,所以单独启动
await StartJobAsync("follow_user", expression);