Downloads a video with yt-dlp. Does not require the app to be running. yt-dlp is not bundled: install it separately (brew install yt-dlp, or pipx install yt-dlp). If it is not on PATH, the command exits 1 with an install hint; set YT_DLP_PATH to point at a specific binary.
This writes the file to disk only. To pull a downloaded file into the open project, add it afterwards: dapi asset add <path> (see asset add).
<url>: the video or page URL to download.
-o, --output <path>: output file path or directory (yt-dlp-otemplate). Default: yt-dlp's own default template in the current directory.-f, --format <selector>: yt-dlp format selector, e.g."bv*+ba/b". Default: prefer mp4/m4a streams and remux the result to.mp4(--merge-output-format mp4), falling back to the best available if no mp4 source exists.-a, --audio: extract audio only (yt-dlp-x). Takes precedence over the mp4 default.
Forward raw yt-dlp flags after --; they are appended verbatim:
dapi fetch https://youtu.be/xyz -f "bv*+ba/b" -- --sponsorblock-remove all --limit-rate 2MJSON Lines, one per file written (a single URL can yield several, e.g. a playlist):
{ path: string } // absolute path of the file on disk, after any extraction / renameDownload progress is rendered by yt-dlp on stderr while the command runs.
- The resolved path comes from yt-dlp's
after_move:filepath, so it reflects the real name after audio extraction or renaming, not a guess. - Exit code is
0on success; on failure the command surfaces yt-dlp's exit code and prints its stderr.