yt-dlp support

This commit is contained in:
synt-xerror
2026-03-12 01:22:29 -03:00
parent 2040382842
commit 3780936e01
5435 changed files with 991931 additions and 137 deletions

23
node_modules/whatsapp-web.js/src/util/Puppeteer.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
/**
* Expose a function to the page if it does not exist
*
* NOTE:
* Rewrite it to 'upsertFunction' after updating Puppeteer to 20.6 or higher
* using page.removeExposedFunction
* https://pptr.dev/api/puppeteer.page.removeexposedfunction
*
* @param {object} page - Puppeteer Page instance
* @param {string} name
* @param {Function} fn
*/
async function exposeFunctionIfAbsent(page, name, fn) {
const exist = await page.evaluate((name) => {
return !!window[name];
}, name);
if (exist) {
return;
}
await page.exposeFunction(name, fn);
}
module.exports = {exposeFunctionIfAbsent};