diff --git a/package.json b/package.json index ced47e5..f63fbab 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "download", "ffmpeg" ], - "packageManager": "pnpm@7.6.0", + "packageManager": "pnpm@8.0.0", "engines": { "node": ">=14.18" }, @@ -44,15 +44,15 @@ "registry": "https://registry.npmjs.com" }, "devDependencies": { - "@lzwme/fed-lint-helper": "^2.3.4", - "@types/node": "^20.4.2", - "@typescript-eslint/eslint-plugin": "^6.1.0", - "@typescript-eslint/parser": "^6.1.0", - "eslint": "^8.45.0", - "eslint-config-prettier": "^8.8.0", + "@lzwme/fed-lint-helper": "^2.4.1", + "@types/node": "^20.5.0", + "@typescript-eslint/eslint-plugin": "^6.4.0", + "@typescript-eslint/parser": "^6.4.0", + "eslint": "^8.47.0", + "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.0", "husky": "^8.0.3", - "prettier": "^3.0.0", + "prettier": "^3.0.2", "standard-version": "^9.5.0", "typescript": "^5.1.6" }, @@ -60,8 +60,8 @@ "@lzwme/fe-utils": "^1.5.2", "commander": "^11.0.0", "console-log-colors": "^0.4.0", - "enquirer": "^2.3.6", - "m3u8-parser": "^7.0.0" + "enquirer": "^2.4.1", + "m3u8-parser": "^7.1.0" }, "files": [ "cjs", diff --git a/src/lib/video-search.ts b/src/lib/video-search.ts index 673d7d3..ed19eea 100644 --- a/src/lib/video-search.ts +++ b/src/lib/video-search.ts @@ -239,8 +239,23 @@ export async function VideoSerachAndDL( return VideoSerachAndDL(keyword, options, baseOpts); } else { const info = vResult.list[0]; + if (!info.vod_play_url) { + logger.error('未获取到播放地址信息', info); + return VideoSerachAndDL(keyword, options, baseOpts); + } + + if (!info.vod_play_note || !String(info.vod_play_url).includes(info.vod_play_note)) { + ['#', '$'].some(d => { + if (info.vod_play_url.includes(d)) { + info.vod_play_note = d; + return true; + } + return true; + }); + } + const urls = info.vod_play_url - .split(info.vod_play_note) + .split(info.vod_play_note || '$') .find(d => d.includes('.m3u8')) .split('#');