优化,以及增加视频编码选择
This commit is contained in:
+1
-1
@@ -230,7 +230,7 @@ namespace dy.net
|
||||
|
||||
//Serilog.Log.Debug("isRestart1=" + config.IsFirstRunning);
|
||||
|
||||
//if (!isDevelopment)
|
||||
if (!isDevelopment)
|
||||
{
|
||||
var cookie = cookieService.GetOpendCookies();
|
||||
if (cookie != null && cookie.Any())
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
<SelfContained>false</SelfContained>
|
||||
<!--<DockerArch>x86</DockerArch>-->
|
||||
<!--<DockerArch>arm</DockerArch> -->
|
||||
<!--<DockerCoreVersion>2.0.3</DockerCoreVersion>-->
|
||||
<!--<DockerCoreVersion>2.0.5</DockerCoreVersion>-->
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -3,7 +3,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<_PublishTargetUrl>E:\code\dysync\bin\Release\net6.0\publish\</_PublishTargetUrl>
|
||||
<History>True|2026-01-24T07:47:01.6934638Z||;True|2026-01-24T15:32:35.6316009+08:00||;True|2026-01-24T15:16:28.7216639+08:00||;True|2026-01-23T22:14:26.8066324+08:00||;True|2026-01-23T13:36:48.4086406+08:00||;True|2026-01-23T13:30:27.2924204+08:00||;True|2026-01-23T13:02:53.3219368+08:00||;True|2026-01-23T13:01:54.3466638+08:00||;True|2026-01-23T13:01:28.8560809+08:00||;True|2026-01-22T23:18:32.0400436+08:00||;True|2026-01-22T22:29:29.5746209+08:00||;True|2026-01-22T21:32:21.7284081+08:00||;True|2026-01-22T21:20:26.5985955+08:00||;False|2026-01-22T21:20:21.1372539+08:00||;True|2026-01-22T21:11:18.3771739+08:00||;True|2026-01-22T20:58:55.9862778+08:00||;True|2026-01-22T20:51:48.6699461+08:00||;False|2026-01-22T20:51:42.2079210+08:00||;True|2026-01-22T20:50:34.7280114+08:00||;True|2026-01-22T20:50:11.1588492+08:00||;True|2026-01-22T16:11:14.0626037+08:00||;True|2026-01-22T15:53:16.6377347+08:00||;True|2026-01-22T15:45:34.0935091+08:00||;True|2026-01-22T12:44:28.1577014+08:00||;True|2026-01-22T12:40:45.7449335+08:00||;True|2026-01-22T12:39:07.0683214+08:00||;True|2026-01-22T09:55:49.7086190+08:00||;True|2026-01-22T01:37:53.6972395+08:00||;True|2026-01-22T01:34:14.2142463+08:00||;True|2026-01-22T01:32:50.9228911+08:00||;True|2026-01-22T01:29:43.8871986+08:00||;True|2026-01-22T01:29:40.7838709+08:00||;True|2026-01-22T01:27:34.4763970+08:00||;True|2026-01-22T01:26:55.0117367+08:00||;True|2026-01-22T01:23:19.4789587+08:00||;True|2026-01-19T10:19:44.8997385+08:00||;True|2026-01-19T10:11:10.2305307+08:00||;True|2026-01-17T00:52:08.8180346+08:00||;False|2026-01-17T00:52:03.1829000+08:00||;True|2026-01-17T00:45:04.0498090+08:00||;True|2026-01-16T21:00:57.7239379+08:00||;True|2026-01-16T21:00:03.3912989+08:00||;True|2026-01-16T20:56:08.5505592+08:00||;True|2026-01-16T20:46:32.3067302+08:00||;True|2026-01-15T22:18:57.9835738+08:00||;True|2026-01-15T22:07:25.4753938+08:00||;True|2026-01-15T22:07:14.8243754+08:00||;True|2026-01-15T21:40:13.2613927+08:00||;True|2026-01-15T20:57:56.6291682+08:00||;True|2026-01-15T20:57:47.1363536+08:00||;True|2026-01-15T20:08:44.4710883+08:00||;True|2026-01-15T20:04:51.8284314+08:00||;False|2026-01-15T20:04:45.3258155+08:00||;True|2026-01-15T19:59:11.7907672+08:00||;True|2026-01-15T01:10:48.9066941+08:00||;True|2026-01-15T01:03:23.6216975+08:00||;True|2026-01-15T01:03:16.3364591+08:00||;False|2026-01-15T01:03:10.5654436+08:00||;True|2026-01-15T00:49:21.6559622+08:00||;True|2026-01-15T00:10:42.7288439+08:00||;True|2026-01-15T00:06:28.4241682+08:00||;True|2026-01-13T22:34:15.2372411+08:00||;True|2026-01-13T22:26:46.4522947+08:00||;True|2026-01-13T22:15:56.9735179+08:00||;True|2026-01-13T22:15:51.8250677+08:00||;False|2026-01-13T22:15:46.6608690+08:00||;True|2026-01-13T22:03:06.4683237+08:00||;False|2026-01-13T22:03:01.2036027+08:00||;True|2026-01-13T21:36:05.8776209+08:00||;True|2026-01-13T21:33:02.0766289+08:00||;False|2026-01-13T21:32:57.1976141+08:00||;True|2026-01-13T19:14:35.2519439+08:00||;True|2026-01-13T15:07:50.0836745+08:00||;False|2026-01-13T15:06:35.5929685+08:00||;True|2026-01-13T10:21:41.6012776+08:00||;True|2026-01-13T09:57:25.4788847+08:00||;True|2026-01-13T09:53:14.4900360+08:00||;True|2026-01-13T09:23:53.6465295+08:00||;True|2026-01-12T22:04:14.5886955+08:00||;False|2026-01-12T22:04:08.2008101+08:00||;True|2026-01-12T21:53:46.9947176+08:00||;True|2026-01-12T21:11:15.8358024+08:00||;True|2026-01-12T21:09:51.8663228+08:00||;True|2026-01-11T21:25:07.5052845+08:00||;False|2026-01-11T21:24:27.5744557+08:00||;True|2026-01-11T19:59:15.4734611+08:00||;False|2026-01-11T19:59:04.9543339+08:00||;True|2026-01-11T18:51:30.6649269+08:00||;True|2026-01-08T21:07:57.5094466+08:00||;True|2026-01-08T14:51:18.2266231+08:00||;True|2026-01-08T14:31:55.1137120+08:00||;True|2026-01-08T00:16:24.4451490+08:00||;True|2026-01-08T00:14:20.7430793+08:00||;True|2026-01-08T00:07:46.7228194+08:00||;True|2026-01-07T23:52:13.3290082+08:00||;True|2026-01-07T23:49:28.4838650+08:00||;True|2026-01-07T23:47:45.1936189+08:00||;True|2026-01-07T23:35:09.7818611+08:00||;True|2026-01-07T23:20:43.7462863+08:00||;True|2026-01-07T23:04:39.5140429+08:00||;</History>
|
||||
<History>True|2026-01-24T13:45:22.8493624Z||;True|2026-01-24T21:31:35.4635265+08:00||;True|2026-01-24T21:27:31.3098506+08:00||;True|2026-01-24T15:47:01.6934638+08:00||;True|2026-01-24T15:32:35.6316009+08:00||;True|2026-01-24T15:16:28.7216639+08:00||;True|2026-01-23T22:14:26.8066324+08:00||;True|2026-01-23T13:36:48.4086406+08:00||;True|2026-01-23T13:30:27.2924204+08:00||;True|2026-01-23T13:02:53.3219368+08:00||;True|2026-01-23T13:01:54.3466638+08:00||;True|2026-01-23T13:01:28.8560809+08:00||;True|2026-01-22T23:18:32.0400436+08:00||;True|2026-01-22T22:29:29.5746209+08:00||;True|2026-01-22T21:32:21.7284081+08:00||;True|2026-01-22T21:20:26.5985955+08:00||;False|2026-01-22T21:20:21.1372539+08:00||;True|2026-01-22T21:11:18.3771739+08:00||;True|2026-01-22T20:58:55.9862778+08:00||;True|2026-01-22T20:51:48.6699461+08:00||;False|2026-01-22T20:51:42.2079210+08:00||;True|2026-01-22T20:50:34.7280114+08:00||;True|2026-01-22T20:50:11.1588492+08:00||;True|2026-01-22T16:11:14.0626037+08:00||;True|2026-01-22T15:53:16.6377347+08:00||;True|2026-01-22T15:45:34.0935091+08:00||;True|2026-01-22T12:44:28.1577014+08:00||;True|2026-01-22T12:40:45.7449335+08:00||;True|2026-01-22T12:39:07.0683214+08:00||;True|2026-01-22T09:55:49.7086190+08:00||;True|2026-01-22T01:37:53.6972395+08:00||;True|2026-01-22T01:34:14.2142463+08:00||;True|2026-01-22T01:32:50.9228911+08:00||;True|2026-01-22T01:29:43.8871986+08:00||;True|2026-01-22T01:29:40.7838709+08:00||;True|2026-01-22T01:27:34.4763970+08:00||;True|2026-01-22T01:26:55.0117367+08:00||;True|2026-01-22T01:23:19.4789587+08:00||;True|2026-01-19T10:19:44.8997385+08:00||;True|2026-01-19T10:11:10.2305307+08:00||;True|2026-01-17T00:52:08.8180346+08:00||;False|2026-01-17T00:52:03.1829000+08:00||;True|2026-01-17T00:45:04.0498090+08:00||;True|2026-01-16T21:00:57.7239379+08:00||;True|2026-01-16T21:00:03.3912989+08:00||;True|2026-01-16T20:56:08.5505592+08:00||;True|2026-01-16T20:46:32.3067302+08:00||;True|2026-01-15T22:18:57.9835738+08:00||;True|2026-01-15T22:07:25.4753938+08:00||;True|2026-01-15T22:07:14.8243754+08:00||;True|2026-01-15T21:40:13.2613927+08:00||;True|2026-01-15T20:57:56.6291682+08:00||;True|2026-01-15T20:57:47.1363536+08:00||;True|2026-01-15T20:08:44.4710883+08:00||;True|2026-01-15T20:04:51.8284314+08:00||;False|2026-01-15T20:04:45.3258155+08:00||;True|2026-01-15T19:59:11.7907672+08:00||;True|2026-01-15T01:10:48.9066941+08:00||;True|2026-01-15T01:03:23.6216975+08:00||;True|2026-01-15T01:03:16.3364591+08:00||;False|2026-01-15T01:03:10.5654436+08:00||;True|2026-01-15T00:49:21.6559622+08:00||;True|2026-01-15T00:10:42.7288439+08:00||;True|2026-01-15T00:06:28.4241682+08:00||;True|2026-01-13T22:34:15.2372411+08:00||;True|2026-01-13T22:26:46.4522947+08:00||;True|2026-01-13T22:15:56.9735179+08:00||;True|2026-01-13T22:15:51.8250677+08:00||;False|2026-01-13T22:15:46.6608690+08:00||;True|2026-01-13T22:03:06.4683237+08:00||;False|2026-01-13T22:03:01.2036027+08:00||;True|2026-01-13T21:36:05.8776209+08:00||;True|2026-01-13T21:33:02.0766289+08:00||;False|2026-01-13T21:32:57.1976141+08:00||;True|2026-01-13T19:14:35.2519439+08:00||;True|2026-01-13T15:07:50.0836745+08:00||;False|2026-01-13T15:06:35.5929685+08:00||;True|2026-01-13T10:21:41.6012776+08:00||;True|2026-01-13T09:57:25.4788847+08:00||;True|2026-01-13T09:53:14.4900360+08:00||;True|2026-01-13T09:23:53.6465295+08:00||;True|2026-01-12T22:04:14.5886955+08:00||;False|2026-01-12T22:04:08.2008101+08:00||;True|2026-01-12T21:53:46.9947176+08:00||;True|2026-01-12T21:11:15.8358024+08:00||;True|2026-01-12T21:09:51.8663228+08:00||;True|2026-01-11T21:25:07.5052845+08:00||;False|2026-01-11T21:24:27.5744557+08:00||;True|2026-01-11T19:59:15.4734611+08:00||;False|2026-01-11T19:59:04.9543339+08:00||;True|2026-01-11T18:51:30.6649269+08:00||;True|2026-01-08T21:07:57.5094466+08:00||;True|2026-01-08T14:51:18.2266231+08:00||;True|2026-01-08T14:31:55.1137120+08:00||;True|2026-01-08T00:16:24.4451490+08:00||;True|2026-01-08T00:14:20.7430793+08:00||;True|2026-01-08T00:07:46.7228194+08:00||;True|2026-01-07T23:52:13.3290082+08:00||;True|2026-01-07T23:49:28.4838650+08:00||;True|2026-01-07T23:47:45.1936189+08:00||;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -95,8 +95,8 @@ Cookie 及 `sec_user_id` 是同步功能的核心,需严格按步骤获取,
|
||||
|
||||
| 镜像标签 | 架构 |
|
||||
| ----------------- | -------------- |
|
||||
| `beta_2.0.3` | x86_64 (amd64) |
|
||||
| `arm_2.0.3` | ARM64 |
|
||||
| `beta_2.0.5` | x86_64 (amd64) |
|
||||
| `arm_2.0.5` | ARM64 |
|
||||
|
||||
|
||||
### 构建命令示例
|
||||
@@ -115,7 +115,7 @@ version: '3.8'
|
||||
|
||||
services:
|
||||
dysync:
|
||||
image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_2.0.3
|
||||
image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_2.0.5
|
||||
container_name: dysync2026 # 容器名称
|
||||
restart: unless-stopped # 始终重启容器,除非容器被手动停止或Docker服务停止
|
||||
ports:
|
||||
@@ -128,8 +128,10 @@ services:
|
||||
- /vol2/1000/media/dysync/dy1/coll:/app/collect # 个人收藏视频目录
|
||||
- /vol2/1000/media/dysync/dy1/fav:/app/favorite # 个人喜欢视频目录
|
||||
- /vol2/1000/media/dysync/dy1/up:/app/uper # 指定博主视频目录
|
||||
- /vol2/1000/media/dysync/dy1/mix:/app/mix # 合集 不需要可以删除
|
||||
- /vol2/1000/media/dysync/dy1/series:/app/series # 短剧 不需要可以删除
|
||||
|
||||
# 多账号路径映射示例(可选,需在后台对应账号配置中指定存储路径)
|
||||
# 多账号时路径映射示例(可选,也可以再授权时设置路径与第一个账号的路径一致)
|
||||
- /vol2/1000/media/dysync/dy2/collect:/app/collect2
|
||||
- /vol2/1000/media/dysync/dy2/fav:/app/favorite2
|
||||
- /vol2/1000/media/dysync/dy2/up:/app/uper2
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
|
||||
<!-- 系统配置 -->
|
||||
<div class="form-section">
|
||||
<h3 class="section-title">视频去重</h3>
|
||||
<h3 class="section-title">其他配置</h3>
|
||||
|
||||
<a-form-item v-show="formState.AutoDistinct" has-feedback label="去重优先级" name="PriorityLevel" :wrapper-col="{ span: 20 }">
|
||||
<!-- Tag 拖拽容器 -->
|
||||
@@ -194,6 +194,12 @@
|
||||
鼠标放到≡,点击鼠标左键即可拖拽调整优先级,</span>
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="视频编码" name="VideoEncoder">
|
||||
<a-radio-group v-model:value="formState.VideoEncoder" button-style="solid">
|
||||
<a-radio-button :value="264">H264</a-radio-button>
|
||||
<a-radio-button :value="265">H265</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
@@ -314,6 +320,7 @@ interface FormState {
|
||||
MegDynamicVideo: boolean; // 补充原有缺失字段
|
||||
KeepDynamicVideo: boolean; // 补充原有缺失字段
|
||||
OnlySyncNew: boolean;
|
||||
VideoEncoder: number;
|
||||
}
|
||||
|
||||
// 表单初始数据
|
||||
@@ -337,6 +344,7 @@ const formState: UnwrapRef<FormState> = reactive({
|
||||
MegDynamicVideo: false, // 初始化缺失字段
|
||||
KeepDynamicVideo: false, // 初始化缺失字段
|
||||
OnlySyncNew: false,
|
||||
VideoEncoder: 264,
|
||||
});
|
||||
|
||||
// 实时计算完整模板
|
||||
@@ -410,6 +418,7 @@ const getConfig = () => {
|
||||
MegDynamicVideo: res.data.megDynamicVideo || false, // 补充赋值
|
||||
KeepDynamicVideo: res.data.keepDynamicVideo || false, // 补充赋值
|
||||
OnlySyncNew: res.data.onlySyncNew,
|
||||
VideoEncoder: res.data.videoEncoder,
|
||||
});
|
||||
|
||||
tagData.value = JSON.parse(res.data.priorityLevel || '[]');
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- 核心配置:仅用核心版本号2.0.3,自动拼接前缀 -->
|
||||
<!-- 核心配置:仅用核心版本号2.0.5,自动拼接前缀 -->
|
||||
<!--<Target Name="DockerBuildAndPushAfterPublish" AfterTargets="Publish">
|
||||
<Exec Command="docker build -t jianzhichu/dysync.net:beta_$(DockerCoreVersion) . && docker tag jianzhichu/dysync.net:beta_$(DockerCoreVersion) ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_$(DockerCoreVersion) && docker push ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_$(DockerCoreVersion)"
|
||||
Condition="'$(DockerArch)' == 'x86'" />
|
||||
|
||||
+49
-14
@@ -264,7 +264,11 @@ namespace dy.net.job
|
||||
{
|
||||
var tag = cate?.Name ?? followed?.UperName ?? string.Empty;
|
||||
tag = !string.IsNullOrWhiteSpace(tag) ? $"-[{tag}]" : tag;
|
||||
|
||||
if (VideoType != VideoTypeEnum.dy_custom_collect || cookie.UseCollectFolder)
|
||||
{
|
||||
Log.Debug($"[{cookie.UserName}][{VideoType.GetDesc()}]{tag},本次成功同步{syncCount}条视频");
|
||||
}
|
||||
|
||||
if (cate != null)
|
||||
{
|
||||
@@ -299,6 +303,7 @@ namespace dy.net.job
|
||||
{
|
||||
try
|
||||
{
|
||||
if (VideoType != VideoTypeEnum.dy_custom_collect || cookie.UseCollectFolder)
|
||||
Log.Debug($"[{VideoType.GetDesc()}][{cookie.UserName}]开始同步...");
|
||||
|
||||
switch (VideoType)
|
||||
@@ -487,7 +492,7 @@ namespace dy.net.job
|
||||
var videos = new List<DouyinVideo>();
|
||||
foreach (var item in data.AwemeList)
|
||||
{
|
||||
//if (item.AwemeId != "7586278721292733722")
|
||||
//if (item.AwemeId != "7562107303323782434")
|
||||
//{
|
||||
// continue;
|
||||
//}
|
||||
@@ -533,7 +538,7 @@ namespace dy.net.job
|
||||
}
|
||||
}
|
||||
// 处理单个视频
|
||||
var video = await ProcessSingleVideo(cookie, item, data, config, followed, cate);
|
||||
var video = await ProcessSingleVideo(cookie, item, config, followed, cate);
|
||||
if (video != null)
|
||||
{
|
||||
videos.Add(video);
|
||||
@@ -706,7 +711,7 @@ namespace dy.net.job
|
||||
try
|
||||
{
|
||||
//File.Delete(exitVideo.VideoSavePath);
|
||||
DeleteOldViedo(config, exitVideo);
|
||||
DeleteOldViedo( exitVideo);
|
||||
//Log.Debug($"已删除旧文件:{exitVideo.VideoSavePath}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -739,7 +744,7 @@ namespace dy.net.job
|
||||
// 当前类型优先级更高 → 替换旧视频
|
||||
//Log.Debug($"[{VideoType.GetVideoTypeDesc()}]-视频-{exitVideo.AwemeId}-[{exitVideo.VideoTitle}]已存在低优先级视频({exitVideoType.GetVideoTypeDesc()}),替换为当前优先级:{currentVideoType.GetVideoTypeDesc()}");
|
||||
// 删除旧文件
|
||||
DeleteOldViedo(config, exitVideo);
|
||||
DeleteOldViedo(exitVideo);
|
||||
// 继续下载
|
||||
}
|
||||
else
|
||||
@@ -770,7 +775,7 @@ namespace dy.net.job
|
||||
return true;
|
||||
}
|
||||
|
||||
private void DeleteOldViedo(AppConfig config, DouyinVideo exitVideo)
|
||||
private static void DeleteOldViedo(DouyinVideo exitVideo)
|
||||
{
|
||||
if (File.Exists(exitVideo.VideoSavePath))
|
||||
{
|
||||
@@ -801,25 +806,32 @@ namespace dy.net.job
|
||||
/// <param name="followed">关注</param>
|
||||
/// <param name="cate"></param>
|
||||
/// <returns>处理后的视频实体,如果处理失败则为null</returns>
|
||||
protected async Task<DouyinVideo> ProcessSingleVideo(DouyinCookie cookie, Aweme item, DouyinVideoInfoResponse data, AppConfig config, DouyinFollowed followed = null, DouyinCollectCate cate = null)
|
||||
protected async Task<DouyinVideo> ProcessSingleVideo(DouyinCookie cookie, Aweme item, AppConfig config, DouyinFollowed followed = null, DouyinCollectCate cate = null)
|
||||
{
|
||||
// 检查视频数据是否有效
|
||||
if (!IsAwemeValid(item)) return null;
|
||||
// 获取视频最佳下载地址
|
||||
var v = GetBestMatchedVideoUrl(item, config);
|
||||
|
||||
// 获取视频的码率信息
|
||||
var v = item.Video.BitRate.Where(x => !string.IsNullOrEmpty(x.Format)).FirstOrDefault();
|
||||
if (v == null) return null;
|
||||
|
||||
// 获取视频播放地址
|
||||
if (v == null)
|
||||
{
|
||||
Serilog.Log.Error($"[{VideoType}][{cookie.UserName}][{item.Desc}]未获取到下载地址");
|
||||
return null;
|
||||
}
|
||||
//Serilog.Log.Debug($"{v.QualityType}-{v.BitRateValue}-{v.IsH265}-{v.HdrBit}");
|
||||
var videoUrl = v.PlayAddr.UrlList.Where(x => !string.IsNullOrEmpty(x))?.FirstOrDefault();
|
||||
if (string.IsNullOrWhiteSpace(videoUrl)) return null;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(videoUrl))
|
||||
{
|
||||
Serilog.Log.Error($"[{VideoType}][{cookie.UserName}][{item.Desc}]未获取到下载地址");
|
||||
return null;
|
||||
}
|
||||
// 创建保存文件夹
|
||||
var saveFolder = CreateSaveFolder(cookie, item, config, followed, cate);
|
||||
// 获取视频文件名
|
||||
var fileName = GetVideoFileName(cookie, item, config, cate);
|
||||
// 拼接视频保存路径
|
||||
var savePath = Path.Combine(saveFolder, fileName);
|
||||
var savePath2 = Path.Combine(saveFolder, DateTime.Now.Ticks + ".mp4");
|
||||
|
||||
// 如果文件已存在,跳过
|
||||
if (File.Exists(savePath))
|
||||
@@ -833,7 +845,7 @@ namespace dy.net.job
|
||||
await Task.Delay(_random.Next(1, 4) * 1000);
|
||||
|
||||
// 下载视频
|
||||
var (Success, ActualSavePath) = await douyinHttpClientService.DownloadAsync(videoUrl, savePath, cookie.Cookies);
|
||||
var (Success, _) = await douyinHttpClientService.DownloadAsync(videoUrl, savePath, cookie.Cookies);
|
||||
if (!Success)
|
||||
{
|
||||
Log.Error($"[{VideoType.GetDesc()}][{item?.Author?.Nickname ?? ""}]-视频[{DouyinFileNameHelper.SanitizeLinuxFileName(item.Desc, item.AwemeId)}]下载失败!!!");
|
||||
@@ -857,6 +869,29 @@ namespace dy.net.job
|
||||
return await CreateVideoEntity(config, cookie, item, v, savePath, saveFolder, avatarSavePath, null, cate);
|
||||
}
|
||||
|
||||
private static VideoBitRate GetBestMatchedVideoUrl(Aweme item, AppConfig config)
|
||||
{
|
||||
VideoBitRate v;
|
||||
if (config.VideoEncoder.HasValue && config.VideoEncoder.Value == 265)
|
||||
{
|
||||
v = item.Video.BitRate.Where(v => v.IsH265 == 1 && v.PlayAddr?.UrlList != null && v.PlayAddr.UrlList.Any())
|
||||
.OrderByDescending(v => v.BitRateValue)
|
||||
.FirstOrDefault();
|
||||
v ??= item.Video.BitRate.Where(v => v.IsH265 == 0 && v.PlayAddr?.UrlList != null && v.PlayAddr.UrlList.Any())
|
||||
.OrderByDescending(v => v.BitRateValue)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
v = item.Video.BitRate.Where(v => v.IsH265 == 0 && v.PlayAddr?.UrlList != null && v.PlayAddr.UrlList.Any())
|
||||
.OrderByDescending(v => v.BitRateValue)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 动态视频处理
|
||||
/// </summary>
|
||||
|
||||
@@ -42,5 +42,6 @@ namespace dy.net.job
|
||||
// return data != null && data.HasMore == 1;
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -109,6 +109,12 @@ namespace dy.net.model.entity
|
||||
///// </summary>
|
||||
//[SugarColumn(Length = 500, IsNullable = true)]
|
||||
//public string SeriesPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 264 265 0-默认0=264
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public int? VideoEncoder { get; set; } = 265;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1188,14 +1188,14 @@ namespace dy.net.model.response
|
||||
[JsonProperty("FPS")]
|
||||
public int Fps { get; set; }
|
||||
|
||||
//[JsonProperty("HDR_bit")]
|
||||
//public string HdrBit { get; set; }
|
||||
[JsonProperty("HDR_bit")]
|
||||
public string HdrBit { get; set; }
|
||||
|
||||
//[JsonProperty("HDR_type")]
|
||||
//public string HdrType { get; set; }
|
||||
[JsonProperty("HDR_type")]
|
||||
public string HdrType { get; set; }
|
||||
|
||||
//[JsonProperty("bit_rate")]
|
||||
//public int BitRateValue { get; set; }
|
||||
[JsonProperty("bit_rate")]
|
||||
public int BitRateValue { get; set; }
|
||||
|
||||
[JsonProperty("format")]
|
||||
public string Format { get; set; }
|
||||
@@ -1206,14 +1206,14 @@ namespace dy.net.model.response
|
||||
//[JsonProperty("is_bytevc1")]
|
||||
//public int IsBytevc1 { get; set; }
|
||||
|
||||
//[JsonProperty("is_h265")]
|
||||
//public int IsH265 { get; set; }
|
||||
[JsonProperty("is_h265")]
|
||||
public int IsH265 { get; set; }
|
||||
|
||||
[JsonProperty("play_addr")]
|
||||
public PlayAddr PlayAddr { get; set; }
|
||||
|
||||
//[JsonProperty("quality_type")]
|
||||
//public int QualityType { get; set; }
|
||||
[JsonProperty("quality_type")]
|
||||
public int QualityType { get; set; }
|
||||
|
||||
//[JsonProperty("video_extra")]
|
||||
//public string VideoExtra { get; set; }
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace dy.net.service
|
||||
}
|
||||
conf.IsFirstRunning = true;//标记为程序刚启动第一次运行
|
||||
conf.AutoDistinct = true;
|
||||
conf.VideoEncoder = 264;
|
||||
sqlSugarClient.Updateable(conf).ExecuteCommand();
|
||||
//兼容旧版本
|
||||
return conf;
|
||||
@@ -59,7 +60,8 @@ namespace dy.net.service
|
||||
OnlySyncNew = true,
|
||||
DownDynamicVideo = false,
|
||||
KeepDynamicVideo = false,
|
||||
MegDynamicVideo = true
|
||||
MegDynamicVideo = true,
|
||||
VideoEncoder = 264
|
||||
};
|
||||
sqlSugarClient.Insertable(config).ExecuteCommand();
|
||||
return config;
|
||||
|
||||
Reference in New Issue
Block a user