Skip to content

Commit

Permalink
click content advisor and refresh after screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed May 30, 2024
1 parent d4877e3 commit 80558fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions helpers/browserApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PuppeteerApi {
async removeElementsAndGetDiv() {
await this.page.waitForSelector('div.persistent-player')
await new Promise(r => setTimeout(r, 500))
await this.page.click('button[data-a-target="content-classification-gate-overlay-start-watching-button"]').catch(() => {})
await this.page.$eval('div.consent-banner', el => el.remove()).catch(() => {})
await this.page.$eval('#twilight-sticky-footer-root', el => el.remove()).catch(() => {})
await this.page.$eval('button[data-a-target="content-classification-gate-overlay-start-watching-button"]', el => el.click()).catch(() => { })
Expand Down
1 change: 1 addition & 0 deletions services/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ async function getScreenshot() {
sharp(bufferImage)
.resize({ width: 200 })
.toFile(`public/images/t_${name}.jpg`).catch(() => { console.error('rsize image for thumbnail')})
this.refreshPage()
} catch (error) {
console.log(error)
return null
Expand Down

0 comments on commit 80558fa

Please sign in to comment.