# سطر الأوامر والأتمتة

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](https://vdm.mikaillab.com/ar/help/ai-assistants.html).

To run the whole app without a window, on a home server or a NAS, see [Run VDM on a server](https://vdm.mikaillab.com/ar/help/server.html) (`voltdownloadmanager --headless`); to control it from a phone, [Control VDM from your phone](https://vdm.mikaillab.com/ar/help/remote-control.html).

تستخدم الأمثلة مسارات 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](https://vdm.mikaillab.com/ar/help/download-list.html#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](https://vdm.mikaillab.com/ar/help/connections-and-speed.html#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](https://vdm.mikaillab.com/ar/help/debrid.html)). |
| `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، مع معرفاتها (يجب تشغيل واجهة برمجة تطبيقات الأتمتة). تعمل العلامات الاختيارية على التصفية حسب المعرف أو الحالة أو سلسلة البحث أو الفئة أو قائمة الانتظار، أو تحديد العدد. |
| `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]` | بدء أو إيقاف قائمة انتظار تنزيل في التطبيق قيد التشغيل (واجهة برمجة تطبيقات الأتمتة). يبدأ أو يوقف قائمة الانتظار الرئيسية إذا تم حذفه. |
| `pair` | إظهار رمز جديد لإقران هاتف أو مستعرض بعيد بجهاز التحكم عن بعد الخاص بالتطبيق قيد التشغيل: عناوين الويب الخاصة به، ورمز الإقران، ورمز QR. |
| `api on`, `api off` | تشغيل أو إيقاف واجهة برمجة تطبيقات الأتمتة للتطبيق قيد التشغيل. |

`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"}`أولا عندما يمر التنزيل عبر حساب 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}
```

## واجهة برمجة تطبيقات الأتمتة

يمكن للبرامج الأخرى أن تسأل التطبيق قيد التشغيل عما يقوم بتنزيله، وإيقاف التنزيلات مؤقتا أو بدءها أو إزالتها أو حذفها. واجهة برمجة التطبيقات **معطلة افتراضيا**؛ قم بتشغيلها باستخدام `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](https://vdm.mikaillab.com/ar/help/portable.html): `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"}]}`؛ يجب إيقاف التنزيل الجاري مؤقتا قبل إزالته أو حذفه. فقط عندما تكون واجهة برمجة التطبيقات قيد التشغيل. |
| `{"action": "start_queue", "queue": "Main download queue"}` | يبدأ (أو مع `"stop_queue"`، يوقف) قائمة الانتظار بهذا الاسم (اسم من `queues` في القائمة؛ الافتراضي: قائمة التنزيل الرئيسية). يجيب `{"done": [], "skipped": []}`، أو `{"error": …, "code": "unknown-queue"}`. فقط عندما تكون واجهة برمجة التطبيقات قيد التشغيل. |
| `{"api": true}` / `{"api": false}` | يقوم بتشغيل أو إيقاف واجهة برمجة التطبيقات: `{"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) (ومتاح أيضا على `https://vdm.mikaillab.com/automation-api.schema.json`). ينشأ المخطط من الكود الذي يستخدمه التطبيق للإجابة، لذا يظل دقيقا؛ ويمكن للبرامج استخدامه للتحقق مما ترسله وتقرأه، أو لإنشاء أنواعها منه.

### أمثلة

بوويرشيل (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()
```

بايثون:

```
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}`.

## ذات صلة

- [الخيارات](https://vdm.mikaillab.com/ar/help/options.html)
- [السمات](https://vdm.mikaillab.com/ar/help/themes.html)
- [اللغات](https://vdm.mikaillab.com/ar/help/languages.html)
- [الوضع المحمول](https://vdm.mikaillab.com/ar/help/portable.html)
- [اختصارات لوحة المفاتيح](https://vdm.mikaillab.com/ar/help/keyboard-shortcuts.html)

[تحرير هذه الصفحة على GitHub](https://github.com/mikailhossenimran/voltdownloadmanager/edit/main/docs/command-line.md) [الإبلاغ عن مشكلة في هذه الصفحة](https://github.com/mikailhossenimran/voltdownloadmanager/issues/new?template=website.yml&title=Website%3A%20Command%20line%20and%20automation&page=https%3A//vdm.mikaillab.com/help/command-line.html) [سجل الصفحة](https://github.com/mikailhossenimran/voltdownloadmanager/commits/main/docs/command-line.md)

مجاني، مفتوح المصدر، بدون إعلانات، بدون فترة تجريبية.

[Download Volt Download Manager](https://vdm.mikaillab.com/ar/download.html)
