idm-cli 1.3.3__tar.gz → 1.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. idm_cli-1.3.4/CHANGELOG.md +113 -0
  2. idm_cli-1.3.4/MANIFEST.in +2 -0
  3. {idm_cli-1.3.3/idm_cli.egg-info → idm_cli-1.3.4}/PKG-INFO +211 -167
  4. {idm_cli-1.3.3 → idm_cli-1.3.4}/README.md +177 -136
  5. idm_cli-1.3.4/idm_cli/__init__.py +3 -0
  6. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/__main__.py +4 -4
  7. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/config.py +171 -156
  8. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/downloader/core.py +71 -7
  9. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/downloader/downloader.py +58 -16
  10. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/downloader/handlers.py +37 -6
  11. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/downloader/muxer.py +43 -6
  12. idm_cli-1.3.4/idm_cli/extractors/__init__.py +42 -0
  13. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/extractors/direct.py +30 -30
  14. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/extractors/winget.py +107 -107
  15. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/extractors/ytdlp.py +195 -150
  16. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/ui/cli.py +291 -277
  17. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/ui/progress.py +55 -49
  18. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/ui/prompts.py +70 -28
  19. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/ui/utils.py +54 -8
  20. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/update_checker.py +84 -82
  21. {idm_cli-1.3.3 → idm_cli-1.3.4/idm_cli.egg-info}/PKG-INFO +211 -167
  22. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli.egg-info/SOURCES.txt +5 -2
  23. {idm_cli-1.3.3 → idm_cli-1.3.4}/pyproject.toml +51 -36
  24. {idm_cli-1.3.3 → idm_cli-1.3.4}/setup.cfg +4 -4
  25. {idm_cli-1.3.3 → idm_cli-1.3.4}/tests/test_core.py +129 -129
  26. idm_cli-1.3.4/tests/test_core_handlers.py +267 -0
  27. idm_cli-1.3.4/tests/test_extractor_fixes.py +214 -0
  28. idm_cli-1.3.4/tests/test_muxer.py +121 -0
  29. idm_cli-1.3.4/tests/test_progress_update.py +124 -0
  30. idm_cli-1.3.4/tests/test_regressions.py +422 -0
  31. idm_cli-1.3.3/MANIFEST.in +0 -1
  32. idm_cli-1.3.3/idm_cli/__init__.py +0 -3
  33. idm_cli-1.3.3/idm_cli/extractors/__init__.py +0 -23
  34. idm_cli-1.3.3/requirements.txt +0 -9
  35. idm_cli-1.3.3/tests/__init__.py +0 -0
  36. idm_cli-1.3.3/tests/test_regressions.py +0 -76
  37. {idm_cli-1.3.3 → idm_cli-1.3.4}/LICENSE +0 -0
  38. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/downloader/__init__.py +0 -0
  39. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/downloader/state.py +0 -0
  40. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli/ui/__init__.py +0 -0
  41. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli.egg-info/dependency_links.txt +0 -0
  42. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli.egg-info/entry_points.txt +0 -0
  43. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli.egg-info/requires.txt +0 -0
  44. {idm_cli-1.3.3 → idm_cli-1.3.4}/idm_cli.egg-info/top_level.txt +0 -0
