Files
weval-l99/v112_wtp_authed.py
2026-04-24 04:38:58 +02:00

57 lines
2.2 KiB
Python

#!/usr/bin/env python3
"""V112 WTP authed via opus-test-session"""
import asyncio, json, os, urllib.request
from playwright.async_api import async_playwright
OUT = "/var/www/html/api/blade-tasks/v112-wtp-enriched"
os.makedirs(OUT, exist_ok=True)
# Get session
req = urllib.request.Request(
"http://127.0.0.1/api/opus-test-session-v94.php?k=WEVADS2026",
headers={"Host": "weval-consulting.com"}
)
sid = json.loads(urllib.request.urlopen(req, timeout=5).read().decode()).get("session_id")
print(f"Session: {sid}")
async def main():
async with async_playwright() as p:
browser = await p.chromium.launch(headless=True, args=['--no-sandbox'])
context = await browser.new_context(viewport={'width':1920,'height':1080})
await context.add_cookies([{
"name": "PHPSESSID", "value": sid,
"domain": ".weval-consulting.com", "path": "/",
"secure": True, "httpOnly": True, "sameSite": "Lax"
}])
page = await context.new_page()
await page.goto("https://weval-consulting.com/weval-technology-platform.html?v=v112a", wait_until='load', timeout=30000)
await page.wait_for_timeout(4000)
diag = await page.evaluate("""() => {
return {
title: document.title,
total_links: document.querySelectorAll('a[href]').length,
all_ia_hub_link: !!document.querySelector('a[href="/all-ia-hub.html"]'),
orchestrator_link: !!document.querySelector('a[href="/wevia-orchestrator.html"]'),
master_link: !!document.querySelector('a[href="/wevia-master.html"]'),
body_len: document.body.innerText.length
};
}""")
print("WTP authed:", json.dumps(diag, indent=2))
await page.screenshot(path=f"{OUT}/wtp-full-authed.png", full_page=True)
await context.close()
await browser.close()
report = {
'v112_wtp': 'enriched-authed',
**diag,
'VERDICT': 'OK' if (diag['all_ia_hub_link'] and diag['orchestrator_link']) else 'FAIL'
}
with open(f"{OUT}/proof.json",'w') as f:
json.dump(report, f, indent=2)
print("VERDICT:", report['VERDICT'])
asyncio.run(main())