Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat(music-video): Reddit posts go to r/aivideo as a native video

[._.]/ Adam Eivy7b6808841852
diff --git a/client/src/components/musicVideo/PublishPostingPanel.jsx b/client/src/components/musicVideo/PublishPostingPanel.jsx
index 05c0c81b31..650229b5ba 100644
--- a/client/src/components/musicVideo/PublishPostingPanel.jsx
+++ b/client/src/components/musicVideo/PublishPostingPanel.jsx
@@ -10,7 +10,7 @@ export const PUBLISH_TARGETS = [
{ target: 'shorts', label: 'YouTube Shorts', note: 'The newest 9:16 social cut' },
{ target: 'tiktok', label: 'TikTok', note: 'The newest 9:16 social cut, labelled AI-generated' },
{ target: 'instagram', label: 'Instagram Reels', note: 'The newest 9:16 social cut, with the AI label' },
- { target: 'reddit', label: 'Reddit', note: 'A text or link post to one subreddit' },
+ { target: 'reddit', label: 'Reddit', note: 'A native video post to r/aivideo (title and flair, no body)' },
{ target: 'stackerNews', label: 'Stacker News', note: 'A link post to the full video' },
];
@@ -35,9 +35,10 @@ function TargetOptions({ target, kit, options, setOption, flairs, idFor }) {
if (target === 'reddit') {
return (
<div className="grid sm:grid-cols-2 gap-2">
- {text('subreddit', 'Subreddit', 'SunoAI')}
+ {text('subreddit', 'Subreddit', 'aivideo')}
{field('kind', 'Post type',
- <select id={idFor('kind')} aria-label="Post type" value={options.kind || 'self'} onChange={(e) => setOption('kind', e.target.value)} className={inputCls}>
+ <select id={idFor('kind')} aria-label="Post type" value={options.kind || 'video'} onChange={(e) => setOption('kind', e.target.value)} className={inputCls}>
+ <option value="video">Video upload</option>
<option value="self">Text post</option>
<option value="link">Link to the full video</option>
</select>)}
diff --git a/docs/features/product-surfaces.md b/docs/features/product-surfaces.md
index db6727c019..77f56d9a78 100644
--- a/docs/features/product-surfaces.md
+++ b/docs/features/product-surfaces.md
@@ -110,7 +110,7 @@ An end-to-end creative production suite for authors, worldbuilders, filmmakers,
| **SongBook** | `/songbook` | Interactive chord charts, guitar tablature, lyric repertoire, and auto-scrolling practice sheet music. | — |
| **Creative Director** | `/creative-director` | Multi-scene episodic video production orchestrator: turn briefs into treatments, storyboards, render plans, and completed episodes. | — |
| **Creative Commissions** | `/creative-commission` | Standing briefs and scheduled/nightly autonomous media generation aligning with personal taste profiles and feedback. A universe and/or mood board can be picked as the style source: each run loads its style tags and reference images as the Creative Director's art-direction base, attaches those images to vision scene evaluation, and conditions local image renders on them. | — |
-| **Music Video Studio** | `/music-video` | A project opens on seven deep-linked stage tabs (`/music-video/:projectId/:stage` — `setup`, `cast-sets`, `board`, `produce`, `compose`, `review`, `publish`; a bottom tab bar on a phone) under a sticky header showing its progress, paid-generation spend against the cap, and the one next action for the stage it is in; the composition preview (or, without a composition document, the latest draft excerpt) is docked beside the Board, Compose and Review tabs, and scene cards seek it. Audio-reactive video creation, beat-detection synchronization, scene choreography, tempo alignment, and audience-driven pre-production treatments that direct each shot. Scenes are cutaways or lip-synced performance shots; a performance shot renders only on a verified source-audio provider (fal.ai MiniMax H3 lip-sync, 5–14.8s song slices placed at an exact edit in-point, cut from an optional full-length vocal stem when one is attached — uploaded, or separated from the song with a locally installed demucs) — Grok video is cutaway-only. The autopilot kickoff analyzes the song, imports the linked track's lyric sheet (its `[Verse]`/`[Chorus]` headers and stage directions kept as lyric markers that name the analysis sections and steer shot framing), separates the vocal, aligns every word with local whisper.cpp (large-v3-turbo, downloaded on first use), builds a Cast & Sets check-in (one creative-direction call that interprets the song, then a canonical character sheet, expression and looks sheets, one empty plate per set and in-set tests on the image queue, each later image conditioned on the character sheet; assembled into a self-contained sheet saved as a development artifact), stops for the director's review unless the brief auto-approves it, then plans against the approved references. Development artifacts (check-in sheets, animatics, treatments, storyboards; HTML/Markdown/MP4/PNG/JPG) are versioned per project, reviewed with notes and approve/request-changes, and viewed in a sandboxed viewer at `/music-video/:projectId/:stage/dev/:artifactId` (the stage-less `/music-video/:projectId/dev/:artifactId` still opens it). Draft excerpts are reviewed and selectively revised by hand, or by an opt-in auto-review run bounded by director-set review and paid-generation limits (a frame-only look never passes motion or audio sync). A server-owned production run (`/api/music-video/:id/production-runs`, #9066) plans an empty board, generates missing frames and clips only on a director-allowed image/video provider+model pool, hands the continuous draft to auto-review and dispatches its revisions — within explicit generation, review and (priced routes only) dollar limits, without the browser open, and never resuming on its own after a restart; the song is the sole audio unless a sound-design bed is explicitly chosen to mix under it. A footage or composed render can intercut (#9290): shots are re-cut on the song's section energy (every 2 beats in the loudest quarter, up to every 8 in the quietest) and on sung word onsets, alternating the host shot — a lip-synced take stays in sync — with unshown footage from a cutaway in the same section, so the edit gets faster without generating more clips; an autopilot production run defaults to it unless the director chose one cut per shot. Lyric lines sung two or more times are hooks: the treatment's text cues give them a word-by-word build (#9291) — each word lands on its sung onset in heavy caps, the newest in the accent color. Draft excerpts can be re-framed as vertical or square social cuts with faded audio edges, from suggested hook windows (#9280). The Publish stage (#9281) builds a release kit from the final render: an X-sized 1080p, a 720p preview, a hook teaser, thumbnail candidates, lyric captions (SRT) and YouTube chapters. It also drafts every platform's copy in one director-triggered provider call from their own making-of notes, and every field stays editable. Posting (#9282) fills each platform's post (YouTube, Suno, an X thread, Shorts, TikTok, Instagram Reels, Reddit, Stacker News) in a new PortOS Browser tab with the director's signed-in sessions, shows a screenshot and summary of the filled draft, and posts only when the director presses Post for that draft; the posted links are kept on the project. Platforms are opt-in (#9287): a "Where you post" list turns each one on (all start off) and optionally names the account posted as — X and Reddit drafts filled while signed in as someone else are refused. Copy is drafted and posts are offered only for enabled platforms. Each post (including one recorded by hand) can be rated good, mixed or poor with notes; ratings roll up per platform across projects and are passed to later copy drafts. | — |
+| **Music Video Studio** | `/music-video` | A project opens on seven deep-linked stage tabs (`/music-video/:projectId/:stage` — `setup`, `cast-sets`, `board`, `produce`, `compose`, `review`, `publish`; a bottom tab bar on a phone) under a sticky header showing its progress, paid-generation spend against the cap, and the one next action for the stage it is in; the composition preview (or, without a composition document, the latest draft excerpt) is docked beside the Board, Compose and Review tabs, and scene cards seek it. Audio-reactive video creation, beat-detection synchronization, scene choreography, tempo alignment, and audience-driven pre-production treatments that direct each shot. Scenes are cutaways or lip-synced performance shots; a performance shot renders only on a verified source-audio provider (fal.ai MiniMax H3 lip-sync, 5–14.8s song slices placed at an exact edit in-point, cut from an optional full-length vocal stem when one is attached — uploaded, or separated from the song with a locally installed demucs) — Grok video is cutaway-only. The autopilot kickoff analyzes the song, imports the linked track's lyric sheet (its `[Verse]`/`[Chorus]` headers and stage directions kept as lyric markers that name the analysis sections and steer shot framing), separates the vocal, aligns every word with local whisper.cpp (large-v3-turbo, downloaded on first use), builds a Cast & Sets check-in (one creative-direction call that interprets the song, then a canonical character sheet, expression and looks sheets, one empty plate per set and in-set tests on the image queue, each later image conditioned on the character sheet; assembled into a self-contained sheet saved as a development artifact), stops for the director's review unless the brief auto-approves it, then plans against the approved references. Development artifacts (check-in sheets, animatics, treatments, storyboards; HTML/Markdown/MP4/PNG/JPG) are versioned per project, reviewed with notes and approve/request-changes, and viewed in a sandboxed viewer at `/music-video/:projectId/:stage/dev/:artifactId` (the stage-less `/music-video/:projectId/dev/:artifactId` still opens it). Draft excerpts are reviewed and selectively revised by hand, or by an opt-in auto-review run bounded by director-set review and paid-generation limits (a frame-only look never passes motion or audio sync). A server-owned production run (`/api/music-video/:id/production-runs`, #9066) plans an empty board, generates missing frames and clips only on a director-allowed image/video provider+model pool, hands the continuous draft to auto-review and dispatches its revisions — within explicit generation, review and (priced routes only) dollar limits, without the browser open, and never resuming on its own after a restart; the song is the sole audio unless a sound-design bed is explicitly chosen to mix under it. A footage or composed render can intercut (#9290): shots are re-cut on the song's section energy (every 2 beats in the loudest quarter, up to every 8 in the quietest) and on sung word onsets, alternating the host shot — a lip-synced take stays in sync — with unshown footage from a cutaway in the same section, so the edit gets faster without generating more clips; an autopilot production run defaults to it unless the director chose one cut per shot. Lyric lines sung two or more times are hooks: the treatment's text cues give them a word-by-word build (#9291) — each word lands on its sung onset in heavy caps, the newest in the accent color. Draft excerpts can be re-framed as vertical or square social cuts with faded audio edges, from suggested hook windows (#9280). The Publish stage (#9281) builds a release kit from the final render: an X-sized 1080p, a 720p preview, a hook teaser, thumbnail candidates, lyric captions (SRT) and YouTube chapters. It also drafts every platform's copy in one director-triggered provider call from their own making-of notes, and every field stays editable. Posting (#9282) fills each platform's post (YouTube, Suno, an X thread, Shorts, TikTok, Instagram Reels, Reddit, Stacker News) in a new PortOS Browser tab with the director's signed-in sessions, shows a screenshot and summary of the filled draft, and posts only when the director presses Post for that draft; the posted links are kept on the project. Reddit defaults to a native video post in r/aivideo — title and flair, no body — through the new composer's own Video button (#9307). Platforms are opt-in (#9287): a "Where you post" list turns each one on (all start off) and optionally names the account posted as — X and Reddit drafts filled while signed in as someone else are refused. Copy is drafted and posts are offered only for enabled platforms. Each post (including one recorded by hand) can be rated good, mixed or poor with notes; ratings roll up per platform across projects and are passed to later copy drafts. | — |
| **Sharing & Conflict Resolution** | `/sharing`, `/sharing/duplicates`, `/sharing/conflicts` | Collaborative asset exchange via cloud storage buckets (Google Drive, Dropbox, iCloud, Syncthing) with duplicate reconciliation and conflict recovery journals. | — |
---
diff --git a/server/lib/musicVideoValidation.js b/server/lib/musicVideoValidation.js
index ade7864f92..733f492a36 100644
--- a/server/lib/musicVideoValidation.js
+++ b/server/lib/musicVideoValidation.js
@@ -582,7 +582,7 @@ export const musicVideoPublishPostSchema = z.object({
}).partial().strict().refine((b) => Object.keys(b).length > 0, { message: 'url, reception or notes is required' });
export const musicVideoPublishPrepareSchema = z.object({
subreddit: z.string().max(40),
- kind: z.enum(['self', 'link']),
+ kind: z.enum(['self', 'link', 'video']),
url: publishUrl,
flairId: z.string().max(100),
flairText: z.string().max(64),
diff --git a/server/services/musicVideo/publish/payloads.js b/server/services/musicVideo/publish/payloads.js
index a82b756b63..c8e714dd29 100644
--- a/server/services/musicVideo/publish/payloads.js
+++ b/server/services/musicVideo/publish/payloads.js
@@ -8,6 +8,7 @@ import { ServerError } from '../../../lib/errorHandler.js';
import { chaptersText } from '../publishKitText.js';
const TITLE_LIMITS = { youtube: 100, shorts: 100, reddit: 300, stackerNews: 80 };
+const DEFAULT_SUBREDDIT = 'aivideo';
const missing = (message) => new ServerError(message, { status: 422, code: 'PUBLISH_ASSET_MISSING' });
const text = (v) => (typeof v === 'string' ? v.trim() : '');
@@ -88,15 +89,27 @@ const BUILDERS = {
return { posts };
},
reddit: (project, kit, options = {}) => {
- const subreddit = text(options.subreddit).replace(/^\/?r\//i, '');
+ // r/aivideo is the default (#9307): a native video post, title + flair, no
+ // body. Showcase posts to tool-support subs (r/ClaudeAI, r/SunoAI) landed poorly.
+ const subreddit = (text(options.subreddit) || DEFAULT_SUBREDDIT).replace(/^\/?r\//i, '');
if (!/^[A-Za-z0-9_]{2,21}$/.test(subreddit)) throw missing('Name the subreddit to post in');
+ const kind = ['self', 'link', 'video'].includes(options.kind) ? options.kind : 'video';
const title = requireTitle('reddit', text(kit.copy?.reddit?.title));
// r/SunoAI removes song posts whose title doesn't open with the genre in brackets.
if (subreddit.toLowerCase() === 'sunoai' && !/^\[[^\]]+\]/.test(title)) throw missing('r/SunoAI titles must start with the genre in brackets, e.g. [Electropop] Song Name');
- const url = options.kind === 'link' ? (text(options.url) || fullVideoUrl(kit)) : '';
- if (options.kind === 'link' && !url) throw missing('A Reddit link post needs the full video URL');
+ // r/aivideo removes posts whose title doesn't name the video.
+ if (subreddit.toLowerCase() === 'aivideo' && project?.name && !title.toLowerCase().includes(String(project.name).toLowerCase())) {
+ throw missing(`r/aivideo titles must include the video's name ("${project.name}")`);
+ }
+ let video = null;
+ if (kind === 'video') {
+ if (!kit.master?.filename) throw missing('Build the publishing kit first — a Reddit video post uploads the final render');
+ video = { dir: 'videos', name: kit.master.filename };
+ }
+ const url = kind === 'link' ? (text(options.url) || fullVideoUrl(kit)) : '';
+ if (kind === 'link' && !url) throw missing('A Reddit link post needs the full video URL');
return {
- subreddit, kind: options.kind === 'link' ? 'link' : 'self', title, body: text(kit.copy?.reddit?.body), url,
+ subreddit, kind, title, body: kind === 'video' ? '' : text(kit.copy?.reddit?.body), url, video,
flairId: text(options.flairId) || null, flairText: text(options.flairText) || null, firstComment: text(options.firstComment) || null,
};
},
diff --git a/server/services/musicVideo/publish/payloads.test.js b/server/services/musicVideo/publish/payloads.test.js
index 65b29a15f3..89f0476652 100644
--- a/server/services/musicVideo/publish/payloads.test.js
+++ b/server/services/musicVideo/publish/payloads.test.js
@@ -74,11 +74,15 @@ describe('buildPublishPayload (#9282)', () => {
expect(p).toMatchObject({ url: 'https://www.youtube.com/watch?v=posted', territory: 'art', title: 'Song' });
});
- it('validates Reddit subreddits and r/SunoAI\'s genre-bracket title rule', () => {
+ it('posts a native video to r/aivideo by default, and validates other subreddits\' rules', () => {
+ const named = (over = {}) => ({ ...project({ copy: { reddit: { title: 'Song Name — a music video', body: 'Body' } }, ...over }), name: 'Song Name' });
+ expect(buildPublishPayload('reddit', named(), {})).toMatchObject({ subreddit: 'aivideo', kind: 'video', video: { dir: 'videos', name: 'master.mp4' }, body: '' });
+ expect(() => buildPublishPayload('reddit', { ...named(), name: 'Other Title' }, {})).toThrow(/include the video's name/);
+ expect(() => buildPublishPayload('reddit', named({ master: null }), {})).toThrow(/final render/);
expect(buildPublishPayload('reddit', project(), { subreddit: 'r/SunoAI', kind: 'link' })).toMatchObject({ subreddit: 'SunoAI', kind: 'link', url: 'https://youtu.be/abc' });
- expect(buildPublishPayload('reddit', project(), { subreddit: 'aivideo' })).toMatchObject({ kind: 'self', url: '' });
- expect(() => buildPublishPayload('reddit', project(), {})).toThrow(/subreddit/);
- expect(() => buildPublishPayload('reddit', project({ copy: { reddit: { title: 'Song' } } }), { subreddit: 'SunoAI' })).toThrow(/brackets/);
+ expect(buildPublishPayload('reddit', project(), { subreddit: 'aimusic', kind: 'self' })).toMatchObject({ kind: 'self', url: '', video: null, body: 'Body' });
+ expect(() => buildPublishPayload('reddit', project(), { subreddit: 'x' })).toThrow(/subreddit/);
+ expect(() => buildPublishPayload('reddit', project({ copy: { reddit: { title: 'Song' } } }), { subreddit: 'SunoAI', kind: 'self' })).toThrow(/brackets/);
});
it('needs a suno.com song URL and captions it with the full video', () => {
diff --git a/server/services/musicVideo/publish/reddit.js b/server/services/musicVideo/publish/reddit.js
index 601690b48a..a0da313dd0 100644
--- a/server/services/musicVideo/publish/reddit.js
+++ b/server/services/musicVideo/publish/reddit.js
@@ -1,36 +1,111 @@
/**
- * Reddit adapter (#9282). The new composer's video tool ignores files set by
- * automation, so this posts a text or link post through old.reddit's own
- * `/api/submit` with the signed-in session's modhash. prepare() checks the
- * session and reads the subreddit's rules and post flairs (so the director
- * sees what the sub requires before posting); submit() posts, then adds the
- * optional first comment.
+ * Reddit adapter (#9282, #9307).
+ *
+ * Video posts (the default, aimed at r/aivideo): the new composer at
+ * www.reddit.com/r/<sub>/submit. Its file input only accepts a file from the
+ * chooser a trusted click on its Video button opens (setting the hidden input
+ * directly is ignored), so prepare() clicks Video and answers the chooser,
+ * types the title, and picks the flair in the flair modal. submit() presses
+ * Post and finds the new post in the account's submissions.
+ *
+ * Text and link posts go through old.reddit's own `/api/submit` with the
+ * session's modhash. prepare() checks the session and reads the subreddit's
+ * rules and post flairs either way, so the director sees what the sub requires
+ * before posting; submit() posts, then adds the optional first comment.
*/
import { ServerError } from '../../../lib/errorHandler.js';
import { PUBLISH_STEP_TIMEOUT_MS as T, loginRequired, step } from './browser.js';
const BASE = 'https://old.reddit.com';
+const WWW = 'https://www.reddit.com';
const label = 'Reddit';
+/** The signed-in account, the sub's rules and its selectable flairs, read from the page's own session. */
+function readSubreddit(page, subreddit) {
+ return page.evaluate(async (sub) => {
+ const me = await (await fetch('/api/me.json', { credentials: 'include' })).json().catch(() => ({}));
+ if (!me?.data?.name) return { user: null };
+ const rules = await (await fetch(`/r/${sub}/about/rules.json`)).json().catch(() => ({}));
+ const flairs = await (await fetch(`/r/${sub}/api/link_flair_v2.json?uh=${me.data.modhash}`, { credentials: 'include' })).json().catch(() => []);
+ return {
+ user: me.data.name,
+ rules: (rules.rules || []).map((r) => r.short_name).slice(0, 15),
+ flairs: Array.isArray(flairs) ? flairs.filter((f) => !f.mod_only).map((f) => ({ id: f.id, text: f.text.trim() })).slice(0, 200) : [],
+ };
+ }, subreddit);
+}
+
+async function prepareVideo(page, payload) {
+ const submitUrl = `${WWW}/r/${payload.subreddit}/submit/?type=MEDIA`;
+ await step(label, 'open the composer', () => page.goto(submitUrl, { waitUntil: 'domcontentloaded', timeout: T }));
+ await page.waitForTimeout(3000);
+ const info = await step(label, 'read the subreddit', () => readSubreddit(page, payload.subreddit));
+ if (!info.user) throw loginRequired(label, `${WWW}/login`);
+ await step(label, 'attach the video', async () => {
+ const [chooser] = await Promise.all([
+ page.waitForEvent('filechooser', { timeout: T }),
+ page.locator('post-composer-standalone-toolbar button').filter({ hasText: 'Video' }).first().click({ timeout: T }),
+ ]);
+ await chooser.setFiles(payload.video.path);
+ });
+ await step(label, 'set the title', async () => {
+ await page.locator('post-composer-title textarea[name=title]').click({ timeout: T });
+ await page.keyboard.insertText(payload.title);
+ });
+ const flair = payload.flairId ? info.flairs.find((f) => f.id === payload.flairId) : null;
+ if (flair) {
+ await step(label, 'pick the flair', async () => {
+ await page.locator('#reddit-post-flair-button').click({ timeout: T });
+ await page.waitForTimeout(1200);
+ // The modal lists a few flairs until searched; searching surfaces the one we want.
+ await page.getByPlaceholder('Search').last().click({ timeout: T });
+ await page.keyboard.insertText(flair.text);
+ await page.waitForTimeout(1200);
+ await page.locator(`faceplate-radio-input[value="${flair.id}"]`).first().click({ timeout: T });
+ await page.locator('r-post-flairs-modal button').filter({ hasText: /^\s*Add\s*$/ }).first().click({ timeout: T });
+ });
+ }
+ await step(label, 'wait for the upload', () => page.waitForFunction(() => {
+ const find = (root) => {
+ for (const el of root.querySelectorAll('*')) {
+ if (el.id === 'inner-post-submit-button') return el;
+ if (el.shadowRoot) { const hit = find(el.shadowRoot); if (hit) return hit; }
+ }
+ return null;
+ };
+ const button = find(document);
+ return button && !button.disabled && button.getAttribute('aria-disabled') !== 'true';
+ }, null, { timeout: 600_000 }));
+ return {
+ account: info.user, subreddit: payload.subreddit, kind: 'video', title: payload.title,
+ flairText: flair?.text || null, rules: info.rules, flairs: info.flairs,
+ ...(payload.flairId && !flair ? { warning: 'That flair is not offered in this subreddit — pick one and fill again' } : {}),
+ };
+}
+
+async function submitVideo(page, payload) {
+ await step(label, 'post', () => page.locator('#inner-post-submit-button').click({ timeout: T }));
+ await step(label, 'wait for it to post', () => page.waitForURL((url) => !/\/submit/.test(url.toString()), { timeout: 180_000 }));
+ const url = await step(label, 'find the new post', () => page.evaluate(async (title) => {
+ const me = await (await fetch('/api/me.json', { credentials: 'include' })).json();
+ const list = await (await fetch(`/user/${me.data.name}/submitted.json?limit=5`, { credentials: 'include' })).json();
+ const hit = (list?.data?.children || []).map((c) => c.data).find((d) => d.title === title);
+ return hit ? `https://www.reddit.com${hit.permalink}` : null;
+ }, payload.title));
+ return { url };
+}
+
export const redditAdapter = {
label,
async prepare(page, payload) {
+ if (payload.kind === 'video') return prepareVideo(page, payload);
await step(label, 'open Reddit', () => page.goto(`${BASE}/r/${payload.subreddit}/`, { waitUntil: 'domcontentloaded', timeout: T }));
- const info = await step(label, 'read the subreddit', () => page.evaluate(async (sub) => {
- const me = await (await fetch('/api/me.json', { credentials: 'include' })).json().catch(() => ({}));
- if (!me?.data?.name) return { user: null };
- const rules = await (await fetch(`/r/${sub}/about/rules.json`)).json().catch(() => ({}));
- const flairs = await (await fetch(`/r/${sub}/api/link_flair_v2.json?uh=${me.data.modhash}`, { credentials: 'include' })).json().catch(() => []);
- return {
- user: me.data.name,
- rules: (rules.rules || []).map((r) => r.short_name).slice(0, 15),
- flairs: Array.isArray(flairs) ? flairs.filter((f) => !f.mod_only).map((f) => ({ id: f.id, text: f.text })).slice(0, 60) : [],
- };
- }, payload.subreddit));
+ const info = await step(label, 'read the subreddit', () => readSubreddit(page, payload.subreddit));
if (!info.user) throw loginRequired(label, `${BASE}/login`);
return { account: info.user, subreddit: payload.subreddit, kind: payload.kind, title: payload.title, flairText: payload.flairText, rules: info.rules, flairs: info.flairs };
},
async submit(page, payload) {
+ if (payload.kind === 'video') return submitVideo(page, payload);
const result = await step(label, 'post', () => page.evaluate(async (p) => {
const me = await (await fetch('/api/me.json', { credentials: 'include' })).json();
const form = new URLSearchParams({