some fixes

This commit is contained in:
2025-07-23 21:11:34 -04:00
parent 3577f537a0
commit 5e2aaca280

View File

@ -32,8 +32,8 @@ export async function pullData(amount = 100) {
needCode = false;
state.push('Starting Browser');
const browser = await puppeteer.launch({
args: ['--no-sandbox']
//headless: false
args: ['--no-sandbox'],
headless: true
//defaultViewport: null,
//args: ['--disable-blink-features=PrettyPrintJSONDocument']
});
@ -98,10 +98,14 @@ export async function pullData(amount = 100) {
if (url.includes('mfa/targets')) {
state.push('MFA required, selecting SMS option');
console.log('MFA required, please complete the authentication process.');
await new Promise((resolve) => setTimeout(resolve, Math.random() * 5000));
await page.locator('aria/SMS: (XXX) XXX-4029').click();
await page.waitForNavigation();
//need to do some stuff ehre
await page.keyboard.press('Tab');
await new Promise((resolve) => setTimeout(resolve, Math.random() * 5000));
//await page.keyboard.press('Tab');
state.push('Waiting for code input');
needCode = true;
for (let i = 0; i < 5 * 60; i++) {
@ -115,7 +119,8 @@ export async function pullData(amount = 100) {
}
state.push(`Got code: ${code}`);
await page.keyboard.type(code);
await page.locator('>>> [placeholder="Secure Access Code"]').fill(code);
//await page.keyboard.type(code);
code = null;
needCode = false;
await page.keyboard.press('Enter');
@ -137,6 +142,8 @@ export async function pullData(amount = 100) {
});
}
//await new Promise((resolve) => setTimeout(resolve, 60000));
state.push('Fetching q2token');
const q2token = (await browser.cookies()).find((cookie) => cookie.name === 'q2token')?.value;