2026-10-02 00:47:49 -04:00
const { chromium } = require ( 'playwright' ) ; const fs = require ( 'fs' ) ;
2026-10-06 09:41:27 -04:00
if ( ! process . env . DF _SESSION _COOKIE ) { console . error ( 'DF_SESSION_COOKIE env var not set — grab the dragonflight.sid cookie value from your browser devtools, export it, rerun.' ) ; process . exit ( 1 ) ; }
2026-10-02 00:47:49 -04:00
const R = [ 'home' , 'recorders' , 'schedule' , 'graphics' , 'multiview' , 'projects' , 'library?project=5ebf74aa-f5b4-4a83-b089-c9af2cb25d1f' , 'upload' , 'contribution' , 'youtube' , 'cloud-import' , 'jobs' , 'staging' , 'playout' , 'playout-tria' , 'engineering' , 'applications' , 'users' , 'tokens' , 'containers' , 'logs' , 'audit' , 'cluster' , 'alerts' , 'settings' , 'rundown' , 'playout-schedule' , 'playout-ads' ] ;
( async ( ) => { const b = await chromium . launch ( { args : [ '--no-sandbox' ] } ) ; const c = await b . newContext ( { viewport : { width : 1920 , height : 1080 } } ) ;
2026-10-06 09:41:27 -04:00
await c . addCookies ( [ { name : 'dragonflight.sid' , value : process . env . DF _SESSION _COOKIE , domain : 'mediacmdr.com' , path : '/' , httpOnly : true , secure : true } ] ) ;
2026-10-02 00:47:49 -04:00
const p = await c . newPage ( ) ; await p . goto ( 'https://mediacmdr.com/' , { waitUntil : 'networkidle' } ) ; const out = { } ;
for ( const r of R ) { await p . evaluate ( h => { location . hash = h } , r ) ; await p . waitForTimeout ( 4000 ) ;
out [ r ] = await p . evaluate ( ( ) => { const m = document . querySelector ( 'main,[class*=content],[class*=page]' ) || document . body ; return m . innerText . replace ( /\n{2,}/g , '\n' ) . slice ( 0 , 1400 ) } ) ; }
await p . goto ( 'https://mediacmdr.com/editor.html' , { waitUntil : 'networkidle' } ) ; await p . waitForTimeout ( 4000 ) ; out . editor = await p . evaluate ( ( ) => document . body . innerText . slice ( 0 , 1000 ) ) ;
fs . writeFileSync ( 'page-text.json' , JSON . stringify ( out , null , 1 ) ) ; await b . close ( ) } ) ( ) ;