#!/usr/bin/env python3
import sys, time
sys.path.insert(0, "/opt/mia/workspace/clientes/borrello")
from _meta_api import upload_video, load_ids, save_ids

VIDEOS = {
    "MESAS 1": "/opt/mia/workspace/clientes/borrello/videos_mesas/MESAS 1 - REELS.mp4",
    "MESAS 2": "/opt/mia/workspace/clientes/borrello/videos_mesas/MESAS 2 - REELS.mp4",
    "MESAS 3": "/opt/mia/workspace/clientes/borrello/videos_mesas/MESAS 3 - REELS.mp4",
    "MESAS 4": "/opt/mia/workspace/clientes/borrello/videos_mesas/MESAS 4 - REELS.mp4",
    "MESAS 5": "/opt/mia/workspace/clientes/borrello/videos_mesas/MESAS 5 - REEL.mp4",
}

ids = load_ids()
for label, path in VIDEOS.items():
    if ids["videos"].get(label):
        print(f"SKIP {label} -> {ids['videos'][label]}")
        continue
    print(f"Uploading {label} ...", flush=True)
    res = upload_video(path, f"MESAS RADIONICAS - {label} - 07.2026")
    vid = res.get("id")
    ids["videos"][label] = vid
    save_ids(ids)
    print(f"  OK {label} -> {vid}", flush=True)

print("DONE UPLOADS")
print(ids["videos"])
