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 встановлюють DNS, мережевий адаптер та проксі для з’єднання, як для get, і правила сайту програми застосовуються, як для 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] Переглянути відео зі списку відтворення або каналу — по одному в рядку, у порядку на сайті: позиція, тривалість, назва й адреса.
playlist-get URL [-f selector] [-o folder] [-c pieces] [--split-chapters] [--from N] [--count N] Завантажити відео з плейлиста або каналу одне за одним, у папку, названу на честь списку, всередині -o. -f — це одна якість для всіх, як для video-get (за замовчуванням найкраща для кожного відео; 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, з їхніми ідентифікаторами (API автоматизації має бути увімкнено). Додаткові прапорці фільтрують за ідентифікатором, статусом, рядком пошуку, категорією або чергою, або обмежують кількість.
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 Показати новий код для з’єднання телефону або віддаленого браузера з пультом дистанційного керування запущеної програми: її веб-адреси, код з’єднання та 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 замість тексту: один об’єкт у кожному рядку, щоб його могли читати скрипти та агенти ШІ:

Команда Виводить
get, resume {"event": "through", "service"}спочатку, коли завантаження проходить через обліковий запис розблокування завантажень, потім рядок {"event": "progress", "downloaded", "size", "speed", "connections", "segments"} кожні пів секунди, потім {"event": "done", "path", "size", "seconds"} (з "warning", коли файл не збігався з контрольною сумою, надісланою його сервером, і був збережений), або {"event": "paused", "state"} після Ctrl+C (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: вони з’явилися з другої спроби, поруч із відео замість у ньому).
torrent-get {"event": "progress", "phase", "downloaded", "size", "speed", "peers", "peers_seen"}рядки, потім {"event": "done", "path", "size"}, або {"event": "stopped", "downloaded", "seconds"} з --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 (або SDR поруч із вибором HDR); 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]} Виконує дії із завантаженнями за ідентифікатором: "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 Schema: 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