media-command-guide/editor.js
zgaetano 0c9b9d98fb security: read session cookie from DF_SESSION_COOKIE env var
The dragonflight.sid cookie was hardcoded in 12 Playwright capture scripts.
Read it from the environment instead, fail fast when unset, and add
.env.example /.env gitignore. The leaked session has been revoked.
2026-10-06 09:41:27 -04:00

13 lines
1.4 KiB
JavaScript

const { chromium } = require('playwright');
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); }
(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:process.env.DF_SESSION_COOKIE,domain:'mediacmdr.com',path:'/',httpOnly:true,secure:true}]);
const p=await c.newPage();await p.goto('https://mediacmdr.com/editor.html',{waitUntil:'networkidle'});await p.waitForTimeout(3000);
const r=await p.evaluate(()=>{const s=[...document.querySelectorAll('select')].find(s=>[...s.options].some(o=>/Broadcast Managment/.test(o.text)));if(!s)return 'nosel';const o=[...s.options].find(o=>/Broadcast Managment/.test(o.text));s.value=o.value;s.dispatchEvent(new Event('change',{bubbles:true}));return o.value});
console.log('sel',r);await p.waitForTimeout(6000);
const it=null;
console.log('item',it);await p.waitForTimeout(4000);
await p.keyboard.press('e');await p.waitForTimeout(3000);
await p.evaluate(()=>document.querySelectorAll('video').forEach(v=>{try{v.pause()}catch(e){}}));
await p.screenshot({path:'screenshots/18-ops-editor.png'});
console.log(await p.evaluate(()=>document.body.innerText.replace(/\s+/g,' ').slice(0,500)));await b.close()})();