import { FlixArtAuth } from './auth.js';
import fs from 'fs';
import { CONFIG } from '../../src/utils/config.js';

async function dump() {
    const cookie = await FlixArtAuth.getCookie();
    const baseUrl = CONFIG.FLIXART_URL || '';
    const res = await fetch(`${baseUrl}/film/avatar/`, {
        headers: { 'Cookie': cookie, 'User-Agent': 'Mozilla/5.0' }
    });
    const html = await res.text();
    fs.writeFileSync('scratch/avatar.html', html);
    console.log('Saved to scratch/avatar.html, length:', html.length);
}
dump();
