mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
commit
3fc7c5f90d
@ -281,10 +281,12 @@ export class tools extends plugin {
|
|||||||
this.biliDownloadMethod = this.toolsConfig.biliDownloadMethod;
|
this.biliDownloadMethod = this.toolsConfig.biliDownloadMethod;
|
||||||
// 加载哔哩哔哩最高分辨率
|
// 加载哔哩哔哩最高分辨率
|
||||||
this.biliResolution = this.toolsConfig.biliResolution;
|
this.biliResolution = this.toolsConfig.biliResolution;
|
||||||
// 加载youtube的限制时长
|
// 加载youtube的截取时长
|
||||||
|
this.youtubeClipTime = this.toolsConfig.youtubeClipTime
|
||||||
|
// 加载youtube的解析时长
|
||||||
this.youtubeDuration = this.toolsConfig.youtubeDuration
|
this.youtubeDuration = this.toolsConfig.youtubeDuration
|
||||||
// 加载油管下载画质选项
|
// 加载油管下载画质选项
|
||||||
this.YouTubeGraphicsOptions = this.toolsConfig.YouTubeGraphicsOptions
|
this.youtubeGraphicsOptions = this.toolsConfig.youtubeGraphicsOptions
|
||||||
// 加载抖音Cookie
|
// 加载抖音Cookie
|
||||||
this.douyinCookie = this.toolsConfig.douyinCookie;
|
this.douyinCookie = this.toolsConfig.douyinCookie;
|
||||||
// 加载抖音是否压缩
|
// 加载抖音是否压缩
|
||||||
@ -1613,7 +1615,7 @@ export class tools extends plugin {
|
|||||||
musicUrlReg2.exec(message)?.[3] ||
|
musicUrlReg2.exec(message)?.[3] ||
|
||||||
musicUrlReg.exec(message)?.[2] ||
|
musicUrlReg.exec(message)?.[2] ||
|
||||||
musicUrlReg3.exec(message)?.[2] ||
|
musicUrlReg3.exec(message)?.[2] ||
|
||||||
/id=(\d+)/.exec(message)[1];
|
/(?<!user)id=(\d+)/.exec(message)[1];
|
||||||
// 如果没有下载地址跳出if
|
// 如果没有下载地址跳出if
|
||||||
if (_.isEmpty(id)) {
|
if (_.isEmpty(id)) {
|
||||||
e.reply(`识别:网易云音乐,解析失败!`);
|
e.reply(`识别:网易云音乐,解析失败!`);
|
||||||
@ -1922,7 +1924,7 @@ export class tools extends plugin {
|
|||||||
// 构造时间范围字符串
|
// 构造时间范围字符串
|
||||||
return `00:00:00-${formattedHours}:${formattedMinutes}:${formattedSeconds}`;
|
return `00:00:00-${formattedHours}:${formattedMinutes}:${formattedSeconds}`;
|
||||||
}
|
}
|
||||||
const timeRange = await formatTime(this.youtubeDuration)
|
const timeRange = await formatTime(this.youtubeClipTime)
|
||||||
const isOversea = await this.isOverseasServer();
|
const isOversea = await this.isOverseasServer();
|
||||||
if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) {
|
if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) {
|
||||||
e.reply("检测到没有梯子,无法解析油管");
|
e.reply("检测到没有梯子,无法解析油管");
|
||||||
@ -1944,8 +1946,8 @@ export class tools extends plugin {
|
|||||||
let url = removeParams(urlRex.exec(e.msg)?.[0] || url2Rex.exec(e.msg)?.[0]).replace(/&/g, isWindows ? '^&' : '&')
|
let url = removeParams(urlRex.exec(e.msg)?.[0] || url2Rex.exec(e.msg)?.[0]).replace(/&/g, isWindows ? '^&' : '&')
|
||||||
//非最高画质,就按照设定的来
|
//非最高画质,就按照设定的来
|
||||||
let graphics = ""
|
let graphics = ""
|
||||||
if (this.YouTubeGraphicsOptions != 0) {
|
if (this.youtubeGraphicsOptions != 0) {
|
||||||
graphics = `[height<=${ this.YouTubeGraphicsOptions }]`
|
graphics = `[height<=${ this.youtubeGraphicsOptions }]`
|
||||||
}
|
}
|
||||||
// 适配 YouTube Music
|
// 适配 YouTube Music
|
||||||
if (url.includes("music")) {
|
if (url.includes("music")) {
|
||||||
@ -1954,7 +1956,7 @@ export class tools extends plugin {
|
|||||||
}
|
}
|
||||||
const path = this.getCurDownloadPath(e);
|
const path = this.getCurDownloadPath(e);
|
||||||
await checkAndRemoveFile(path + "/temp.mp4")
|
await checkAndRemoveFile(path + "/temp.mp4")
|
||||||
await checkAndRemoveFile(path + "/Thumbnail.png")
|
await checkAndRemoveFile(path + "/thumbnail.png")
|
||||||
await ytDlpGetThumbnail(path, url, isOversea, this.myProxy)
|
await ytDlpGetThumbnail(path, url, isOversea, this.myProxy)
|
||||||
const title = await ytDlpGetTilt(url, isOversea, this.myProxy).toString().replace(/\n/g, '');
|
const title = await ytDlpGetTilt(url, isOversea, this.myProxy).toString().replace(/\n/g, '');
|
||||||
// logger.info('标题------',title)
|
// logger.info('标题------',title)
|
||||||
@ -1968,13 +1970,20 @@ export class tools extends plugin {
|
|||||||
if (Duration > this.youtubeDuration) {
|
if (Duration > this.youtubeDuration) {
|
||||||
e.reply([
|
e.reply([
|
||||||
segment.image(`${path}/thumbnail.png`),
|
segment.image(`${path}/thumbnail.png`),
|
||||||
`${this.identifyPrefix}识别:油管,视频下载中请耐心等待 \n视频标题:${title}${DIVIDING_LINE.replace('{}', '限制说明')}\n视频时长:${(Duration / 60).toFixed(2).replace(/\.00$/, '')} 分钟\n大于管理员限定时长:${(this.youtubeDuration / 60).toFixed(2).replace(/\.00$/, '')} 分钟\n将截取限定时间部分`
|
`${this.identifyPrefix}识别:油管,视频时长超限 \n视频标题:${title}\n⌚${DIVIDING_LINE.replace('{}', '限制说明').replace(/\n/g, '')}⌚\n视频时长:${(Duration / 60).toFixed(2).replace(/\.00$/, '')} 分钟\n大于管理员限定解析时长:${(this.youtubeDuration / 60).toFixed(2).replace(/\.00$/, '')} 分钟`
|
||||||
|
]);
|
||||||
|
} else if (Duration > this.youtubeClipTime && timeRange != '00:00:00-00:00:00') {
|
||||||
|
e.reply([
|
||||||
|
segment.image(`${path}/thumbnail.png`),
|
||||||
|
`${this.identifyPrefix}识别:油管,视频截取中请耐心等待 \n视频标题:${title}\n✂️${DIVIDING_LINE.replace('{}', '截取说明').replace(/\n/g, '')}✂️\n视频时长:${(Duration / 60).toFixed(2).replace(/\.00$/, '')} 分钟\n大于管理员限定截取时长:${(this.youtubeClipTime / 60).toFixed(2).replace(/\.00$/, '')} 分钟\n将截取视频片段`
|
||||||
]);
|
]);
|
||||||
} else {
|
|
||||||
e.reply([segment.image(`${ path }/thumbnail.png`),`${ this.identifyPrefix }识别:油管,视频下载中请耐心等待 \n视频标题:${ title }\n视频时长:${(Duration / 60).toFixed(2).replace(/\.00$/, '')} 分钟`]);
|
|
||||||
}
|
|
||||||
await ytDlpHelper(path, url, isOversea, this.myProxy, this.videoDownloadConcurrency, true, graphics, timeRange);
|
await ytDlpHelper(path, url, isOversea, this.myProxy, this.videoDownloadConcurrency, true, graphics, timeRange);
|
||||||
this.sendVideoToUpload(e, `${path}/temp.mp4`);
|
this.sendVideoToUpload(e, `${path}/temp.mp4`);
|
||||||
|
} else {
|
||||||
|
e.reply([segment.image(`${path}/thumbnail.png`), `${this.identifyPrefix}识别:油管,视频下载中请耐心等待 \n视频标题:${title}\n视频时长:${(Duration / 60).toFixed(2).replace(/\.00$/, '')} 分钟`]);
|
||||||
|
await ytDlpHelper(path, url, isOversea, this.myProxy, this.videoDownloadConcurrency, true, graphics, timeRange);
|
||||||
|
this.sendVideoToUpload(e, `${path}/temp.mp4`);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error);
|
logger.error(error);
|
||||||
throw error; // Rethrow the error so it can be handled by the caller
|
throw error; // Rethrow the error so it can be handled by the caller
|
||||||
|
@ -27,8 +27,9 @@ neteaseCookie: '' # 网易云ck
|
|||||||
neteaseCloudAPIServer: '' # 网易云自建服务器地址
|
neteaseCloudAPIServer: '' # 网易云自建服务器地址
|
||||||
neteaseCloudAudioQuality: exhigh # 网易云解析最高音质 默认exhigh(极高) 分类:standard => 标准,higher => 较高, exhigh=>极高, lossless=>无损, hires=>Hi-Res, jyeffect => 高清环绕声, sky => 沉浸环绕声, dolby => 杜比全景声, jymaster => 超清母带
|
neteaseCloudAudioQuality: exhigh # 网易云解析最高音质 默认exhigh(极高) 分类:standard => 标准,higher => 较高, exhigh=>极高, lossless=>无损, hires=>Hi-Res, jyeffect => 高清环绕声, sky => 沉浸环绕声, dolby => 杜比全景声, jymaster => 超清母带
|
||||||
|
|
||||||
YouTubeGraphicsOptions: 720 # YouTobe的下载画质,0为原画,1080,720,480,自定义画面高度(默认为720)
|
youtubeGraphicsOptions: 720 # YouTobe的下载画质,0为原画,1080,720,480,自定义画面高度(默认为720)
|
||||||
youtubeDuration: 300 # YouTobe限制的最大视频时长(默认5分钟),单位:秒
|
youtubeClipTime: # YouTobe限制的最大视频时长(默认不开启),单位:秒 最好不要超过5分钟,否则截取效率非常低
|
||||||
|
youtubeDuration: 480 # YouTobe限制的最大视频时长(默认8分钟),单位:秒 最好不要超过30分钟,否则截取效率非常低
|
||||||
|
|
||||||
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;
|
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-不压缩;是否使用压缩视频格式的抖音(默认使用),使用后加速视频发送
|
douyinCompression: true # true-压缩,false-不压缩;是否使用压缩视频格式的抖音(默认使用),使用后加速视频发送
|
||||||
|
@ -222,17 +222,28 @@ export function supportGuoba() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: "tools.youtubeDuration",
|
field: "tools.youtubeDuration",
|
||||||
label: "YouTuBe最大时长",
|
label: "YouTuBe最大解析时长",
|
||||||
bottomHelpMessage:
|
bottomHelpMessage:
|
||||||
"超过时长会截取指定时间(单位:秒),保护魔法的流量,计算公式:5分钟 x 60秒 = 300秒",
|
"超过时长不解析(单位:秒),保护魔法的流量,计算公式:8分钟 x 60秒 = 480秒,默认8分钟,最好不超过30分钟",
|
||||||
component: "InputNumber",
|
component: "InputNumber",
|
||||||
required: false,
|
required: false,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: "请输入YouTuBe视频最大时长限制(默认5分钟)",
|
placeholder: "请输入YouTuBe视频最大时长限制",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: "tools.YouTubeGraphicsOptions",
|
field: "tools.youtubeClipTime",
|
||||||
|
label: "YouTuBe截取时长",
|
||||||
|
bottomHelpMessage:
|
||||||
|
"超过时长会截取指定时间(单位:秒),保护魔法的流量,计算公式:3分钟 x 60秒 = 180秒,默认不开启,最好不超过5分钟,0表无限or不开启",
|
||||||
|
component: "InputNumber",
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: "请输入截取时长",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: "tools.youtubeGraphicsOptions",
|
||||||
label: "YouTube最高分辨率",
|
label: "YouTube最高分辨率",
|
||||||
bottomHelpMessage:
|
bottomHelpMessage:
|
||||||
"油管下载的最高分辨率(默认720p,请根据自己魔法流量和服务器承载能力进行调整)",
|
"油管下载的最高分辨率(默认720p,请根据自己魔法流量和服务器承载能力进行调整)",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user