@@ -0,0 +1,113 @@
1
+ # Changelog
2
+
3
+ All notable changes to IDM-CLI are documented here.
4
+
5
+ ## [Unreleased]
6
+
7
+ ### Added
8
+
9
+ - README "Security" section documenting what IDM-CLI does and does not protect
10
+ against (it is a download manager, not an antivirus).
11
+
12
+ ### Changed
13
+
14
+ - **UI palette reduced to two colours (cyan + white).** Status meaning is now
15
+ carried by a leading glyph instead of colour: `✓` success, `✗` error/cancel,
16
+ `•` neutral info, `»` an action starting, `‖` paused.
17
+ - **Version is now single-sourced.** `pyproject.toml` reads `__version__` from
18
+ `idm_cli/__init__.py` instead of repeating it, so the package and the
19
+ metadata can no longer disagree.
20
+
21
+ ### Added
22
+
23
+ - **Automated releases.** Pushing a `v*` tag runs `.github/workflows/release.yml`,
24
+ which builds, validates, and publishes to PyPI via Trusted Publishing (OIDC).
25
+ The workflow refuses to publish when the tag and the packaged version differ.
26
+
27
+ ## [1.3.4] - 2026-10-11
28
+
29
+ ### Fixed
30
+
31
+ - **Downloads failed with HTTP 403** on servers that reject the impersonated
32
+ Chrome User-Agent: chunks now retry with a fallback User-Agent.
33
+ - **Resume broke for direct files**: the extractor was resolved twice, and the
34
+ flaky network probe could return a different extractor the second time
35
+ ("did not provide a downloadable URL"). The extractor is now resolved once and
36
+ reused; saved direct-file tasks never re-probe.
37
+ - **FFmpeg muxing failed (exit 234)**: the temp output kept a `.part` extension,
38
+ so ffmpeg could not infer the container format. The temp file now preserves
39
+ the real extension and is renamed atomically.
40
+ - **Quality menu never appeared**: the default YouTube player clients exposed
41
+ only 360p, so a single "resolution" auto-selected silently. The extractor now
42
+ tries several clients and keeps the one with the most resolutions
43
+ (1080p/720p/... when available).
44
+ - **Non-TTY crash**: `check_key_press()` raised `termios.error` (not an
45
+ `OSError`) when stdin was a pipe/file, killing downloads in scripts/CI.
46
+ - Corrupted resume metadata no longer aborts the download; it resets the chunk.
47
+ - `0`-byte files and `bool` chunk counts are handled correctly.
48
+
49
+ ### Changed
50
+
51
+ - Interactive runs now prompt for quality whenever a real terminal is available
52
+ (previously `idm <url>` silently used the configured default). The configured
53
+ default is marked `(default)` and pre-selected; `-q`/`-a` still skip the prompt.
54
+ - FFmpeg failures now show a short, single-line message; the full ffmpeg output
55
+ goes to the log file only.
56
+
57
+ ### Security
58
+
59
+ - SSRF: `is_valid_url()` now rejects private/loopback/link-local/reserved hosts
60
+ (localhost, 127.0.0.1, 10/8, 192.168/16, 169.254.169.254, IPv6 equivalents).
61
+ - Rich markup injection: user- and metadata-controlled strings are escaped.
62
+
63
+ ### Tests and CI
64
+
65
+ - Test suite grew from 15 to 69 tests (muxer, progress, extractors, core/handlers,
66
+ quality-prompt behaviour, SSRF, muxing regressions).
67
+
68
+ ## [1.3.3] - 2026-09-06
69
+
70
+ ### Fixed
71
+
72
+ - Validate ranged HTTP responses and received byte counts to prevent corrupted downloads.
73
+ - Prevent existing files from being treated as complete when the server cannot be checked.
74
+ - Avoid buffering an entire file during range capability detection.
75
+ - Validate resume metadata and make state updates safe across processes.
76
+ - Prevent direct-file audio-only downloads from reporting a false success.
77
+ - Handle small-file chunk partitioning and non-TTY input safely.
78
+ - Prevent temporary-file collisions and accidental output overwrites.
79
+ - Make FFmpeg post-processing output atomic.
80
+ - Harden filenames and escape user-controlled terminal output.
81
+ - Stop implicit browser-cookie access during yt-dlp fallback.
82
+
83
+ ### Security
84
+
85
+ - Verify downloaded FFmpeg archives against the SHA-256 digest published by GitHub Releases.
86
+ - Added a security reporting policy in `SECURITY.md`.
87
+
88
+ ### Tests and CI
89
+
90
+ - Added regression tests for configuration validation, filename safety, and direct extractors.
91
+ - Added coverage reporting to GitHub Actions.
92
+
93
+ ## [1.3.0]
94
+
95
+ ### Added
96
+
97
+ - URL validation for HTTP/HTTPS sources.
98
+ - Atomic download state persistence.
99
+ - Queue locking and safer Winget command execution.
100
+ - Improved retry handling and resume support.
101
+
102
+ ### Security
103
+
104
+ - Removed unsafe command execution paths and machine-specific configuration from the repository.
105
+
106
+ ## [1.2.2]
107
+
108
+ ### Fixed
109
+
110
+ - Improved resume reliability after interrupted downloads.
111
+ - Improved recovery from throttling and silent network disconnects.
112
+ - Added faster automatic FFmpeg download support.
113
+ - Added Winget-based FFmpeg installation on Windows.
@@ -0,0 +1,2 @@
1
+ include CHANGELOG.md
2
+ include LICENSE
@@ -1,167 +1,211 @@
1
- Metadata-Version: 2.4
2
- Name: idm-cli
3
- Version: 1.3.3
4
- Summary: A lightning-fast, universal command-line download manager
5
- Author: Rehan
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/rj41-w2/idm-cli
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Operating System :: OS Independent
10
- Classifier: Environment :: Console
11
- Requires-Python: >=3.8
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE
14
- Requires-Dist: typer
15
- Requires-Dist: rich
16
- Requires-Dist: curl-cffi>=0.7.0
17
- Requires-Dist: aiofiles
18
- Requires-Dist: yt-dlp
19
- Requires-Dist: pyfiglet
20
- Requires-Dist: questionary
21
- Requires-Dist: psutil
22
- Requires-Dist: platformdirs
23
- Provides-Extra: dev
24
- Requires-Dist: pytest; extra == "dev"
25
- Requires-Dist: pytest-asyncio; extra == "dev"
26
- Requires-Dist: pytest-cov; extra == "dev"
27
- Requires-Dist: packaging; extra == "dev"
28
- Requires-Dist: ruff; extra == "dev"
29
- Dynamic: license-file
30
-
31
- <div align="center">
32
-
33
- <h1>IDM-CLI</h1>
34
-
35
- **A lightning-fast, cross-platform command-line download manager written in Python.**
36
-
37
- *The official IDM asks you to pay after 30 days — IDM-CLI is 100% free, open-source, and yours to modify!*
38
-
39
- [![PyPI version](https://img.shields.io/pypi/v/idm-cli?color=blue&label=pypi%20version)](https://pypi.org/project/idm-cli/)
40
- [![Downloads](https://static.pepy.tech/badge/idm-cli)](https://pepy.tech/project/idm-cli)
41
- [![License](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/rj41-w2/idm-cli/blob/main/LICENSE)
42
- ![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey)
43
- [![Install](https://img.shields.io/badge/install-pip%20install%20idm--cli-brightgreen)](https://pypi.org/project/idm-cli/)
44
-
45
- [Download via PyPI](https://pypi.org/project/idm-cli/) · [Report a Bug](https://github.com/rj41-w2/idm-cli/issues)
46
-
47
- </div>
48
-
49
- IDM-CLI splits files into multiple parallel chunks (default 8, up to 32) to maximize your internet speed. It supports downloading from **YouTube**, **Facebook**, **Instagram**, and any **Direct File URL** (`.exe`, `.zip`, `.pdf`, etc.).
50
-
51
- ## Features
52
-
53
- - **Parallel Chunk Engine** — Splits downloads into multiple concurrent chunks using `curl-cffi` async sessions to fully saturate your bandwidth.
54
- - **Universal Downloader** — Paste any URL. yt-dlp handles 1000+ sites (YouTube, Facebook, Instagram, etc.), with automatic fallback to direct HTTP download for unsupported URLs.
55
- - **Audio Only / MP3 Conversion** — Download videos as audio. IDM-CLI automatically grabs the best audio stream and uses FFmpeg to convert it to `.mp3`.
56
- - **Smart Auto-Resume** — Internet dropped? Pressed `Ctrl+C`? No problem. IDM-CLI remembers the exact byte positions of all incomplete chunks. Paste the same link again to resume instantly.
57
- - **Persistent Queue System** — Add multiple files to a queue with `-Q` and type `start queue` to download them all sequentially.
58
- - **Interactive UI** — Modern terminal interface powered by `rich` and `questionary` with real-time speed, ETA, and progress bars. Press `p` to pause, `r` to resume.
59
- - **Cross-Platform** — Works on Windows, macOS, and Linux with platform-specific FFmpeg handling.
60
- - **Auto-Update Check** — Checks PyPI once a day and notifies you when a new version is available.
61
-
62
- ## Prerequisites
63
-
64
- - **Python 3.8+**
65
- - **FFmpeg** — Required for muxing video and audio streams, and converting to `.mp3`. IDM-CLI can auto-download it for you, or you can install it manually:
66
- - Windows: `winget install ffmpeg`
67
- - macOS: `brew install ffmpeg`
68
- - Linux: `sudo apt install ffmpeg`
69
-
70
- ## Installation
71
-
72
- ```bash
73
- # From PyPI
74
- pip install idm-cli
75
-
76
- # From source
77
- git clone https://github.com/rj41-w2/idm-cli.git
78
- cd IDM-CLI
79
- pip install -r requirements.txt
80
- pip install -e .
81
- ```
82
-
83
- ## Usage
84
-
85
- Run the app interactively:
86
-
87
- ```bash
88
- idm
89
- ```
90
-
91
- This opens a prompt where you can paste your link, select video quality, or queue the download.
92
-
93
- ### CLI Flags (Fast Mode)
94
-
95
- Skip the interactive menus by passing arguments directly:
96
-
97
- ```bash
98
- # Download a video at 1080p
99
- idm "https://youtube.com/watch?v=..." -q 1080p -v
100
-
101
- # Audio only (converts to MP3)
102
- idm "https://youtube.com/watch?v=..." -a
103
-
104
- # 16 parallel chunks for maximum speed
105
- idm "https://example.com/largefile.zip" -c 16
106
-
107
- # Add to queue
108
- idm "https://facebook.com/..." -Q
109
- ```
110
-
111
- | Flag | Description |
112
- |------|-------------|
113
- | `-q <resolution>` | Set video quality (e.g., `1080p`, `720p`) |
114
- | `-a` | Audio only — download and convert to MP3 |
115
- | `-v` | Download video + audio (bypasses quality prompt) |
116
- | `-Q` | Add to queue instead of downloading immediately |
117
- | `-c <num>` | Number of parallel chunks (default: 8) |
118
- | `-f <filename>` | Force a custom output filename |
119
-
120
- ### Interactive Commands
121
-
122
- | Command | Description |
123
- |---------|-------------|
124
- | `<URL>` | Download a video or file |
125
- | `resume` | Resume or delete incomplete downloads |
126
- | `start queue` | Process all queued downloads |
127
- | `help` | Show available commands and flags |
128
- | `exit` | Exit the application |
129
-
130
- ### Troubleshooting: Windows Device Guard
131
-
132
- If you get `"idm.exe was blocked by your organization's Device Guard policy"`, run the Python module directly:
133
-
134
- ```bash
135
- python -m idm_cli
136
- ```
137
-
138
- ## Architecture
139
-
140
- ```
141
- idm_cli/
142
- ├── config.py # Platform-aware config, logging, paths
143
- ├── update_checker.py # PyPI version check
144
- ├── ui/
145
- │ ├── cli.py # Main interactive CLI
146
- │ └── utils.py # Console, progress listener, validators
147
- ├── downloader/
148
- │ ├── core.py # Download orchestration & FFmpeg setup
149
- │ ├── downloader.py # Async chunk download engine
150
- │ ├── handlers.py # Queue & resume handlers
151
- │ ├── muxer.py # FFmpeg mux/conversion
152
- │ └── state.py # Atomic JSON state persistence
153
- ├── extractors/
154
- │ ├── ytdlp.py # YouTube/social media extractor
155
- │ ├── direct.py # Direct HTTP file downloader
156
- │ └── winget.py # Windows Package Manager extractor
157
- ```
158
-
159
- ## Contributing
160
-
161
- Contributions are welcome. Fork the repo, make your changes on a feature branch, and open a PR against `main`. Keep changes focused and follow the existing code style.
162
-
163
- For bug reports and feature requests, [open an issue](https://github.com/rj41-w2/idm-cli/issues).
164
-
165
- ## License
166
-
167
- This project is licensed under the [MIT License](LICENSE).
1
+ Metadata-Version: 2.4
2
+ Name: idm-cli
3
+ Version: 1.3.4
4
+ Summary: A lightning-fast, universal command-line download manager
5
+ Author: Rehan
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/rj41-w2/idm-cli
8
+ Project-URL: Repository, https://github.com/rj41-w2/idm-cli
9
+ Project-URL: Issues, https://github.com/rj41-w2/idm-cli/issues
10
+ Project-URL: Changelog, https://github.com/rj41-w2/idm-cli/blob/main/CHANGELOG.md
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Environment :: Console
14
+ Requires-Python: >=3.8
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: typer
18
+ Requires-Dist: rich
19
+ Requires-Dist: curl-cffi>=0.7.0
20
+ Requires-Dist: aiofiles
21
+ Requires-Dist: yt-dlp
22
+ Requires-Dist: pyfiglet
23
+ Requires-Dist: questionary
24
+ Requires-Dist: psutil
25
+ Requires-Dist: platformdirs
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest; extra == "dev"
28
+ Requires-Dist: pytest-asyncio; extra == "dev"
29
+ Requires-Dist: pytest-cov; extra == "dev"
30
+ Requires-Dist: packaging; extra == "dev"
31
+ Requires-Dist: ruff; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ <div align="center">
35
+
36
+ <h1>IDM-CLI</h1>
37
+
38
+ **A lightning-fast, universal command-line download manager written in Python.**
39
+
40
+ [![PyPI version](https://img.shields.io/pypi/v/idm-cli?color=blue&label=pypi%20version)](https://pypi.org/project/idm-cli/)
41
+ [![Downloads](https://static.pepy.tech/badge/idm-cli)](https://pepy.tech/project/idm-cli)
42
+ [![License](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/rj41-w2/idm-cli/blob/main/LICENSE)
43
+ ![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey)
44
+ [![Install](https://img.shields.io/badge/install-pip%20install%20idm--cli-brightgreen)](https://pypi.org/project/idm-cli/)
45
+
46
+ [Download via PyPI](https://pypi.org/project/idm-cli/) · [Report a Bug](https://github.com/rj41-w2/idm-cli/issues)
47
+
48
+ </div>
49
+
50
+ IDM-CLI splits files into multiple parallel chunks (default 8, up to 32) to maximize your internet speed. It supports downloading from **YouTube**, **Facebook**, **Instagram**, and any **Direct File URL** (`.exe`, `.zip`, `.pdf`, etc.).
51
+
52
+ ## Features
53
+
54
+ - **Parallel Chunk Engine** — Splits downloads into multiple concurrent chunks using `curl-cffi` async sessions to fully saturate your bandwidth.
55
+ - **Universal Downloader** — Paste any URL. yt-dlp handles 1000+ sites (YouTube, Facebook, Instagram, etc.), with automatic fallback to direct HTTP download for unsupported URLs.
56
+ - **Audio Only / MP3 Conversion** — Download videos as audio. IDM-CLI automatically grabs the best audio stream and uses FFmpeg to convert it to `.mp3`.
57
+ - **Smart Auto-Resume** — Internet dropped? Pressed `Ctrl+C`? No problem. IDM-CLI remembers the exact byte positions of all incomplete chunks. Paste the same link again to resume instantly.
58
+ - **Persistent Queue System** — Add multiple files to a queue with `-Q` and type `start queue` to download them all sequentially.
59
+ - **Interactive UI** — Modern terminal interface powered by `rich` and `questionary` with real-time speed, ETA, and progress bars. Press `p` to pause, `r` to resume.
60
+ - **Cross-Platform** — Works on Windows, macOS, and Linux with platform-specific FFmpeg handling.
61
+ - **Auto-Update Check** — Checks PyPI once a day and notifies you when a new version is available.
62
+
63
+ ## Security
64
+
65
+ **IDM-CLI is a download manager, not an antivirus.** It does not scan files for
66
+ malware — no signature database, no heuristic engine. Downloading a file that
67
+ contains malware will not trigger any warning from IDM-CLI itself.
68
+
69
+ What IDM-CLI does give you:
70
+
71
+ - **SSRF protection** — URLs pointing at private/loopback/link-local hosts
72
+ (`localhost`, `127.0.0.1`, `10.x`, `192.168.x`, `169.254.169.254`, …) are
73
+ rejected, so a crafted link cannot make IDM-CLI probe your internal network.
74
+ - **No shell execution** — all `subprocess` calls use `shell=False` with
75
+ argument lists; no URL or title ever reaches a shell.
76
+ - **Verified FFmpeg download** — when IDM-CLI auto-installs FFmpeg, the archive
77
+ is checked against the SHA-256 digest published by GitHub Releases.
78
+
79
+ **How to stay safe:** rely on your operating system's antivirus, which scans
80
+ files as they land on disk.
81
+
82
+ - **Windows:** Windows Defender real-time protection scans WSL paths
83
+ (`\\wsl.localhost\...`) automatically — nothing to configure.
84
+ - **Linux:** install ClamAV (`sudo apt install clamav`), keep the signature
85
+ database current (`sudo freshclam`), and scan a download with
86
+ `clamscan ~/Downloads/file`. Add a cron job or an inotify watcher to scan
87
+ automatically.
88
+
89
+ This mirrors how the official Internet Download Manager behaves: IDM does not
90
+ detect malware either — it can be configured (Options → Downloads → Virus
91
+ checking) to call an installed antivirus after a download finishes, and
92
+ otherwise relies on the antivirus's real-time protection.
93
+
94
+ ## Prerequisites
95
+
96
+ - **Python 3.8+**
97
+ - **FFmpeg** — Required for muxing video and audio streams, and converting to `.mp3`. IDM-CLI can auto-download it for you, or you can install it manually:
98
+ - Windows: `winget install ffmpeg`
99
+ - macOS: `brew install ffmpeg`
100
+ - Linux: `sudo apt install ffmpeg`
101
+
102
+ ## Installation
103
+
104
+ ```bash
105
+ # From PyPI
106
+ pip install idm-cli
107
+
108
+ # From source
109
+ git clone https://github.com/rj41-w2/idm-cli.git
110
+ cd idm-cli
111
+ pip install -e ".[dev]"
112
+ ```
113
+
114
+ ## Usage
115
+
116
+ Run the app interactively:
117
+
118
+ ```bash
119
+ idm
120
+ ```
121
+
122
+ This opens a prompt where you can paste your link, select video quality, or queue the download.
123
+
124
+ ### CLI Flags (Fast Mode)
125
+
126
+ Skip the interactive menus by passing arguments directly:
127
+
128
+ ```bash
129
+ # Download a video at 1080p
130
+ idm "https://youtube.com/watch?v=..." -q 1080p -v
131
+
132
+ # Audio only (converts to MP3)
133
+ idm "https://youtube.com/watch?v=..." -a
134
+
135
+ # 16 parallel chunks for maximum speed
136
+ idm "https://example.com/largefile.zip" -c 16
137
+
138
+ # Add to queue
139
+ idm "https://facebook.com/..." -Q
140
+ ```
141
+
142
+ | Flag | Description |
143
+ |------|-------------|
144
+ | `-q <resolution>` | Set video quality (e.g., `1080p`, `720p`) |
145
+ | `-a` | Audio only — download and convert to MP3 |
146
+ | `-v` | Download video + audio (bypasses quality prompt) |
147
+ | `-Q` | Add to queue instead of downloading immediately |
148
+ | `-c <num>` | Number of parallel chunks (default: 8) |
149
+ | `-f <filename>` | Force a custom output filename |
150
+
151
+ ### Interactive Commands
152
+
153
+ | Command | Description |
154
+ |---------|-------------|
155
+ | `<URL>` | Download a video or file |
156
+ | `resume` | Resume or delete incomplete downloads |
157
+ | `start queue` | Process all queued downloads |
158
+ | `help` | Show available commands and flags |
159
+ | `exit` | Exit the application |
160
+
161
+ ### Troubleshooting: Windows Device Guard
162
+
163
+ If you get `"idm.exe was blocked by your organization's Device Guard policy"`, run the Python module directly:
164
+
165
+ ```bash
166
+ python -m idm_cli
167
+ ```
168
+
169
+ ## Architecture
170
+
171
+ ```
172
+ idm_cli/
173
+ ├── __init__.py # Package version
174
+ ├── __main__.py # python -m idm_cli entry point
175
+ ├── config.py # Platform-aware config, logging, and paths
176
+ ├── update_checker.py # PyPI version check
177
+ ├── ui/
178
+ │ ├── cli.py # Typer entry point and interactive command loop
179
+ │ ├── prompts.py # Questionary prompts and user-facing messages
180
+ │ ├── progress.py # Rich progress display and pause/resume controls
181
+ │ └── utils.py # URL validation, filename safety, and terminal helpers
182
+ ├── downloader/
183
+ │ ├── core.py # Download orchestration and destination management
184
+ │ ├── downloader.py # Async ranged downloads, retries, and resume validation
185
+ │ ├── handlers.py # Queue & resume handlers
186
+ │ ├── muxer.py # FFmpeg verification, muxing, and conversion
187
+ │ └── state.py # Locked, atomic JSON state persistence
188
+ └── extractors/
189
+ ├── __init__.py # Direct HTTP probe and extractor selection
190
+ ├── ytdlp.py # YouTube/social media extractor
191
+ ├── direct.py # Direct HTTP file metadata and URL extraction
192
+ └── winget.py # Windows Package Manager metadata extraction
193
+
194
+ tests/ # pytest suite (runs fully offline)
195
+ ```
196
+
197
+ The download flow is: `core.py` selects the extractor and prepares the
198
+ destination and media pipeline, `downloader.py` downloads validated byte ranges,
199
+ `progress.py` renders live progress, and `muxer.py` creates the final media file.
200
+ Interrupted downloads are tracked under the platform-specific application data
201
+ directory, not inside the repository.
202
+
203
+ ## Contributing
204
+
205
+ Contributions are welcome. Fork the repo, make your changes on a feature branch, and open a PR against `main`. Keep changes focused and follow the existing code style.
206
+
207
+ For bug reports and feature requests, [open an issue](https://github.com/rj41-w2/idm-cli/issues).
208
+
209
+ ## License
210
+
211
+ This project is licensed under the [MIT License](LICENSE).