Volt Download Manager
  1. ホーム
  2. ヘルプ
  3. コマンドラインと自動化

コマンドラインと自動化

VDM can be driven without its window in three ways:

  • アプリ独自のコマンドライン。IDMと同じスイッチを使って、スクリプト、バッチファイル、または別のプログラムから実行中のアプリにダウンロードを渡します。
  • voltdownloadmanager-cli。別のコマンドラインツールです。アプリを使わず、ターミナルで進行状況を確認しながらファイル、動画、トレントをダウンロードできます。
  • The automation API: other programs list the running app's downloads (as JSON) and pause, start, remove or delete them, over a local, token-protected channel. AI assistants use it through VDM's MCP server: see AI assistants.

To run the whole app without a window, on a home server or a NAS, see Run VDM on a server (voltdownloadmanager --headless); to control it from a phone, Control VDM from your phone.

例ではWindowsのパスを使用しています。macOSとLinuxでは、プログラムは.exeなしで同じ名前です。

アプリのコマンドライン

voltdownloadmanager.exe /d URL [/p folder] [/f name] [/a] [/n] [/s]
スイッチ 機能
/d URL ダウンロードするアドレス。
/p folder このフォルダーに保存します(それ以外の場合は、オプション → 保存先で設定されたカテゴリのフォルダー)。
/f name この名前で保存します。
/a 開始せずにメインのダウンロードキューに追加します。
/n サイレント: ダウンロード ファイル情報ウィンドウは表示されず、ダウンロードはすぐに開始されます(または/aでキューに入れられます)。
/s メインのダウンロードキューを開始します。
/exit 実行中のアプリを保存して閉じます(インストーラーはアップグレード前にこれを使用します)。
/startup Start in the notification area, the window hidden: what Launch Volt Download Manager on startup starts VDM with when you sign in. Where no notification area shows VDM's icon (some Linux desktops), VDM starts minimized. A running VDM stays as it is.
.torrentファイルまたはmagnet:リンク Open it in Add torrent (what Windows passes when VDM opens torrents).

Switches can start with / or -, in any case. If VDM is running, the command goes to it; if not, VDM starts and carries it out. For example:

voltdownloadmanager.exe /d https://example.com/files/report.pdf /p D:\Reports /n
voltdownloadmanager.exe /d https://example.com/big.iso /a
voltdownloadmanager.exe /s

voltdownloadmanager-cli

