1
0

feat: Idk

This commit is contained in:
2025-08-07 00:29:59 +02:00
parent b5891e75ac
commit 5941988ec6
2 changed files with 19 additions and 4 deletions

View File

@@ -20,8 +20,8 @@ async function clearDownloadsFolder() {
(async () => {
const browser = await puppeteer.launch({
headless: 'new',
//headless: false,
//headless: 'new',
headless: false,
userDataDir: VOLUME_PATH,
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
@@ -48,7 +48,22 @@ async function clearDownloadsFolder() {
await page.keyboard.press('Enter');
await new Promise(r => setTimeout(r, 2000));
await page.waitForSelector('input[type="password"]', { timeout: 10000 });
try {
await page.waitForSelector('div[role="button"]', { timeout: 5000 });
const signInButtons = await page.$$('div[role="button"]');
for (const btn of signInButtons) {
const text = await page.evaluate(el => el.innerText, btn);
if (text && text.includes('with password')) {
console.log('Clicking "Sign in with password"...');
await btn.click();
break;
}
}
} catch (err) {
console.log('"Sign in with password" button not found, continuing...');
}
await page.waitForSelector('input[type="password"]', { timeout: 100000 });
await page.type('input[type="password"]', PASSWORD, { delay: 50 });
await page.keyboard.press('Enter');