mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
🐞 fix: 修复油管饼干选项,防止部分个自无法解析
This commit is contained in:
parent
6e0276fa5d
commit
e9dd342e88
@ -2000,7 +2000,7 @@ export class tools extends plugin {
|
||||
}
|
||||
|
||||
// 下面为视频逻辑
|
||||
const Duration = convertToSeconds(await ytDlpGetDuration(url, isOversea, this.myProxy).toString().replace(/\n/g, ''));
|
||||
const Duration = convertToSeconds(ytDlpGetDuration(url, isOversea, this.myProxy, this.youtubeCookiePath).toString().replace(/\n/g, ''));
|
||||
// logger.info('时长------',Duration)
|
||||
if (Duration > this.youtubeDuration) {
|
||||
e.reply([
|
||||
|
@ -36,10 +36,13 @@ function constructEncodingParam(url) {
|
||||
* @param url
|
||||
* @param isOversea
|
||||
* @param proxy
|
||||
* @param cookiePath
|
||||
* @returns string
|
||||
*/
|
||||
export function ytDlpGetDuration(url, isOversea, proxy) {
|
||||
return execSync(`yt-dlp --get-duration --skip-download ${constructProxyParam(isOversea, proxy)} ${url}`);
|
||||
export function ytDlpGetDuration(url, isOversea, proxy, cookiePath = "") {
|
||||
// 构造 cookie 参数
|
||||
const cookieParam = constructCookiePath(url, cookiePath);
|
||||
return execSync(`yt-dlp --get-duration --skip-download ${cookieParam} ${constructProxyParam(isOversea, proxy)} ${url}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user