"use client"; import Link from "next/link"; import { useState, useTransition } from "react"; import { Button } from "yt-dlp-transcript-common/components/ui/button"; import { SOURCE_VIDEO_QUALITY_LABELS } from "yt-dlp-transcript-common/ytdlp/downloadFormat"; import type { PersistVideosActionResult } from "../../channels/[slug]/persistActions"; import type { PersistReplacePolicy } from "yt-dlp-transcript-common/controller/persistVideos"; import { persistVideoListAction } from "../persistListAction"; // "Save these videos" (release 32 R6): `pnpm ops persist-videos` from the UI — // a list of videos across channels saved to this store. Preview says what a run // would do with each (the plan's buckets) and starts nothing; Save is armed by // a preview of the same list and settings, and links the job per channel. type Format = "" | "original" | "video_720"; const sameKey = (text: string, format: Format, replace: PersistReplacePolicy) => JSON.stringify([text.trim(), format, replace]); export function PersistVideoListControl() { const [text, setText] = useState(""); const [format, setFormat] = useState(""); const [replace, setReplace] = useState("never"); const [previewed, setPreviewed] = useState(null); const [result, setResult] = useState(null); const [pending, start] = useTransition(); const key = sameKey(text, format, replace); const run = (dryRun: boolean) => start(async () => { const r = await persistVideoListAction({ text, ...(format ? { format } : {}), ...(replace !== "never" ? { replace } : {}), dryRun, }); setResult(r); if (dryRun && r.ok) setPreviewed(key); }); return (

Save these videos

One per line: channel/video-id, or a video page's link. Each channel's videos are downloaded whole into the store, paced like any download; a video already saved is skipped.