yt-to-post is a WordPress plugin for editors who cover video. It turns one YouTube video into one draft. The words come from captions downloaded through the official YouTube Data API under your own OAuth connection, or from a transcript you supply. A language model writes a structured article from them, with the video embedded and the source credited. An editor reads, fixes and publishes it. The code is at https://github.com/IndianOpinion/yt-to-post, licensed MIT. Version v0.1.0 was released on 19 November 2026.
We wrote it from scratch from an idea, not from any third-party plugin. It has not run against the real YouTube API or on a live site. The 47 utilities in this series were specified, built, reviewed and released between 11 and 19 November 2026 by language-model coding agents under the editor’s direction, in five roles: a spec writer, a spec reviewer, a builder that saw only the spec, an independent code reviewer and a releaser. The editor made the rulings on every open question.
Editors who cover interviews, speeches and briefings write the same article by hand each time: watch the video, find the quotes, note the timestamps, write it up, embed the player, add the credit. The obvious shortcuts are wrong or fragile. The PRD lists why:
[Music].wp yt-to-post commands.Each job is a row that a runner advances one unit at a time, saving after every step. The steps are metadata, captions, normalise, map, reduce and draft. A short transcript takes one model call. A long one is split into chunks, on chapter starts when there are chapters. Each chunk becomes notes that are saved at once, and a reduce call writes the article from the notes. A failure therefore never pays twice for the same chunk.
Source text goes only in the user message, fenced as untrusted data. The model’s output must fit a JSON schema. A QuoteVerifier then checks every quote word for word against the transcript and takes its time from the cue where it begins. Quotes that are not found are dropped and counted in the draft notes. A LanguageCheck compares the article language with the requested one by looking at the letters, with one retry.
The draft is written as block markup with wp_insert_post, with the status forced to draft or pending after every filter has run.
define('YT_TO_POST_CLIENT_ID', '...apps.googleusercontent.com');
define('YT_TO_POST_CLIENT_SECRET', '...');
define('YT_TO_POST_LLM_API_KEY', '...');
With spend-meter present, each model call is checked first through spend_meter_pre_spend and reported afterwards through spend_meter_record. With gen-queue present, the plugin registers a job type and enqueues through the soft filter, and falls back to its own WP-Cron runner if no job id comes back. Neither is required.
draft and pending are possible.yt_to_post_can_run filter fresh. Defaults are 10 videos and 200 model calls a day. A cap of 0 means no new work. A held job resumes on its own when the reason clears.invalid_grant from Google asks you to reconnect rather than looping.The independent code review found and fixed these before the merge:
null pre-spend answer as a deny, and called hooks that do not exist. It was rebuilt against the released contracts of both plugins.enabled, was forced to false. Fixed with a regression test.There are no open issues. This is v0.1.0, tested on stubs, mocks and fakes: 148 PHPUnit tests against fakes for the network and the clock, with a mock model. Static analysis and code style checks passed. In the suite, a 60-minute captioned talk becomes a draft in 4 mock model calls, with every quote found word for word in the transcript. The suite did not exercise the live API. CI has not yet run on GitHub: the commit adding the workflow stayed local because the token lacked the workflow scope.
It needs WordPress 6.4 or later, PHP 8.1 or later, with json, mbstring, dom and libxml, and sodium or WordPress’s polyfill. The model caller comes from llm-json-php, a Composer dependency that is never bundled.
composer config repositories.llm-json-php vcs https://github.com/IndianOpinion/llm-json-php
composer config repositories.yt-to-post vcs https://github.com/IndianOpinion/yt-to-post
composer require indianopinion/yt-to-post
Without Composer, run composer install --no-dev inside the plugin folder, or plug in your own model caller with the yt_to_post_model_caller filter.