added default timeout

This commit is contained in:
Hazem Krimi
2020-05-21 04:54:09 +01:00
committed by GitHub
parent d45117cbb3
commit 8858912fb2
+2 -4
View File
@@ -107,11 +107,9 @@ module.exports = class Play extends Command {
}
} else if (query.match(/^(http(s)?:\/\/)?((w){3}.)?facebook?(\.com)?\/\S+\/videos\/\S+/)) {
const link = query.match(/^(http(s)?:\/\/)?((w){3}.)?facebook?(\.com)?\/\S+\/videos\/\S+/)[0];
const browser = await puppeteer.launch({ timeout: 0, args: ['--no-sandbox'] });
const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
const page = await browser.newPage();
page.setDefaultNavigationTimeout(0);
page.setDefaultTimeout(0);
await page.goto(link, { waitUntil: 'networkidle2' });
const titleHandle = await page.$('title');
@@ -219,4 +217,4 @@ module.exports = class Play extends Command {
return message.say({ embed });
}
}
}
}