Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Dec 14, 2024
1 parent 6c5f471 commit eb2e9da
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Core/Tools/ProgramUpdates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -673,11 +673,17 @@ public static async void CheckUpdateFFmpegAsync(object state)
{
if (new FileInfo("./Plugins/ffmpeg/ffmpeg.exe").Length < 70000000)
{
Log.Info(nameof(Update_FFMPEG),"检查到FFEMPG版本过老,开始更新");
string url = "https://ddtv.pro/ffmpeg_update/github.js";

Log.Info(nameof(Update_FFMPEG), "检查到FFEMPG版本过老,开始更新");
string url = "FFMPEG/github.js";
re_run:
string File_Url = Network.Get.GetBody(url, false);

var config = new AmazonS3Config() { ServiceURL = endpoint, MaxErrorRetry = 2, Timeout = TimeSpan.FromSeconds(20) };
var ossClient = new AmazonS3Client(AKID, AKSecret, config);
GetObjectResponse response = ossClient.GetObjectAsync(Bucket, url).Result;
StreamReader reader = new StreamReader(response.ResponseStream);
string File_Url = reader.ReadToEndAsync().Result;


string downloadPath = $"{Core.Config.Core_RunConfig._TemporaryFileDirectory}new_ffmpeg.zip";
string extractPath = $"{Core.Config.Core_RunConfig._TemporaryFileDirectory}new_ffmpeg";
try
Expand All @@ -691,10 +697,10 @@ public static async void CheckUpdateFFmpegAsync(object state)
catch (Exception ex)
{

if (url == "https://ddtv.pro/ffmpeg_update/github.js")
if (url == "FFMPEG/github.js")
{
Log.Error(nameof(Update_FFMPEG), "更新FFMPEG出现错误,重试", ex, false);
url = "https://ddtv.pro/ffmpeg_update/cf.js";
url = "FFMPEG/cf.js";
goto re_run;
}
Log.Error(nameof(Update_FFMPEG), "更新FFMPE重试失败,本次放弃更新", ex, false);
Expand Down

0 comments on commit eb2e9da

Please sign in to comment.