feat: Idk
This commit is contained in:
@@ -20,8 +20,8 @@ async function clearDownloadsFolder() {
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const browser = await puppeteer.launch({
|
const browser = await puppeteer.launch({
|
||||||
headless: 'new',
|
//headless: 'new',
|
||||||
//headless: false,
|
headless: false,
|
||||||
userDataDir: VOLUME_PATH,
|
userDataDir: VOLUME_PATH,
|
||||||
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
||||||
});
|
});
|
||||||
@@ -48,7 +48,22 @@ async function clearDownloadsFolder() {
|
|||||||
await page.keyboard.press('Enter');
|
await page.keyboard.press('Enter');
|
||||||
await new Promise(r => setTimeout(r, 2000));
|
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.type('input[type="password"]', PASSWORD, { delay: 50 });
|
||||||
await page.keyboard.press('Enter');
|
await page.keyboard.press('Enter');
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ const path = require("path");
|
|||||||
const app = express();
|
const app = express();
|
||||||
const fs = require("fs/promises");
|
const fs = require("fs/promises");
|
||||||
|
|
||||||
const PORT = 3000;
|
const PORT = process.env.PORT || 3000;
|
||||||
|
|
||||||
app.get('/', (_, res) => {
|
app.get('/', (_, res) => {
|
||||||
res.sendFile(path.join(__dirname, "db", "current.json"));
|
res.sendFile(path.join(__dirname, "db", "current.json"));
|
||||||
|
|||||||
Reference in New Issue
Block a user