Volt Download Manager
  1. Trang chủ
  2. Trợ giúp
  3. Dòng lệnh và tự động hóa

Dòng lệnh và tự động hóa

VDM can be driven without its window in three ways:

  • Dòng lệnh của ứng dụng, các tùy chọn giống như của IDM: chuyển một lượt tải xuống cho ứng dụng đang chạy từ một tập lệnh, tệp bó hoặc chương trình khác.
  • voltdownloadmanager-cli, một công cụ dòng lệnh riêng biệt: tải xuống tệp, video và torrent trong một thiết bị đầu cuối, có hiển thị tiến độ, mà không cần ứng dụng.
  • 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.

Các ví dụ sử dụng đường dẫn của Windows; trên macOS và Linux, các chương trình có cùng tên mà không có .exe.

Dòng lệnh của ứng dụng

voltdownloadmanager.exe /d URL [/p folder] [/f name] [/a] [/n] [/s]
Tùy chọn Chức năng
/d URL Địa chỉ để tải xuống.
/p folder Lưu vào thư mục này (nếu không sẽ là thư mục của danh mục từ Tùy chọn → Lưu vào).
/f name Lưu với tên này.
/a Thêm vào hàng đợi tải xuống chính mà không bắt đầu.
/n Im lặng: không có cửa sổ Thông tin tệp tải xuống, quá trình tải xuống bắt đầu (hoặc được xếp hàng, với /a) ngay lập tức.
/s Bắt đầu hàng đợi tải xuống chính.
/exit Lưu và đóng ứng dụng đang chạy (trình cài đặt sử dụng nó trước khi nâng cấp).
/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.
một tệp .torrent hoặc liên kết 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.

Lệnh Chức năng
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] Tiếp tục tải xuống bị tạm dừng hoặc bị lỗi từ tệp .vdm.json bên cạnh. -r, --user-agent và --cookie đặt các tiêu đề bổ sung (- đọc cookie từ đầu vào chuẩn). --checksum xác minh tệp đã hoàn tất cho lần chạy đó. --dns, --adapter và --proxy đặt DNS, bộ điều hợp mạng và proxy của kết nối, như đối với get, và các quy tắc trang web của ứng dụng áp dụng như đối với get. Thông qua tài khoản debrid, như get: dịch vụ cung cấp một liên kết mới khi liên kết cũ hết hạn; --direct tiếp tục từ chính địa chỉ đó.
install-gallery-dl Cài đặt hoặc cập nhật gallery-dl để tải thư viện ảnh: danh sách mã kiểm tra được xác minh bằng khóa ký của tác giả, rồi chương trình được xác minh bằng danh sách đó (Windows và Linux x86-64; trên các hệ điều hành khác, tự cài đặt).
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 Trang này chứa video nào (YouTube, Vimeo, ...), và các chất lượng để lựa chọn.
playlist-info URL [--from N] [--count N] Các video trong danh sách phát hoặc kênh, mỗi video một dòng theo thứ tự liệt kê: vị trí, thời lượng, tiêu đề và địa chỉ.
playlist-get URL [-f selector] [-o folder] [-c pieces] [--split-chapters] [--from N] [--count N] Tải xuống các video của danh sách phát hoặc kênh lần lượt, vào một thư mục được đặt tên theo danh sách bên trong -o. -f là một chất lượng cho tất cả, như đối với video-get (mặc định là chất lượng tốt nhất của mỗi video; bv*[height<=720]+ba/b[height<=720] = lên đến 720p; bv[vcodec^=avc]+ba[acodec^=mp4a]/b[vcodec^=avc][acodec^=mp4a] = tương thích nhất, H.264 với AAC; ba = âm thanh gốc; mp3:320, opus:, flac: như đối với video-get). -c và --split-chapters như đối với 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 Tên, các tệp (được đánh số) và kích thước của một torrent; SOURCE là liên kết magnet hoặc tệp .torrent.
torrent-get SOURCE [-o folder] [--files 0,2] [--use-existing] Tải xuống một torrent, hoặc chỉ một số tệp của nó. Nếu một số tệp của nó đã có trong thư mục, nó sẽ dừng và đặt tên cho chúng; --use-existing sử dụng chúng thay thế (những gì khớp được giữ lại, phần còn lại được tải xuống). Với Thêm các trình theo dõi của danh sách công khai này vào các torrent công khai trong Cài đặt torrent được bật, một torrent công khai cũng nhận được các trình theo dõi của danh sách, như trong ứng dụng.
torrent-create PATH -o file.torrent Tạo .torrent của một tệp hoặc thư mục, các tệp trong thư mục được liệt kê theo tên (các máy ngang hàng tìm thấy nó qua DHT).
status [--id N] [-s status] [--search text] [-c category] [-q queue] [-l limit](hoặc list) Các lượt tải xuống của ứng dụng đang chạy, dưới dạng JSON, với ID của chúng (API tự động hóa phải được bật). Các cờ tùy chọn lọc theo ID, trạng thái, chuỗi tìm kiếm, danh mục hoặc hàng đợi, hoặc giới hạn số lượng.
pause ID..., start ID... Tạm dừng các lượt tải xuống đang chạy hoặc bắt đầu (tiếp tục) các lượt đã dừng, đang chờ hoặc thất bại trong ứng dụng đang chạy.
remove ID..., delete ID... Xóa các lượt tải xuống khỏi danh sách của ứng dụng đang chạy: remove giữ lại các tệp, delete cũng xóa các tệp. Lượt tải xuống đang chạy sẽ được tạm dừng trước (pause).
add URL [-o folder] [-f name] [-c category] [-q queue] [--checksum hash] [-r referer] [--user-agent agent] [--cookie cookie] [--private] [-l] [-s] Chuyển một lượt tải xuống cho ứng dụng đang chạy. -o đặt thư mục, -f tên tệp, -c danh mục, -q hàng đợi, --checksum đặt hàm băm bắt buộc, -r địa chỉ trang giới thiệu (tiêu đề Referer), --user-agent đặt User-Agent của yêu cầu, --cookie đặt tiêu đề Cookie (một cookie trên dòng lệnh sẽ kết thúc trong lịch sử shell; - đọc nó từ đầu vào chuẩn thay thế), --private đánh dấu nó là lượt tải xuống từ cửa sổ riêng tư (được giữ riêng biệt với các lượt tải xuống từ cửa sổ thông thường, chỉ được lưu trong danh sách khi Tùy chọn → Chung → Giữ các lượt tải xuống từ cửa sổ riêng tư trong danh sách được bật, như mặc định), -l xếp nó vào hàng đợi mà không bắt đầu, và -s bỏ qua hộp thoại Thông tin tệp tải xuống. In {"id": N} khi thành công.
start-queue [name] [-q name], stop-queue [name] [-q name] Bắt đầu hoặc dừng một hàng đợi tải xuống trong ứng dụng đang chạy (API tự động hóa). Bắt đầu hoặc dừng hàng đợi chính nếu bỏ qua.
pair Hiển thị một mã mới để ghép nối điện thoại hoặc trình duyệt từ xa với điều khiển từ xa của ứng dụng đang chạy: địa chỉ web, mã ghép nối và mã QR của nó.
api on, api off Bật hoặc tắt API tự động hóa của ứng dụng đang chạy.

