initial commit

master
Conduitry 8 months ago
commit 3cb9d6f0e8

1
.gitignore vendored

@ -0,0 +1 @@
/node_modules/

@ -0,0 +1,2 @@
#!/bin/sh
docker run --rm --volume "$PWD":/app mcr.microsoft.com/playwright:v1.22.2 node /app $1

@ -0,0 +1,14 @@
import { firefox } from 'playwright';
const browser = await firefox.launch();
const context = await browser.newContext();
const page = await context.newPage();
await page.goto(`https://${process.argv[2]}`);
await new Promise(res => setTimeout(res, 5000));
const cf_clearance = (await context.cookies()).find(({ name }) => name === 'cf_clearance').value;
const user_agent = await page.evaluate('navigator.userAgent');
console.log(JSON.stringify({ headers: { cookie: `cf_clearance=${cf_clearance}`, 'user-agent': user_agent } }));
await browser.close();

@ -0,0 +1,6 @@
{
"type": "module",
"dependencies": {
"playwright": "1.22.2"
}
}
Loading…
Cancel
Save