#!/usr/bin/env python3
import json
import build  # reuse loaders/filters
from build import FILES_WRAPPED, load_wrapped, is_excluded, transform

for slug,path in FILES_WRAPPED.items():
    bl=load_wrapped(path)
    print(f"\n========== {slug} KEPT ==========")
    seen_d=set()
    for b in bl:
        ex,reason=is_excluded(b)
        if ex: continue
        dom=b['root_name_source']
        if dom in seen_d: continue
        seen_d.add(dom)
        dr=int(round(b.get('domain_rating_source') or 0))
        td=b.get('traffic_domain',0) or 0
        spon=b.get('is_sponsored')
        t=(b.get('title') or '')[:70]
        print(f"DR{dr:>3} td{td:>9} spon={int(bool(spon))} {dom:<32} | {t}")