It comes with every download of VDM, next to the app (the installer puts it in VDM's folder). It works on its own: the app needn't run, except for status and api.

Its downloads leave the way the app's do: through Options → Proxy / Socks (no proxy, Use system settings with its HTTPS_PROXY / HTTP_PROXY / ALL_PROXY variables and the system's automatic configuration script, an automatic configuration script, fetched before the command starts, or a manual proxy with its login) and its Network adapter, with the DNS of Options → Connection. That covers get, resume, the video, playlist and gallery commands (yt-dlp and gallery-dl too), the install-* commands, and torrents when Torrent settings' Use the proxy is on. For one run, --proxy takes the place of Options' proxy: none (direct, yt-dlp and gallery-dl too, whatever the system's proxy), system, or a proxy's address, http://127.0.0.1:7890, https://…, socks5://…, socks5h://… (the proxy looks the sites' names up), socks4://…, socks4a://…. A password is never taken on the command line, where other programs can read it: write the user name in the address (socks5://ann@127.0.0.1:1080) and put the password in the VDM_PROXY_PASSWORD environment variable. get and resume also have --dns and --adapter, and video-get and gallery-get --adapter (any for none), for the same.

コマンド 機能
get URL [-o folder\|file] [-c connections] [-H "Header: value"]... [-r referer] [--user-agent agent] [--cookie cookie] [--checksum hash] [--dns choice] [--adapter name] [--proxy proxy] Download a file with up to 8 connections (-c, 1 to 128), showing progress. Ctrl+C pauses it; resume continues. -r sets the referring page address (Referer header), --user-agent sets the request's User-Agent (then the only one sent; without it, VDM speaks as your default browser, and, when a site's bot check refuses that and the way a browser connects too, once more under its own name), --cookie sets the Cookie header (a cookie on the command line ends up in the shell's history; - reads it from standard input instead). --checksum checks the finished file: hex MD5, SHA-1, SHA-256, SHA-512 or CRC32, optionally named (sha256:…); a file that doesn't match fails. Without it, a checksum the server sends is checked, and a file that doesn't match it is kept with a warning: line (see Verify checksum). --dns picks the DNS instead of Options': system; a service and how to ask it, cloudflare-https, quad9-tls, google-plain, adguard-https, nextdns-tls; DNS servers' addresses, 9.9.9.9,149.112.112.112; or a DNS-over-HTTPS address. It never falls back to the system's DNS. --adapter sends every connection through one network adapter instead of Options' (any for none), by its name (Ethernet, wg0) or one of its addresses; when it isn't connected, nothing is sent and the download fails. --proxy takes the place of Options' proxy for this run (see above). The app's site rules for the address apply too (their headers, User-Agent, browser-like connection, number of connections and proxy), where the command line gives none of the same: --proxy goes before every rule's proxy. A link from a file host that one of your debrid accounts (Options → Accounts) supports goes through that account, as in the app, and get says through Real-Debrid; --direct downloads the address itself (Debrid service accounts).
resume file.vdm.json [-c connections] [-H ...] [-r referer] [--user-agent agent] [--cookie cookie] [--checksum hash] [--dns choice] [--adapter name] [--proxy proxy] [--direct] 一時停止または中断されたダウンロードを、隣接する .vdm.json ファイルから再開します。-r、--user-agent、--cookie は追加のヘッダーを設定します (- は標準入力から Cookie を読み取ります)。--checksum は、その実行のために完了したファイルを検証します。--dns、--adapter、--proxy は、get と同様に、接続の DNS、ネットワーク アダプター、プロキシを設定し、アプリのサイト ルールは get と同様に適用されます。デブリットアカウント経由の場合、get と同様に、古いリンクの期限が切れたときにサービスが新しいリンクを提供します。--direct はアドレス自体から再開します。
install-gallery-dl 画像ギャラリー用のgallery-dlをインストールまたは更新します。そのチェックサムリストは作者の署名キーと照合され、プログラムはそのリストと照合されます(WindowsおよびLinux x86-64の場合。それ以外の場合はご自身でインストールしてください)。
gallery-get URL [-o folder] [--limit N] [--adapter name] Download a gallery's pictures (a Wikimedia Commons category, a Flickr album, ...) into a folder named after it inside -o; --limit takes at most that many, the first the site lists. Started again, it fetches only the new ones. VDM's own downloader brings the pictures gallery-dl lists, 4 at a time. --adapter sends the connections, VDM's and gallery-dl's, through one network adapter, as for get.
video-info URL ページに含まれるビデオ(YouTube、Vimeoなど)と、選択できる品質。
playlist-info URL [--from N] [--count N] プレイリストまたはチャンネルの動画を、表示順に1行ずつ出力します。各行には位置、長さ、タイトル、アドレスが含まれます。
playlist-get URL [-f selector] [-o folder] [-c pieces] [--split-chapters] [--from N] [--count N] プレイリストまたはチャンネルの動画を、-o 内のリスト名にちなんだフォルダーに連続してダウンロードします。-f は、video-get と同様に、すべての動画に 1 つの品質を設定します (既定では各動画の最高の品質。bv*[height<=720]+ba/b[height<=720] = 最大 720p。bv[vcodec^=avc]+ba[acodec^=mp4a]/b[vcodec^=avc][acodec^=mp4a] = 最も互換性のある形式、H.264 と AAC。ba = オリジナル サウンド。mp3:320、opus:、flac: は video-get と同様)。-c と --split-chapters は video-get と同様。
video-get URL [-f selector \| -q height\|compatible] [-o folder] [-c pieces] [--subs langs] [--auto-subs] [--embed-subs] [--split-chapters] [--adapter name] Download a video. Without -f or -q, the best quality, the one the Download video window starts on: with ffmpeg the best picture with the best sound joined to it (a site whose pictures and sounds come apart, such as Bilibili, needs ffmpeg for a video), else the best file with both. -q 1080 (or 720p) takes that height, or the nearest below it the page offers (else the nearest above), and says so. -q compatible takes the most compatible quality, as the window's Most compatible (H.264 + AAC): the best H.264 picture with AAC sound, in an MP4 that plays in every editor, TV and phone; a page without one says so (nothing is converted). -f takes a quality's selector from video-info (b = the best single file; ba = the sound alone as the site has it, not converted; mp3:320, mp3:256, mp3:192 or mp3:128 = the sound as an MP3 at that bitrate, mp3:0 at its best variable one; opus: = as Opus; flac: = as FLAC, lossless but no better than the site's sound; conversions need ffmpeg). -c: VDM's own downloader brings each stream yt-dlp finds over this many connections (8 by default, 1 to 128), a stream in pieces (HLS, DASH) this many pieces at once. --subs saves subtitles beside it: language codes from video-info (en,fr), or all for every one the uploader gave; --auto-subs takes the site's automatic captions instead; --embed-subs puts them into the video (needs ffmpeg, MP4 or MKV). With ffmpeg, the video's chapters go into the file too, as Download video's Embed chapters does. --split-chapters splits the video into numbered chapter files without re-encoding, beside the main video. --adapter sends the downloads' connections, and yt-dlp's (and ffmpeg's), through one network adapter, as for get; when it isn't connected, nothing starts. When no format of the page matches, the error lists the ones it offers, as video-info does.
update-helpers Check VDM's own helpers (yt-dlp, ffmpeg, gallery-dl, Node.js) for newer versions now, install them (each checked as its first install was), and print their versions. A helper a download is using switches to its new version once that download ends. Programs you chose in Helpers, and your system's, are yours to update.
install-ytdlp、install-ffmpeg、install-js-runtime Install or update the helpers videos need: yt-dlp (checked against its signing key), ffmpeg (x64 and ARM64 Windows, a build in VDM's signed list of checked builds; on macOS and Linux VDM uses the system's, and on 32-bit Windows one you choose in Helpers) and VDM's own JavaScript runtime, which yt-dlp needs for YouTube's qualities: Node.js's newest LTS build (its checksum list checked against Node.js's releasers' keys; Windows, Linux and macOS). A runtime already on your computer, or one chosen in Helpers, is still used first, and the command says so. install-deno, its earlier name, does the same.
torrent-info SOURCE トレントの名前、ファイル(番号付き)、サイズ。SOURCEはマグネットリンクまたは.torrentファイルです。
torrent-get SOURCE [-o folder] [--files 0,2] [--use-existing] トレント、またはその一部のファイルのみをダウンロードします。一部のファイルが既にフォルダーにある場合、ダウンロードは停止し、ファイル名が表示されます。--use-existing は代わりにそれらを使用します (一致するものは保持され、残りはダウンロードされます)。[トレント設定]の この公開リストのトラッカーを公開トレントに追加する がオンの場合、アプリと同様に、公開トレントにもリストのトラッカーが追加されます。
torrent-create PATH -o file.torrent ファイルまたはフォルダーの.torrentを作成します。フォルダー内のファイルは名前順にリストされます (ピアは DHT を介してそれを見つけます)。
status [--id N] [-s status] [--search text] [-c category] [-q queue] [-l limit](または list) 実行中のアプリのダウンロードを JSON 形式で、その ID とともに表示します (オートメーション API がオンになっている必要があります)。オプションのフラグは、ID、ステータス、検索文字列、カテゴリ、キューでフィルタリングしたり、カウントを制限したりします。
pause ID..., start ID... 実行中のアプリで、実行中のダウンロードを一時停止したり、停止中、キューに入っている、または失敗したダウンロードを開始(再開)したりします。
remove ID..., delete ID... 実行中のアプリのリストからダウンロードを削除します。removeはファイルを残し、deleteはファイルも削除します。実行中のダウンロードは先に一時停止されます(pause)。
add URL [-o folder] [-f name] [-c category] [-q queue] [--checksum hash] [-r referer] [--user-agent agent] [--cookie cookie] [--private] [-l] [-s] 実行中のアプリにダウンロードを渡します。-o はフォルダーを、-f はファイル名を、-c はカテゴリを、-q はキューを、--checksum は必要なハッシュを、-r は参照元ページのアドレス (Referer ヘッダー) を、--user-agent はリクエストの User-Agent を、--cookie は Cookie ヘッダーを設定します (コマンド ラインの Cookie はシェルの履歴に残ります。- は代わりに標準入力から読み取ります)。--private はプライベート ウィンドウからのダウンロードとしてマークします (通常のウィンドウからのダウンロードとは別に保持され、オプション → 一般 → プライベート ウィンドウからのダウンロードをリストに保持する がオンの場合にのみリストに保存されます。これは既定でオンです)。-l は開始せずにキューに入れ、-s はダウンロード ファイル情報ダイアログをスキップします。成功すると {"id": N} を出力します。
start-queue [name] [-q name], stop-queue [name] [-q name] 実行中のアプリでダウンロード キューを開始または停止します (オートメーション API)。省略した場合、メイン キューを開始または停止します。
pair 実行中のアプリのリモート コントロールと電話またはリモート ブラウザーをペアリングするための新しいコード (Web アドレス、ペアリング コード、QR コード) を表示します。
api on, api off 実行中のアプリの自動化APIをオンまたはオフにします。

voltdownloadmanager-cli help <command>すべてのオプションを表示します。コマンドが失敗した場合(アプリが実行されていない、エラーが返される、ダウンロードが中断するなど)、コード1で終了します。例:

voltdownloadmanager-cli get https://example.com/big.iso -o D:\Downloads -c 16 --checksum sha256:9f86d0…
voltdownloadmanager-cli video-get "https://www.youtube.com/watch?v=aqz-KE-bpKQ" -q 720
voltdownloadmanager-cli torrent-get "magnet:?xt=urn:btih:…" --files 0

スクリプトやプログラム向けのJSON

--jsonを指定すると(コマンドの前後どちらでも可)、すべてのコマンドがテキストの代わりにJSONを出力します。スクリプトやAIエージェントが読み取れるよう、1行に1つのオブジェクトが出力されます。

コマンド 出力
get, resume {"event": "through", "service"}まずデブリット アカウント経由でダウンロードが行われるときに、次に 0.5 秒ごとに {"event": "progress", "downloaded", "size", "speed", "connections", "segments"} 行、次に {"event": "done", "path", "size", "seconds"} (ファイルがサーバーから送信されたチェックサムと一致せず、保持された場合は "warning" 付き)、または Ctrl+C の後に {"event": "paused", "state"} (state は resume が取得するファイルです)。
video-get -f がない場合、最初に {"event": "quality", "label", "format", "height", "asked", "nearest"}: 取得された品質、asked は -q の高さ ("compatible" は -q compatible の場合、それ以外は null)、nearest はその高さが提供されなかったかどうか。次に {"event": "progress", "downloaded", "size", "speed"} 行、{"event": "note", "text"} はダウンロードのログが示す内容 (サーバーが提供しない品質で、それ以下の最も近い品質が取得された場合)、次に {"event": "done", "path", "subtitles", "subtitle_problems"}: その横に保存された字幕ファイル、およびサイトが拒否した言語 ({"code", "name", "reason", "beside"}; beside: 2 回目の試行で、動画内ではなく動画の横に表示された場合)。
torrent-get {"event": "progress", "phase", "downloaded", "size", "speed", "peers", "peers_seen"}行、その後{"event": "done", "path", "size"}、または--secondsで{"event": "stopped", "downloaded", "seconds"}。
video-info {"title", "choices": [{"label", "format", "size", "approx", "height", "fps", "codec", "range"}], "subtitles": [{"code", "name", "automatic"}], "declared"}。 declared は、HTML の最初のプレーヤーの代わりに (yt-dlp が独自のリーダーを持たないサイトで) ページが関連していると述べている動画のアドレスです。それ以外の場合は null です。選択肢の format は video-get -f が取得するものです (サイズが決定されたまさにその形式、401+251 のように、それらがなくなった場合は同じコーデックと高さの最も近いもの、次に任意のコーデック)。approx はその size が推定値であることを示し、codec は AV1、VP9、H.264…、range は HDR (または HDR 選択肢の隣の SDR) です。字幕の code は --subs が取得するものです。
torrent-info {"name", "info_hash", "size", "files": [{"index", "size", "path"}]}.
torrent-create {"info_hash", "path"}.
install-ytdlp、install-ffmpeg、install-js-runtime {"tool", "version", "path"}。 install-js-runtime は used (yt-dlp が使用するランタイム ({"runtime", "version", "path"})) を追加します。
update-helpers ヘルパーごとに {"tool", "status", "version"}。 status は up-to-date、updated、ready (ダウンロードが終了すると使用中)、skipped (最新バージョンから戻った場合)、not-ours、busy、または failed (error と共に) です。
status、pause、start、remove、delete、start-queue、stop-queue、add、pair、api アプリの応答。すでにJSON形式です(下記参照)。

サイズはバイト単位 (null は不明な場合)、速度はバイト/秒です。失敗すると {"error": "…"} を出力し、コード 1 で終了します。video-get がダウンロードするページの形式を見つけられない場合、エラーは "choices" (video-info のものと同様) と "formats" (yt-dlp 独自のもの: {"id", "ext", "height", "video", "audio"}) とともに表示されます。例:

voltdownloadmanager-cli --json get https://example.com/big.iso -o D:\Downloads
{"event":"progress","downloaded":4194304,"size":1073741824,"speed":52428800,"connections":8,"segments":8}
…
{"event":"done","path":"D:\\Downloads\\big.iso","size":1073741824,"seconds":20.4}

自動化API

他のプログラムから、実行中のアプリがダウンロードしている内容を確認したり、ダウンロードを一時停止、開始、削除したりできます。APIはデフォルトでオフです。voltdownloadmanager-cli api onでオンにし、api offでオフにします。

How a program talks to VDM

  1. While it runs, VDM listens on a port of 127.0.0.1 (this computer only) and writes the port and a secret token to ipc.json in its data folder: - Windows: %APPDATA%\voltdownloadmanager\ipc.json - macOS: ~/Library/Application Support/voltdownloadmanager/ipc.json - Linux: ~/.local/share/voltdownloadmanager/ipc.json - A portable copy: data\ipc.json next to the program.

The token changes at every start; only programs that can read your data folder (yours) can use it. 2. Connect to that port and send one line of JSON: the token and the command's fields, e.g. {"token": "<token>", "query": "list"}. 3. VDM answers with one line: ok for a command, or a JSON object for a question.

対応する内容

フィールド(token以外) 応答
{"query": "list"} 各ダウンロードと合計速度: {"downloads": [{"id", "file", "url", "path", "status", "size", "downloaded", "speed", "added", "category", "error"}], "speed": bytes per second, "queues": [{"name", "running", "ids"}], "categories": [{"key", "name"}], "free": bytes}。statusはQueued、Downloading、Stopped、Complete、またはErrorです。sizeは不明な場合はnullです。error(失敗理由)はErrorのダウンロードにのみ表示されます。categoryはカテゴリのkeyです。freeはダウンロードが保存される空き容量です(不明な場合はnull)。APIがオンの場合のみ。
{"action": "pause", "ids": [3, 4]} IDでダウンロードを操作します:"pause"、"start"、"remove"(ファイルを残して削除)、または"delete"(ファイルも削除)。{"done": [3], "skipped": [{"id": 4, "why": "not running"}]}を返します。実行中のダウンロードは、リストから削除する前、またはファイルごと削除する前に一時停止する必要があります。APIがオンの場合のみ使用できます。
{"action": "start_queue", "queue": "Main download queue"} その名前のキューを開始 (または "stop_queue" で停止) します (リストの queues からの名前; デフォルト: メインのダウンロード キュー)。{"done": [], "skipped": []} または {"error": …, "code": "unknown-queue"} で応答します。API がオンの場合のみ有効です。
{"api": true} / {"api": false} APIをオンまたはオフにします:{"api": true}。
{"url": "https://…", "dir": "D:\\Files", "name": "a.zip", "silent": true} コマンドラインの/d /p /f /nのようにダウンロードを追加します("later": trueは/aです)。ok。"category"(リストのcategoriesからのキー)は、その種類の選択するフォルダではなく、そのカテゴリのフォルダに配置します。"queue"(キューの名前)は、"later"で待機するキューです。APIがオフの場合でも、コマンドラインのように機能します。
{"start_queue": true} メインのダウンロードキューを開始します。ok。

An unknown question or action is answered {"error": "…"}, as is a question while the API is off (then with "code": "api-off", for programs to check: the error text may change). A wrong token is answered denied. When VDM is already handling as many requests as it takes at once, it answers busy: nothing was done, and the line can be sent again a moment later.

A command (answered ok) may carry an "id" of your own: letters, digits and -, at most 64, different for each command. If its answer doesn't come back (the line closed, or a wait ran out), send the same line again with the same id: VDM does it once, however many of those lines reach it, and answers ok to each. Without an id, each line is a new command. A second launch of the program (voltdownloadmanager.exe /d …, /exit) does this by itself.

すべてのリクエストと応答は、フィールドごとに JSON スキーマで記述されています。automation-api.schema.json(https://vdm.mikaillab.com/automation-api.schema.jsonにもあります)。アプリが応答に使用するコードから生成されるため、常に正確です。プログラムでは、送信する内容や読み取る内容をこのスキーマで検証したり、スキーマから型を生成したりできます。

例

PowerShell (Windows):

$ep = Get-Content "$env:APPDATA\voltdownloadmanager\ipc.json" | ConvertFrom-Json
$client = New-Object Net.Sockets.TcpClient("127.0.0.1", $ep.port)
$stream = $client.GetStream()
$writer = New-Object IO.StreamWriter($stream); $reader = New-Object IO.StreamReader($stream)
$writer.WriteLine((@{ token = $ep.token; query = "list" } | ConvertTo-Json -Compress))
$writer.Flush()
$reader.ReadLine() | ConvertFrom-Json | Select-Object -ExpandProperty downloads | Format-Table file, status, downloaded, size
$client.Close()

Python:

import json, os, socket

ipc = os.path.join(os.environ["APPDATA"], "voltdownloadmanager", "ipc.json")  # see above elsewhere
ep = json.load(open(ipc))
with socket.create_connection(("127.0.0.1", ep["port"])) as s:
    s.sendall((json.dumps({"token": ep["token"], "query": "list"}) + "\n").encode())
    answer = json.loads(s.makefile().readline())
for d in answer["downloads"]:
    print(d["file"], d["status"], d["downloaded"], d["size"])

代わりにダウンロードを追加するには、{"token": "…", "url": "https://example.com/a.zip", "silent": true}を送信してください。

無料、オープンソース、広告なし、試用期間なし。

Download Volt Download Manager