mirror of
https://github.com/YuzuZensai/NekoMelody.git
synced 2026-01-06 04:33:21 +00:00
✨ feat: Puppeteer flags
This commit is contained in:
@@ -58,7 +58,27 @@ export async function getStream(
|
||||
}
|
||||
|
||||
export async function getYouTubeFormats(id: string) {
|
||||
if (!browser) browser = await puppeteer.launch();
|
||||
if (!browser) {
|
||||
browser = await puppeteer.launch({
|
||||
headless: true,
|
||||
args: [
|
||||
"--disable-gpu",
|
||||
"--disable-dev-shm-usage",
|
||||
"--disable-setuid-sandbox",
|
||||
"--no-first-run",
|
||||
"--no-sandbox",
|
||||
"--no-zygote",
|
||||
"--deterministic-fetch",
|
||||
"--disable-features=IsolateOrigins",
|
||||
"--disable-site-isolation-trials",
|
||||
"--single-process",
|
||||
],
|
||||
});
|
||||
|
||||
browser.once("disconnected", () => {
|
||||
browser = null;
|
||||
});
|
||||
}
|
||||
|
||||
const page = await browser.newPage();
|
||||
await page.goto(`https://www.youtube.com/watch?v=${id}&has_verified=1`, {
|
||||
|
||||
Reference in New Issue
Block a user