Skip to main content

Scripts & Tools (scripts/)

The scripts/ directory holds operational utilities for the pipeline, metadata, and monitoring.

Content pipeline CLI — run-content-pipeline.js

Wrapper that drives content-pipeline.js with flags:

FlagMeaning
--sweepersFetch/process sweepers
--mashupsFetch/process mashups
--sfxFetch/process SFX
--songs=NFetch/process N songs
--ads=NFetch/process N ads
--no-fetchSkip downloads, process existing downloads only
--no-purgeKeep source files after processing
--countPrint counts and exit
--idsOperate on specific video IDs

Example:

node run-content-pipeline.js --songs=20 --sweepers --no-fetch

Media sync — sync-media-full.js

One-shot full mirror of the local library to sms@10.10.8.230:/home/sms/radio/media.

  • Extensions: .mp3, .ogg, .wav
  • Idempotent: skips files that already exist with the same size.
  • Use after bulk library changes. See Media sync.

Registry repair

ToolPurpose
sanitize_registry.jsRe-derive clean {artist, title} from embedded TIT2 for all registry entries (no file re-probe)
reprobe_registry.jsRebuild meta_registry.json from scratch by re-probing ID3 with ffprobe

See Registry & Metadata.

Retagging

ToolPurpose
retag_files.jsWrite clean TIT2/TPE1 back into files in place (-c:a copy -id3v2_version 3)
retag_library.jsOne-shot clean reload: archive music to pro_archive/music_retag_<stamp>, clear registry, back up + truncate the download archive

See Retag tools.

Rundown — regenerate-rundown.js

Generates the per-category JSON rundown with ffprobe (defaults LOKLOK System / energy 5). See Rundown generation.

Smoke test — test-youtube-fetch.js

A standalone smoke test for the scheduler's fetchFromYouTube, fetching a test playlist (E:/radionew/playlists/test.m3u) to verify the YouTube integration works end-to-end.

Typical maintenance sequence

  1. Fix tags: reprobe_registry.jssanitize_registry.jsretag_files.js.
  2. Refresh content: run-content-pipeline.js --songs=20.
  3. Sync: sync-media-full.js (full) or rely on the engine's incremental sync.
  4. Inventory: regenerate-rundown.js.
  5. Verify: /api/content/status, /api/status, and the monitor page.