YouTube descriptions and a first comment after publish (YouTube + Instagram) - #309
Open
gynsus wants to merge 3 commits into
Open
YouTube descriptions and a first comment after publish (YouTube + Instagram)#309gynsus wants to merge 3 commits into
gynsus wants to merge 3 commits into
Conversation
Two per-platform meta fields, wired through web/API/MCP validation like Pinterest's board_id: - description (YouTube, ≤5000): full video description with clickable links; the publisher falls back to the post content when absent, so the pre-meta behavior is unchanged. - first_comment (YouTube + Instagram, ≤2200): posted by the account right after a successful publish — the classic home for links Instagram captions can't render and YouTube descriptions bury. Runs after markAsPublished and never fails the post; failures are logged. Instagram connects now request the manage-comments scope (existing accounts keep publishing; the first comment logs a permission error until reconnected). YouTube already held youtube.force-ssl.
The 100-char cap predates the per-platform meta: back then the whole content served as both title and description. Now the title comes from meta.title (validated at 100) or is auto-truncated by buildTitle, and the content lands in the description (5000) unless meta.description overrides it — yet a fully meta-equipped post still failed publish-time validation because the shared caption was longer than a title. Cap at 5000.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A YouTube Short published through TryPost gets its description built from the post text — which is also what the 100-character title cap was applied to, so any post longer than a tweet failed outright, and there was no way to give a Short the long, link-bearing description (5,000 chars, clickable URLs) that YouTube SEO actually runs on. The classic "link in the first comment" trick wasn't possible either.
What changed
meta.descriptionfor YouTube (≤ 5,000 chars, falls back to the post content): a dedicated panel in the editor's YouTube channel settings. The video title still comes from the post content's first line; the description is now its own field end to end.maxContentLengthfor YouTube was 100 — the title limit — so a 372-character post died with "content exceeds limit" even though it was only ever used as a description. It is now 5,000, and the title builder trims to 100 on its own.meta.first_commentfor YouTube (commentThreads.insert, ≤ 10,000 but capped at 2,200 to share the field with Instagram) and Instagram (/{media_id}/comments;instagram_manage_commentsjoins the requested scopes — existing IG connections need one reconnect to pick it up). Posting the comment happens after the post is marked published, in aFirstCommentPosterthat catches everything and only logs: a failed comment must never fail a published post.PostPlatformMetaRules, so the web editor, the REST API, and MCP all accept and persist them (fields without a rule there get silently stripped byvalidated()— covered by the meta persistence tests).Testing
YouTubePublisherTest,FirstCommentPosterTest,PostApiPlatformMetaTest,PostPlatformMetaToolTest, and the platform cap test pass. Battle-tested live: Shorts published with long descriptions + first comments on YouTube, first comments on Instagram.