增加第三方工具的下载地址提示 (#525)

This commit is contained in:
nilaoda 2024-11-30 22:28:44 +08:00 committed by GitHub
parent bc8b5a92a9
commit cacf9b0ff0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 3 deletions

View File

@ -105,6 +105,9 @@ public static class ResString
public static string fetch => GetText("fetch");
public static string ffmpegMerge => GetText("ffmpegMerge");
public static string ffmpegNotFound => GetText("ffmpegNotFound");
public static string mkvmergeNotFound => GetText("mkvmergeNotFound");
public static string mp4decryptNotFound => GetText("mp4decryptNotFound");
public static string shakaPackagerNotFound => GetText("shakaPackagerNotFound");
public static string fixingTTML => GetText("fixingTTML");
public static string fixingTTMLmp4 => GetText("fixingTTMLmp4");
public static string fixingVTT => GetText("fixingVTT");

View File

@ -784,6 +784,24 @@ internal class StaticText
zhTW: "找不到ffmpeg請自行下載https://ffmpeg.org/download.html",
enUS: "ffmpeg not found, please download at: https://ffmpeg.org/download.html"
),
["mkvmergeNotFound"] = new TextContainer
(
zhCN: "找不到mkvmerge请自行下载https://mkvtoolnix.download/downloads.html",
zhTW: "找不到mkvmerge請自行下載https://mkvtoolnix.download/downloads.html",
enUS: "mkvmerge not found, please download at: https://mkvtoolnix.download/downloads.html"
),
["shakaPackagerNotFound"] = new TextContainer
(
zhCN: "找不到shaka-packager请自行下载https://github.com/shaka-project/shaka-packager/releases",
zhTW: "找不到shaka-packager請自行下載https://github.com/shaka-project/shaka-packager/releases",
enUS: "shaka-packager not found, please download at: https://github.com/shaka-project/shaka-packager/releases"
),
["mp4decryptNotFound"] = new TextContainer
(
zhCN: "找不到mp4decrypt请自行下载https://www.bento4.com/downloads/",
zhTW: "找不到mp4decrypt請自行下載https://www.bento4.com/downloads/",
enUS: "mp4decrypt not found, please download at: https://www.bento4.com/downloads/"
),
["fixingTTML"] = new TextContainer
(
zhCN: "正在提取TTML(raw)字幕...",

View File

@ -139,7 +139,7 @@ internal class Program
option.MkvmergeBinaryPath ??= GlobalUtil.FindExecutable("mkvmerge");
if (string.IsNullOrEmpty(option.MkvmergeBinaryPath) || !File.Exists(option.MkvmergeBinaryPath))
{
throw new FileNotFoundException("mkvmerge not found");
throw new FileNotFoundException(ResString.mkvmergeNotFound);
}
Logger.Extra($"mkvmerge => {option.MkvmergeBinaryPath}");
}
@ -155,14 +155,14 @@ internal class Program
var file2 = GlobalUtil.FindExecutable("packager-linux-x64");
var file3 = GlobalUtil.FindExecutable("packager-osx-x64");
var file4 = GlobalUtil.FindExecutable("packager-win-x64");
if (file == null && file2 == null && file3 == null && file4 == null) throw new FileNotFoundException("shaka-packager not found!");
if (file == null && file2 == null && file3 == null && file4 == null) throw new FileNotFoundException(ResString.shakaPackagerNotFound);
option.DecryptionBinaryPath = file ?? file2 ?? file3 ?? file4;
Logger.Extra($"shaka-packager => {option.DecryptionBinaryPath}");
}
else if (option.DecryptionEngine is DecryptEngine.MP4DECRYPT)
{
var file = GlobalUtil.FindExecutable("mp4decrypt");
if (file == null) throw new FileNotFoundException("mp4decrypt not found!");
if (file == null) throw new FileNotFoundException(ResString.mp4decryptNotFound);
option.DecryptionBinaryPath = file;
Logger.Extra($"mp4decrypt => {option.DecryptionBinaryPath}");
}