fix(media): harden YouTube metadata loading

Bundle the self-contained yt-dlp onedir runtime to avoid per-request extraction latency, explicitly use bundled Deno, and guard the packaging layout. Also fix Add window menu/reset behavior and harden diagnostics and toast lifecycle handling.
This commit is contained in:
NimBold
2026-06-20 23:57:13 +03:30
parent 7ec855efd4
commit a8b792074f
147 changed files with 1330 additions and 73 deletions
+16 -2
View File
@@ -170,8 +170,21 @@ console.log('\n─── 6. yt-dlp packaging ───');
ok('_internal/ symlinks valid');
}
}
const requiredRuntimeFiles = [
path.join(internalDir, 'Python'),
path.join(internalDir, 'yt_dlp_ejs', 'yt', 'solver', 'core.min.js'),
path.join(internalDir, 'yt_dlp_ejs', 'yt', 'solver', 'lib.min.js'),
];
for (const required of requiredRuntimeFiles) {
if (fs.existsSync(required)) {
ok(`yt-dlp runtime component: ${path.relative(binariesDir, required)}`);
} else {
fail(`Missing yt-dlp runtime component: ${path.relative(binariesDir, required)}`);
}
}
} else {
console.log(' No _internal/ directory, assuming standalone onefile binary');
fail('yt-dlp must use the self-contained onedir distribution; onefile adds ~17 seconds to every launch');
}
}
}
@@ -209,7 +222,8 @@ function runEngine(label, engine, args, timeout = 30000) {
}
}
runEngine('yt-dlp', 'yt-dlp', ['--version'], 45000);
runEngine('yt-dlp cold start', 'yt-dlp', ['--version'], 20000);
runEngine('yt-dlp warm start', 'yt-dlp', ['--version'], 8000);
runEngine('ffmpeg', 'ffmpeg', ['-version']);
runEngine('deno', 'deno', ['--version']);
runEngine('aria2c', 'aria2c', ['--version']);