voltdownloadmanager-cli help <command>hiển thị mọi tùy chọn. Lệnh thất bại (ứng dụng không chạy, trả lời bằng lỗi hoặc lượt tải xuống bị gián đoạn) sẽ thoát với mã 1. Ví dụ:

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 cho tập lệnh và chương trình

Với --json (trước hoặc sau lệnh), mọi lệnh đều xuất JSON thay vì văn bản, mỗi dòng một đối tượng, để tập lệnh và tác nhân AI đọc:

Lệnh In
get, resume {"event": "through", "service"}đầu tiên khi quá trình tải xuống đi qua một tài khoản debrid, sau đó là một dòng {"event": "progress", "downloaded", "size", "speed", "connections", "segments"} cứ nửa giây một lần, sau đó là {"event": "done", "path", "size", "seconds"} (với "warning" khi tệp không khớp với tổng kiểm mà máy chủ của nó gửi, và đã được giữ lại), hoặc {"event": "paused", "state"} sau Ctrl+C (state là tệp mà resume lấy).
video-get Không có -f, {"event": "quality", "label", "format", "height", "asked", "nearest"} trước: chất lượng đã lấy, asked chiều cao của -q ("compatible" cho -q compatible, nếu không thì null) và nearest liệu chiều cao đó có được cung cấp hay không. Sau đó {"event": "progress", "downloaded", "size", "speed"} dòng, {"event": "note", "text"} cho những gì nhật ký tải xuống nói (một chất lượng mà máy chủ không cung cấp, được lấy ở mức gần nhất bên dưới), sau đó {"event": "done", "path", "subtitles", "subtitle_problems"}: các tệp phụ đề đã lưu bên cạnh, và các ngôn ngữ mà trang web từ chối ({"code", "name", "reason", "beside"}; beside: chúng đã đến trong lần thử thứ hai, bên cạnh video thay vì trong đó).
torrent-get {"event": "progress", "phase", "downloaded", "size", "speed", "peers", "peers_seen"}dòng, sau đó là {"event": "done", "path", "size"}, hoặc {"event": "stopped", "downloaded", "seconds"} với --seconds.
video-info {"title", "choices": [{"label", "format", "size", "approx", "height", "fps", "codec", "range"}], "subtitles": [{"code", "name", "automatic"}], "declared"}; declared là địa chỉ của video mà trang nói về, khi video đó được tra cứu thay vì trình phát đầu tiên trong HTML của nó (trên một trang web mà yt-dlp không có trình đọc riêng), nếu không thì null; format của một lựa chọn là những gì video-get -f lấy (các định dạng chính xác mà nó được định cỡ từ, như 401+251, sau đó là định dạng gần nhất cùng codec và chiều cao nếu những cái đó không còn, sau đó là bất kỳ codec nào), approx nói size của nó là một ước tính, codec là AV1, VP9, H.264…, range là HDR (hoặc SDR bên cạnh một lựa chọn HDR); code của một phụ đề là những gì --subs lấy.
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 thêm used, thời gian chạy mà yt-dlp sử dụng ({"runtime", "version", "path"}).
update-helpers Một {"tool", "status", "version"} cho mỗi trình trợ giúp; status là up-to-date, updated, ready (đang sử dụng sau khi các lượt tải xuống của nó kết thúc), skipped (bạn đã quay lại từ phiên bản mới nhất), not-ours, busy hoặc failed (với error).
status, pause, start, remove, delete, start-queue, stop-queue, add, pair,api Phản hồi của ứng dụng, vốn đã ở dạng JSON (xem bên dưới).

