From acac84c0f05622cf536591f8aa41e20b33ced3f6 Mon Sep 17 00:00:00 2001 From: Lluis Date: Mon, 5 Feb 2024 22:03:20 +0100 Subject: [PATCH] fixing error throw --- services/browser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/browser.js b/services/browser.js index ff37ef4..66adf7e 100644 --- a/services/browser.js +++ b/services/browser.js @@ -10,8 +10,8 @@ async function getScreenshot() { await page.setViewport({ width: 1920, height: 1080 }) await page.goto("https://www.twitch.tv/" + config.twitch.channels, { waitUntil: 'networkidle0' }) - await page.$eval('button[data-a-target="consent-banner-accept"]', el => el.click()) - await page.$eval('button[data-a-target="content-classification-gate-overlay-start-watching-button"]', el => el.click()) + await page.$eval('button[data-a-target="consent-banner-accept"]', el => el.click()).catch(() => {}) + await page.$eval('button[data-a-target="content-classification-gate-overlay-start-watching-button"]', el => el.click()).catch(() => {}) await page.waitForSelector('div.persistent-player') await page.$eval('.video-player__default-player', el => el.remove())