← back to Crazy News Channel Shadowman

yolo/tk12191-shorts-hook.patch

19 lines

diff --git a/scripts/build-cartoon-batch.sh b/scripts/build-cartoon-batch.sh
index 9f10381..6d7bcea 100644
--- a/scripts/build-cartoon-batch.sh
+++ b/scripts/build-cartoon-batch.sh
@@ -182,4 +182,13 @@ sys.exit(1 if any(b.get('status') == 'failed' for b in q['briefs']) else 0)
 PYEOF
 RC=$?
 echo "$TS batch complete (count=$COUNT dry=$DRY rc=$RC)" >>"$LOG"
+
+# TK-12191: post today's newly built cartoons as PUBLIC "Satire:" YouTube Shorts on the
+# All News Daily channel (one per cartoon, with the linked article). Capped at 5 because
+# the YouTube Data API default quota is ~6 uploads/day and the daily news Short needs one.
+# The shorts ledger makes this idempotent, so re-runs never double-post.
+if [ "$DRY" = "0" ]; then
+  node scripts/cartoon-shorts/make-cartoon-shorts.mjs --date="$DATE" --limit=5 >>"$DIR/yolo/cartoon-shorts-wrapper.log" 2>&1 \
+    || echo "$TS cartoon-shorts FAILED (see yolo/cartoon-shorts-wrapper.log)" >>"$LOG"
+fi
 exit $RC