Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
79 lines
2.4 KiB
Python
79 lines
2.4 KiB
Python
"""Write ``sources.json`` (the licence and source record of every showcase reel) from ``plan.py``.
|
|
|
|
python apps/api/tools/ops/showcase/sources.py [--date YYYY-MM-DD]
|
|
|
|
Every footage clip, loop and voice is listed with its licence, so the landing's
|
|
"stock footage" credit and the no-repeat rules can be checked from one file.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import datetime as _dt
|
|
import json
|
|
import os
|
|
import sys
|
|
from collections.abc import Mapping, Sequence
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
OUT = os.path.join(HERE, "sources.json")
|
|
|
|
|
|
def _pexels(vid: str) -> dict:
|
|
return {"source": "Pexels", "id": vid, "url": f"https://www.pexels.com/video/{vid}/", "license": "Pexels License"}
|
|
|
|
|
|
def loop_record(reel: Mapping) -> dict | None:
|
|
spec = str(reel.get("loop") or "")
|
|
if not spec:
|
|
return None
|
|
if spec == "@footage":
|
|
return {"source": "footage montage"}
|
|
if spec.startswith("px:"):
|
|
return _pexels(spec[3:])
|
|
return {"source": "bundled original loop", "file": spec, "license": "first-party"}
|
|
|
|
|
|
def reel_record(reel: Mapping) -> dict:
|
|
if reel.get("page"):
|
|
footage = [{"source": "live page recording", "url": reel["page"], "license": "our own product"}]
|
|
else:
|
|
footage = [_pexels(str(vid)) for vid in reel.get("footage") or []]
|
|
return {
|
|
"key": reel["key"],
|
|
"niche": reel["niche"],
|
|
"style": reel.get("style") or "voiceover (classic)",
|
|
"footage": footage,
|
|
"loop": loop_record(reel),
|
|
"voice": {"engine": "edge-tts (free)", "name": reel["voice"]},
|
|
"script_words": len(str(reel.get("script") or "").split()),
|
|
"spend_usd": 0.0,
|
|
}
|
|
|
|
|
|
def build(reels: Sequence[Mapping], generated: str, lane: str) -> dict:
|
|
return {
|
|
"generated": generated,
|
|
"render_lane": lane,
|
|
"total_spend_usd": 0.0,
|
|
"reels": [reel_record(reel) for reel in reels],
|
|
}
|
|
|
|
|
|
def main() -> None:
|
|
sys.path.insert(0, HERE)
|
|
import plan
|
|
|
|
parser = argparse.ArgumentParser(description="Write sources.json from plan.py")
|
|
parser.add_argument("--date", default=_dt.date.today().isoformat())
|
|
args = parser.parse_args()
|
|
data = build(plan.REELS, args.date, plan.RENDER_LANE)
|
|
with open(OUT, "w", encoding="utf-8") as handle:
|
|
json.dump(data, handle, indent=1, ensure_ascii=False)
|
|
handle.write("\n")
|
|
print(f"wrote {OUT} ({len(data['reels'])} reels)")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|