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 กำหนดส่วนหัวเพิ่มเติม (- อ่านคุกกี้จากอินพุตมาตรฐาน) --checksum ตรวจสอบไฟล์ที่เสร็จสมบูรณ์สำหรับการรันนั้น --dns, --adapter และ --proxy กำหนด DNS, อะแดปเตอร์เครือข่าย และพร็อกซีของการเชื่อมต่อ เช่นเดียวกับ get และกฎของเว็บไซต์ของแอปจะใช้ได้เช่นเดียวกับ get ผ่านบัญชี debrid เช่นเดียวกับ 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 พร้อม 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 (คุกกี้ในบรรทัดคำสั่งจะไปอยู่ในประวัติของเชลล์; - จะอ่านจากอินพุตมาตรฐานแทน), --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 แทนข้อความ, หนึ่งอ็อบเจกต์ต่อบรรทัด, สำหรับสคริปต์และ AI agent เพื่ออ่าน:

คำสั่ง พิมพ์
get, resume {"event": "through", "service"}อันดับแรกเมื่อดาวน์โหลดผ่านบัญชี debrid จากนั้นบรรทัด {"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]} ดำเนินการกับการดาวน์โหลดตาม 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 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