#!/usr/bin/env python3
"""回填 multi_demand_pool_di 的 video_list / video_count。

用法:
    python jobs/backfill_multi_demand_video_list.py 20260714
    python jobs/backfill_multi_demand_video_list.py          # 默认当天
"""

from __future__ import annotations

import logging
import sys
from datetime import datetime

from supply_infra.scheduler.jobs.backfill_multi_demand_pool_video_list import (
    backfill_video_list,
)

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
)


def main(biz_dt: str | None = None) -> dict:
    if biz_dt is None:
        biz_dt = datetime.now().strftime("%Y%m%d")
    result = backfill_video_list(biz_dt)
    print(result)
    return result


if __name__ == "__main__":
    date_arg = sys.argv[1] if len(sys.argv) > 1 else None
    main(date_arg)
