mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 18:13:25 +00:00
update deps, migrate to pnpm
This commit is contained in:
@@ -179,7 +179,11 @@ async function runCommandLine() {
|
||||
}
|
||||
|
||||
if (process.argv.length === 2) {
|
||||
runQuestions().catch(() => console.error('Exited.'));
|
||||
runQuestions()
|
||||
.catch(() => console.error('Exited.'))
|
||||
.finally(() => process.exit(0));
|
||||
} else {
|
||||
runCommandLine().catch(() => console.error('Exited.'));
|
||||
runCommandLine()
|
||||
.catch(() => console.error('Exited.'))
|
||||
.finally(() => process.exit(0));
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ async function runBrowserScraping(
|
||||
source: MetaOutput,
|
||||
options: CommandLineArguments,
|
||||
) {
|
||||
if (!existsSync(join(__dirname, '../../lib/index.mjs')))
|
||||
if (!existsSync(join(__dirname, '../../lib/index.js')))
|
||||
throw new Error('Please compile before running cli in browser mode');
|
||||
const config = getConfig();
|
||||
if (!config.proxyUrl)
|
||||
@@ -37,13 +37,15 @@ async function runBrowserScraping(
|
||||
root,
|
||||
});
|
||||
browser = await puppeteer.launch({
|
||||
headless: 'new',
|
||||
headless: true,
|
||||
args: ['--no-sandbox', '--disable-setuid-sandbox'],
|
||||
});
|
||||
const page = await browser.newPage();
|
||||
// This is the dev cli, so we can use console.log
|
||||
// eslint-disable-next-line no-console
|
||||
page.on('console', (message) => console.log(`${message.type().slice(0, 3).toUpperCase()} ${message.text()}`));
|
||||
|
||||
if (!server.resolvedUrls?.local.length) throw new Error('Server did not start');
|
||||
await page.goto(server.resolvedUrls.local[0]);
|
||||
await page.waitForFunction('!!window.scrape', { timeout: 5000 });
|
||||
|
||||
|
Reference in New Issue
Block a user