Skip to content

Commit

Permalink
feat: 添加配置bilibili.alert.ffmpegFail,用于关闭视频转码失败时的警告
Browse files Browse the repository at this point in the history
  • Loading branch information
nICEnnnnnnnLee committed Sep 25, 2024
1 parent f198d70 commit c6f18ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/nicelee/bilibili/downloaders/impl/FLVDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ protected boolean throwErrorIfNotConvertOk(boolean ok, String msg) {
return true;
} else {
convertingStatus = StatusEnum.FAIL;
throw new BilibiliError("转码失败,请检查ffmpeg配置: " + msg);
if(Global.alertIfFFmpegFail)
throw new BilibiliError("如需关闭该警告,请在配置页搜索并修改配置 bilibili.alert.ffmpegFail\n\t转码失败,请检查ffmpeg配置: " + msg);
else
return false;
}
}
/**
Expand Down
2 changes: 2 additions & 0 deletions src/nicelee/ui/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ public class Global {
public static String[] ffmpegCmd4Merge;
@Config(key = "bilibili.flv.ffmpeg", note = "FLV合并时是否调用ffmpeg", defaultValue = "false", valids = { "true", "false" })
public static boolean flvUseFFmpeg = false;
@Config(key = "bilibili.alert.ffmpegFail", note = "ffmpeg合并失败是否抛出异常", defaultValue = "true", valids = { "true", "false" })
public static boolean alertIfFFmpegFail = true;
@Config(key = "bilibili.cmd.debug", note = "调用外部命令时是否显示输出", defaultValue = "false", valids = { "true", "false" })
public static boolean debugCmd;
// 批量下载设置相关
Expand Down
3 changes: 3 additions & 0 deletions src/resources/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ bilibili.alert.maxAlertPrompt = 5
# 当遇到不期望的480P视频时是否抛出异常
## https://github.com/nICEnnnnnnnLee/BilibiliDown/issues/141
bilibili.alert.qualityUnexpected = true

# ffmpeg合并失败是否抛出异常
bilibili.alert.ffmpegFail = true
#######################################################################################################
# 同时支持HTTP + HTTPS 代理
#proxyHost = 127.0.0.1
Expand Down

0 comments on commit c6f18ae

Please sign in to comment.