diff --git a/apps/tools.js b/apps/tools.js index 6520d7e..61f7e96 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -231,6 +231,8 @@ export class tools extends plugin { this.identifyPrefix = this.toolsConfig.identifyPrefix; // 加载直播录制时长 this.streamDuration = this.toolsConfig.streamDuration; + // 加载直播是否开启兼容模式 + this.streamCompatibility = this.toolsConfig.streamCompatibility; // 加载哔哩哔哩配置 this.biliSessData = this.toolsConfig.biliSessData; // 加载哔哩哔哩的限制时长 @@ -261,8 +263,6 @@ export class tools extends plugin { this.douyinCompression = this.toolsConfig.douyinCompression; // 加载抖音是否开启评论 this.douyinComments = this.toolsConfig.douyinComments; - // 加载抖音的是否开启兼容模式 - this.douyinStreamCompatibility = this.toolsConfig.douyinStreamCompatibility; // 加载小红书Cookie this.xiaohongshuCookie = this.toolsConfig.xiaohongshuCookie; // 翻译引擎 @@ -485,7 +485,7 @@ export class tools extends plugin { async sendStreamSegment(e, stream_url, second = this.streamDuration) { let outputFilePath = `${ this.getCurDownloadPath(e) }/stream_${second}s.flv`; // 删除临时文件 - if (this.douyinStreamCompatibility) { + if (this.streamCompatibility) { await checkAndRemoveFile(outputFilePath.replace("flv", "mp4")); } else { await checkAndRemoveFile(outputFilePath); @@ -513,7 +513,7 @@ export class tools extends plugin { response.data.unpipe(file); // 取消管道连接 file.end(); // 结束写入 // 这里判断是否开启兼容模式 - if (this.douyinStreamCompatibility) { + if (this.streamCompatibility) { logger.info(`[R插件][发送直播流] 开启兼容模式,开始转换mp4格式...`); const resolvedOutputPath = await convertFlvToMp4(outputFilePath, outputFilePath.replace(".flv", ".mp4")); fs.unlinkSync(outputFilePath); diff --git a/config/tools.yaml b/config/tools.yaml index 0785d9a..96b57cd 100644 --- a/config/tools.yaml +++ b/config/tools.yaml @@ -7,6 +7,7 @@ identifyPrefix: '' # 识别前缀,比如你识别哔哩哔哩,那么就有 deeplApiUrls: 'http://www.gptspt.cn/translate,http://gptspt.top/translate,http://8.134.135.4:1188/translate,http://120.76.141.173:1188/translate,http://bit.x7ys.com:1188/translate,http://deeplxapi.x7ys.com:1188/translate' streamDuration: 10 # 视频最大时长(单位秒) +streamCompatibility: false # 兼容模式,NCQQ不用开,其他ICQQ、LLO需要开启 biliSessData: '' # 哔哩哔哩的SESSDATA biliIntroLenLimit: 50 # 哔哩哔哩简介长度限制,填 0 或者 -1 可以不做任何限制,显示完整简介 @@ -26,7 +27,6 @@ YouTubeGraphicsOptions: 720 #YouTobe的下载画质,0为原画,1080,720, douyinCookie: '' # douyin's cookie, 格式:odin_tt=xxx;passport_fe_beating_status=xxx;sid_guard=xxx;uid_tt=xxx;uid_tt_ss=xxx;sid_tt=xxx;sessionid=xxx;sessionid_ss=xxx;sid_ucp_v1=xxx;ssid_ucp_v1=xxx;passport_assist_user=xxx;ttwid=xxx; douyinCompression: true # true-压缩,false-不压缩;是否使用压缩视频格式的抖音(默认使用),使用后加速视频发送 douyinComments: false # true-开启评论,false-关闭评论 -douyinStreamCompatibility: false # 兼容模式,NCQQ不用开,其他ICQQ、LLO需要开启 xiaohongshuCookie: '' # 2024-8-2后反馈必须使用ck,不然无法解析 diff --git a/guoba.support.js b/guoba.support.js index a62f977..257c5f2 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -80,6 +80,14 @@ export function supportGuoba() { placeholder: "请输入最大解析直播时长", }, }, + { + field: "tools.streamCompatibility", + label: "直播是否开启兼容模式", + bottomHelpMessage: + "兼容模式,NCQQ不用开,其他ICQQ、LLO需要开启", + component: "Switch", + required: false, + }, { field: "tools.defaultPath", label: "视频暂存位置", @@ -245,12 +253,6 @@ export function supportGuoba() { component: "Switch", required: false, }, - { - field: "tools.douyinStreamCompatibility", - label: "抖音直播是否开启兼容模式", - component: "Switch", - required: false, - }, { field: "tools.xiaohongshuCookie", label: "小红书的Cookie",