mirror of
https://github.com/hazemKrimi/discord-bot.git
synced 2026-05-01 18:30:25 +00:00
added default timeout
This commit is contained in:
@@ -107,11 +107,9 @@ module.exports = class Play extends Command {
|
|||||||
}
|
}
|
||||||
} else if (query.match(/^(http(s)?:\/\/)?((w){3}.)?facebook?(\.com)?\/\S+\/videos\/\S+/)) {
|
} 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 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();
|
const page = await browser.newPage();
|
||||||
|
|
||||||
page.setDefaultNavigationTimeout(0);
|
|
||||||
page.setDefaultTimeout(0);
|
|
||||||
await page.goto(link, { waitUntil: 'networkidle2' });
|
await page.goto(link, { waitUntil: 'networkidle2' });
|
||||||
|
|
||||||
const titleHandle = await page.$('title');
|
const titleHandle = await page.$('title');
|
||||||
@@ -219,4 +217,4 @@ module.exports = class Play extends Command {
|
|||||||
return message.say({ embed });
|
return message.say({ embed });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user