Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with dailymotion #150

Closed
alfredalfie123 opened this issue Feb 4, 2020 · 4 comments
Closed

Does not work with dailymotion #150

alfredalfie123 opened this issue Feb 4, 2020 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@alfredalfie123
Copy link

alfredalfie123 commented Feb 4, 2020

After using latest version of puppeteer-extra-plugin-stealth, I found out that Dailymotion videos which have ads always show blank screen. Without that, it worked fine.
Here is the sample Dailymotion URL which cause the issue: https://www.dailymotion.com/video/x7qyxew

@brunogaspar
Copy link
Collaborator

Do you have a code snippet of what you're doing?

@alfredalfie123
Copy link
Author

alfredalfie123 commented Mar 21, 2020

@brunogaspar

const network = require('network');
const puppeteer = require('puppeteer-extra');
const pluginStealth = require('puppeteer-extra-plugin-stealth');

const stealth = pluginStealth();

puppeteer.use(stealth);

async function launch_browser(launch_opt = {}) {
  try {
    const default_launch_opt = {
      headless: false,
      ignoreDefaultArgs: ['--enable-automation'],
      executablePath: '/usr/bin/google-chrome',
      args: [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        // '--app=https://www.google.com/'
        // '--lang=bn-BD,bn'
      ],
    };
    launch_opt = Object.assign(default_launch_opt, launch_opt);

    const browser = await puppeteer.launch(launch_opt);
    const context = await browser.defaultBrowserContext();
    const page = await context.newPage();

    await page.goto('https://www.dailymotion.com/video/x7qyxew', {
      waituntil: 'networkidle0'
    });
  } catch (err) {
    console.log(err);
  }
}

(async () => {
  await launch_browser();
})();

After the ads load, it show blank page.

@ardalann
Copy link

I was having the same issue on WashingtonPost. Turns out it's caused by the iframe.contentWindow evasion in the Stealth plugin. Try disabling that.

@brunogaspar brunogaspar added bug Something isn't working help wanted Extra attention is needed labels Aug 8, 2020
@berstend
Copy link
Owner

Closing in favor of #137

TL;DR: The iframe.contentWindow evasion may brake some sites, disable it as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants