Skip to content

Commit

Permalink
增加第三方工具的下载地址提示 (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilaoda authored Nov 30, 2024
1 parent bc8b5a9 commit cacf9b0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/N_m3u8DL-RE.Common/Resource/ResString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
18 changes: 18 additions & 0 deletions src/N_m3u8DL-RE.Common/Resource/StaticText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)字幕...",
Expand Down
6 changes: 3 additions & 3 deletions src/N_m3u8DL-RE/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static async Task DoWorkAsync(MyOption option)
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}");
}
Expand All @@ -155,14 +155,14 @@ static async Task DoWorkAsync(MyOption option)
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}");
}
Expand Down

0 comments on commit cacf9b0

Please sign in to comment.