Kích thước tính bằng byte (null khi không xác định), tốc độ tính bằng byte mỗi giây. Lỗi sẽ in {"error": "…"} và thoát với mã 1; khi video-get không tìm thấy định dạng nào của trang để tải xuống, lỗi sẽ đi kèm với "choices" (như của video-info) và "formats" (của yt-dlp: {"id", "ext", "height", "video", "audio"}). Ví dụ:

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 tự động hóa

Các chương trình khác có thể hỏi ứng dụng đang chạy xem ứng dụng đang tải xuống những gì, cũng như tạm dừng, bắt đầu, gỡ khỏi danh sách hoặc xóa các lượt tải xuống. API tắt theo mặc định; bật bằng voltdownloadmanager-cli api on (và tắt bằng 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.

Các lệnh được hỗ trợ

Các trường (ngoài token) Phản hồi
{"query": "list"} Mỗi lượt tải xuống và tổng tốc độ: {"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 là Queued, Downloading, Stopped, Complete hoặc Error; size là null khi không xác định; error (lý do thất bại) chỉ có cho lượt tải xuống ở Error; category là key của một danh mục; free là dung lượng trống nơi các lượt tải xuống được lưu (null khi không xác định). Chỉ khi API đang bật.
{"action": "pause", "ids": [3, 4]} Thao tác với lượt tải xuống theo ID: "pause", "start", "remove" (giữ lại tệp) hoặc "delete" (cũng xóa tệp). Phản hồi là {"done": [3], "skipped": [{"id": 4, "why": "not running"}]}; phải tạm dừng lượt tải xuống đang chạy trước khi gỡ khỏi danh sách hoặc xóa. Chỉ khả dụng khi API đang bật.
{"action": "start_queue", "queue": "Main download queue"} Bắt đầu (hoặc với "stop_queue", dừng) hàng đợi có tên đó (một tên từ queues của danh sách; mặc định: hàng đợi tải xuống chính). Trả lời {"done": [], "skipped": []}, hoặc {"error": …, "code": "unknown-queue"}. Chỉ khi API được bật.
{"api": true} / {"api": false} Bật hoặc tắt API: {"api": true}.
{"url": "https://…", "dir": "D:\\Files", "name": "a.zip", "silent": true} Thêm một lượt tải xuống, như /d /p /f /n của dòng lệnh ("later": true là /a); ok. "category" (một khóa từ categories của danh sách) đặt nó vào thư mục của danh mục đó thay vì thư mục mà loại của nó chọn; "queue" (tên của một hàng đợi) là hàng đợi mà nó chờ cùng với "later". Cũng hoạt động khi API tắt, giống như dòng lệnh.
{"start_queue": true} Bắt đầu hàng đợi tải xuống chính; 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.

Mọi yêu cầu và câu trả lời đều được mô tả chi tiết theo từng trường trong một JSON Schema: automation-api.schema.json (cũng có tại https://vdm.mikaillab.com/automation-api.schema.json). Schema này được tạo từ mã mà ứng dụng dùng để trả lời, nên luôn chính xác. Các chương trình có thể dùng schema này để kiểm tra dữ liệu gửi đi và nhận về, hoặc tạo các kiểu dữ liệu từ schema.

Ví dụ

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"])

Để thêm một lượt tải xuống, hãy gửi {"token": "…", "url": "https://example.com/a.zip", "silent": true}.

Miễn phí, mã nguồn mở, không quảng cáo, không dùng thử.

Download Volt Download Manager