2026-10-02 13:36:32 -04:00
const { chromium } = require ( 'playwright' ) ;
2026-10-06 10:09:45 -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 ) ; }
const COOKIE = process . env . DF _SESSION _COOKIE ;
2026-10-02 13:36:32 -04:00
( async ( ) => {
const b = await chromium . launch ( { args : [ '--no-sandbox' ] } ) ;
const c = await b . newContext ( { viewport : { width : 1920 , height : 1080 } } ) ;
await c . addCookies ( [ { name : 'dragonflight.sid' , value : COOKIE , domain : 'mediacmdr.com' , path : '/' , httpOnly : true , secure : true } ] ) ;
const p = await c . newPage ( ) ;
await p . goto ( 'https://mediacmdr.com/#playout' , { waitUntil : 'networkidle' } ) ; await p . waitForTimeout ( 6000 ) ;
const r = await p . evaluate ( ( ) => [ ... document . querySelectorAll ( 'button,[role=tab],select' ) ] . filter ( e => e . offsetParent && ! /^\d\d:\d\d$/ . test ( e . innerText . trim ( ) ) ) . map ( e => ` ${ e . tagName } | ${ e . innerText . trim ( ) . replace ( /\s+/g , ' ' ) . slice ( 0 , 40 ) } | ${ e . title || '' } | ${ e . getAttribute ( 'aria-label' ) || '' } ` ) ) ;
console . log ( r . slice ( 0 , 200 ) . join ( '\n' ) ) ;
console . log ( 'VIDEO' , await p . evaluate ( ( ) => document . querySelectorAll ( 'video,canvas' ) . length ) ) ;
await b . close ( ) ; } ) ( ) ;