[object Object]

← back to Beverlyhillsvideos

films: self-driving HeyGen restaurant-film batch (16 short scripts <$1 each, auto-deploy on completion)

26ef052608d5c2ca6d4082b380dc3873c54d2327 · 2026-08-05 15:14:39 -0700 · Steve Abrams

Files touched

Diff

commit 26ef052608d5c2ca6d4082b380dc3873c54d2327
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Aug 5 15:14:39 2026 -0700

    films: self-driving HeyGen restaurant-film batch (16 short scripts <$1 each, auto-deploy on completion)
---
 data/heygen-batch.jsonl  |  4 +++-
 filmgen/batch_loop.sh    | 20 ++++++++++++++++++++
 filmgen/heygen_batch.mjs |  2 +-
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/data/heygen-batch.jsonl b/data/heygen-batch.jsonl
index 5f0de75..f20388b 100644
--- a/data/heygen-batch.jsonl
+++ b/data/heygen-batch.jsonl
@@ -1,4 +1,6 @@
 {"name":"Spago Beverly Hills","session_id":"27ab0fe429764112a47decaf1e42f22e","video_id":"eb53be3269ed4579865a0a38b5f2335c","status":"completed","integrated":true}
 {"name":"CUT by Wolfgang Puck","session_id":"df26bc4723474c11a2b3ec08d74909d2","video_id":"7b5ca4de01d44f9ea156c46c8deb1d13","status":"generating"}
 {"name":"Mastro's Steakhouse Beverly Hills","session_id":"fa9ff2f7f5444adb98e765d18d1056f5","video_id":"e923ad16427345e7ad84f0826c3544b6","status":"generating"}
-{"name":"Funke","slug":"funke","session_id":"05de31a9968241ef904cf38a9a082ce7","video_id":"32d03f1f16eb462aab10acdc3e96c4e4","status":"pending","downloaded":false}
+{"name":"Funke","slug":"funke","session_id":"05de31a9968241ef904cf38a9a082ce7","video_id":"32d03f1f16eb462aab10acdc3e96c4e4","status":"processing","downloaded":false}
+{"name":"Mr. Chow","slug":"mr-chow","session_id":"551d71d5c8564bcdb63ed9e4e407db7e","video_id":"fa5ab6c7766c4517ae5b9b690dbdf421","status":"generating","downloaded":false}
+{"name":"Il Pastaio","slug":"il-pastaio","session_id":"098a086e1584412fab98adb3934d641e","video_id":"91a3d292d7a14d5ba564ac09198d5a9b","status":"generating","downloaded":false}
diff --git a/filmgen/batch_loop.sh b/filmgen/batch_loop.sh
new file mode 100755
index 0000000..9582ea5
--- /dev/null
+++ b/filmgen/batch_loop.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Autonomous restaurant-film batch runner. Polls/submits via heygen_batch.mjs,
+# and when a new film downloads, rebuilds + deploys the live site.
+# Bounded: heygen_batch.mjs only submits the 16 known scripts, <=3 concurrent, wallet floor $150.
+cd /Users/macstudio3/Projects/beverlyhillsvideos || exit 1
+DEPLOY="root@45.61.58.125:/root/public-projects/beverlyhillsvideos/public/"
+for i in $(seq 1 45); do
+  echo "===== cycle $i · $(date '+%H:%M:%S') ====="
+  out=$(node filmgen/heygen_batch.mjs); rc=$?
+  echo "$out"
+  if echo "$out" | grep -q 'downloaded'; then
+    echo "-- new film(s): rebuild + deploy --"
+    node build.mjs
+    rsync -az --delete public/ "$DEPLOY" >/dev/null 2>&1
+    ssh root@45.61.58.125 "pm2 restart beverlyhillsvideos --update-env >/dev/null 2>&1"
+    git add -A && git commit -q -m "films: integrate completed restaurant film(s) [auto]" 2>/dev/null
+  fi
+  [ $rc -eq 0 ] && { echo "===== BATCH COMPLETE ====="; break; }
+  sleep 720
+done
diff --git a/filmgen/heygen_batch.mjs b/filmgen/heygen_batch.mjs
index c6f4b0a..1ae004c 100644
--- a/filmgen/heygen_batch.mjs
+++ b/filmgen/heygen_batch.mjs
@@ -80,7 +80,7 @@ function main() {
   }
 
   // 2) SUBMIT: keep CONCURRENCY in flight
-  const inflight = () => Object.values(rows).filter(r => ['generating','pending','processing','waiting'].includes(r.status)).length;
+  const inflight = () => Object.values(rows).filter(r => scripts[r.name] && ['generating','pending','processing','waiting'].includes(r.status)).length;
   const queue = Object.keys(scripts).filter(n => !rows[n] || !rows[n].video_id);
   let submitted = 0;
   const wnow = wallet();

← b1d42b7 auto-save: 2026-08-05T15:13:13 (5 files) — build.mjs data/he  ·  back to Beverlyhillsvideos  ·  films: integrate completed restaurant film(s) [auto] 2947b29 →