pinak-cli 1.0.0__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.
- pinak_cli-1.0.0/CLI_README.md +168 -0
- pinak_cli-1.0.0/LICENSE +21 -0
- pinak_cli-1.0.0/PKG-INFO +221 -0
- pinak_cli-1.0.0/pinak/__init__.py +2 -0
- pinak_cli-1.0.0/pinak/__main__.py +9 -0
- pinak_cli-1.0.0/pinak/cli.py +775 -0
- pinak_cli-1.0.0/pinak/commands/__init__.py +1 -0
- pinak_cli-1.0.0/pinak/commands/info.py +408 -0
- pinak_cli-1.0.0/pinak/commands/panels.py +110 -0
- pinak_cli-1.0.0/pinak/commands/run.py +169 -0
- pinak_cli-1.0.0/pinak/config.py +195 -0
- pinak_cli-1.0.0/pinak/doctor.py +211 -0
- pinak_cli-1.0.0/pinak/downloader.py +822 -0
- pinak_cli-1.0.0/pinak/exceptions.py +93 -0
- pinak_cli-1.0.0/pinak/ffmpeg_setup.py +131 -0
- pinak_cli-1.0.0/pinak/history.py +371 -0
- pinak_cli-1.0.0/pinak/instagram.py +679 -0
- pinak_cli-1.0.0/pinak/logging_setup.py +72 -0
- pinak_cli-1.0.0/pinak/notify.py +71 -0
- pinak_cli-1.0.0/pinak/retry.py +94 -0
- pinak_cli-1.0.0/pinak/subproc.py +60 -0
- pinak_cli-1.0.0/pinak/updater.py +130 -0
- pinak_cli-1.0.0/pinak/utils.py +301 -0
- pinak_cli-1.0.0/pinak_cli.egg-info/PKG-INFO +221 -0
- pinak_cli-1.0.0/pinak_cli.egg-info/SOURCES.txt +50 -0
- pinak_cli-1.0.0/pinak_cli.egg-info/dependency_links.txt +1 -0
- pinak_cli-1.0.0/pinak_cli.egg-info/entry_points.txt +2 -0
- pinak_cli-1.0.0/pinak_cli.egg-info/requires.txt +35 -0
- pinak_cli-1.0.0/pinak_cli.egg-info/top_level.txt +1 -0
- pinak_cli-1.0.0/pyproject.toml +122 -0
- pinak_cli-1.0.0/setup.cfg +4 -0
- pinak_cli-1.0.0/tests/test_cli.py +124 -0
- pinak_cli-1.0.0/tests/test_config.py +77 -0
- pinak_cli-1.0.0/tests/test_core_extra.py +138 -0
- pinak_cli-1.0.0/tests/test_display.py +80 -0
- pinak_cli-1.0.0/tests/test_doctor_updater.py +130 -0
- pinak_cli-1.0.0/tests/test_downloader_e2e.py +91 -0
- pinak_cli-1.0.0/tests/test_downloader_unit.py +88 -0
- pinak_cli-1.0.0/tests/test_engine_flows.py +148 -0
- pinak_cli-1.0.0/tests/test_engine_paths.py +196 -0
- pinak_cli-1.0.0/tests/test_entry.py +38 -0
- pinak_cli-1.0.0/tests/test_exceptions_parse.py +58 -0
- pinak_cli-1.0.0/tests/test_fuzz.py +51 -0
- pinak_cli-1.0.0/tests/test_history.py +54 -0
- pinak_cli-1.0.0/tests/test_instagram_unit.py +157 -0
- pinak_cli-1.0.0/tests/test_release_readiness.py +191 -0
- pinak_cli-1.0.0/tests/test_reliability.py +102 -0
- pinak_cli-1.0.0/tests/test_retry.py +83 -0
- pinak_cli-1.0.0/tests/test_run_single.py +118 -0
- pinak_cli-1.0.0/tests/test_self_update.py +134 -0
- pinak_cli-1.0.0/tests/test_subproc.py +31 -0
- pinak_cli-1.0.0/tests/test_utils.py +82 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# 🔱 PINAK CLI — Media Content Downloader
|
|
2
|
+
|
|
3
|
+
PINAK CLI is a powerful, highly aesthetic command-line media downloader wrapper around `yt-dlp` and `ffmpeg`. It features a rich, interactive REPL shell with auto-completions, suggestions, customized banners, diagnostic tools, and automatic download tracking.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🚀 Key Features
|
|
8
|
+
|
|
9
|
+
* **Interactive REPL Shell**: Features a terminal command prompt with auto-completions, command suggestions, and command history.
|
|
10
|
+
* **Aesthetic UI**: Powered by `rich` and `prompt-toolkit` with vibrant color themes, tables, custom progress bars, and desktop toast notifications.
|
|
11
|
+
* **Media Formats**: Download as best-quality video, select resolutions (360p, 720p, 1080p, etc.), or convert directly to high-quality MP3 audio.
|
|
12
|
+
* **Local-First & Private**: All data, settings, and download histories remain strictly local on your machine with zero remote tracking.
|
|
13
|
+
* **Self-Diagnostics**: High-detail environmental doctor checks (`/doctor`) to verify internet, dependencies, rate limits, and configuration.
|
|
14
|
+
* **Local SQLite History**: Keeps record of your download URLs, sizes, durations, and output paths in a local SQLite database (`history.db`).
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 📦 Directory Structure
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
cli/
|
|
22
|
+
├── pinak/ # Core Package Folder
|
|
23
|
+
│ ├── __init__.py
|
|
24
|
+
│ ├── __main__.py # Entry point (python -m pinak)
|
|
25
|
+
│ ├── cli.py # REPL Interactive Shell & Typer CLI handler
|
|
26
|
+
│ ├── commands/ # Modular REPL & info subcommands
|
|
27
|
+
│ ├── downloader.py # yt-dlp & FFmpeg downloader logic
|
|
28
|
+
│ ├── config.py # Application configurations (Pydantic-Settings)
|
|
29
|
+
│ ├── history.py # SQLite storage & local tracking
|
|
30
|
+
│ ├── doctor.py # Dependencies & connection diagnostics
|
|
31
|
+
│ ├── ffmpeg_setup.py # Static FFmpeg installer utility
|
|
32
|
+
│ ├── notify.py # Desktop notifications & terminal banners
|
|
33
|
+
│ ├── updater.py # Update checker
|
|
34
|
+
│ └── utils.py # Formatting & utility helpers
|
|
35
|
+
├── tests/ # Automated test suite (pytest)
|
|
36
|
+
├── pyproject.toml # Pyproject packaging config
|
|
37
|
+
├── requirements-lock.txt # Locked dependencies for reproducible installs
|
|
38
|
+
├── Dockerfile # Container image (ffmpeg included)
|
|
39
|
+
├── .dockerignore # Docker build ignore patterns
|
|
40
|
+
└── LICENSE # MIT license
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> **Note:** FFmpeg is *not* bundled with the PyPI package. See
|
|
44
|
+
> [FFmpeg setup](#-ffmpeg-setup) below — one command installs it.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🛠️ Installation & Setup
|
|
49
|
+
|
|
50
|
+
### Requirements
|
|
51
|
+
* Python 3.10 or higher.
|
|
52
|
+
* FFmpeg (see [FFmpeg setup](#-ffmpeg-setup) — one command).
|
|
53
|
+
|
|
54
|
+
### Step 1: Install from PyPI
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install pinak-cli
|
|
58
|
+
# recommended (isolated, always on PATH):
|
|
59
|
+
pipx install pinak-cli
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This registers the global `pinak` command. From source (developers):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
cd cli
|
|
66
|
+
pip install -e ".[dev]"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Step 2: Test Command
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pinak --doctor
|
|
73
|
+
pinak
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
> **`pinak` not found after install?** Your Python Scripts folder isn't on
|
|
77
|
+
> PATH. Either add it, use `pipx install pinak-cli`, or run
|
|
78
|
+
> `python -m pinak` instead — it works identically. `pinak --doctor`
|
|
79
|
+
> includes a "CLI on PATH" check that tells you exactly what to do.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 🎞️ FFmpeg setup
|
|
84
|
+
|
|
85
|
+
FFmpeg merges formats and extracts MP3s. Pick one option:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pinak --install-ffmpeg # single-command mode: downloads a static build
|
|
89
|
+
/ffmpeg # same thing, inside the interactive REPL
|
|
90
|
+
pip install "pinak-cli[ffmpeg]" # manual equivalent (static-ffmpeg extra)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Or install FFmpeg system-wide ([ffmpeg.org/download](https://ffmpeg.org/download.html))
|
|
94
|
+
and make sure it is on PATH. Docker users already have it (`cli/Dockerfile`).
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 🔄 Keeping everything fresh
|
|
99
|
+
|
|
100
|
+
Sites change often; an outdated `yt-dlp` is the #1 cause of sudden failures.
|
|
101
|
+
Pinak checks PyPI in the background (max once per day) and notifies you —
|
|
102
|
+
about new `yt-dlp` **and** new Pinak releases. Inside the REPL, update both
|
|
103
|
+
any time with:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
/update
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
This runs `pip install --upgrade yt-dlp` and `pip install --upgrade
|
|
110
|
+
pinak-cli`, tells you exactly what changed (`Updated … 1.0.0 → 1.1.0` vs
|
|
111
|
+
`already the latest`), and — if Pinak itself was upgraded — asks you to
|
|
112
|
+
restart the CLI (`/exit`, then run `pinak` again) so the new version loads.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 💻 CLI Commands
|
|
117
|
+
|
|
118
|
+
When running the interactive REPL shell (`pinak`), the following commands are available:
|
|
119
|
+
|
|
120
|
+
| Command | Description |
|
|
121
|
+
| :--- | :--- |
|
|
122
|
+
| `/help` | Display the list of all available commands and shortcuts |
|
|
123
|
+
| `/doctor` | Run comprehensive environment and connectivity checks |
|
|
124
|
+
| `/audio <url>` | Download the media from the URL as an MP3 audio track |
|
|
125
|
+
| `/video <url>` | Download video from a URL |
|
|
126
|
+
| `/instagram <url>` | Download Instagram post, reel, or IGTV with metadata |
|
|
127
|
+
| `/batch <file>` | Download multiple URLs from a text file |
|
|
128
|
+
| `/history` | View a list of recent downloads from your history database |
|
|
129
|
+
| `/config` | Print out the current config settings and environment |
|
|
130
|
+
| `/setout <dir>` | Change the output downloads directory |
|
|
131
|
+
| `/open` | Open the downloads directory in File Explorer |
|
|
132
|
+
| `/platform [q]` | List supported platforms or search filter them |
|
|
133
|
+
| `/update` | Update yt-dlp and Pinak CLI to the latest versions |
|
|
134
|
+
| `/ffmpeg` | Download a static FFmpeg build automatically |
|
|
135
|
+
| `/exit` | Terminate the interactive REPL shell |
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## ⚙️ Configuration File
|
|
140
|
+
|
|
141
|
+
Pinak CLI saves user-specific configuration (like download directory, quality, retry counts) in a standard configuration folder (via `platformdirs`).
|
|
142
|
+
|
|
143
|
+
- **Windows**: `%LOCALAPPDATA%\pinak\pinak-cli\config.json`
|
|
144
|
+
- **macOS**: `~/Library/Application Support/pinak-cli/config.json`
|
|
145
|
+
- **Linux**: `~/.config/pinak-cli/config.json`
|
|
146
|
+
- **SQLite history**: alongside it (`history.db`)
|
|
147
|
+
|
|
148
|
+
Run `pinak --config-path` anywhere to print your exact path, or `/config`
|
|
149
|
+
inside the REPL (the path is shown above the table). Change the output
|
|
150
|
+
folder with `/setout <absolute_path>`.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 🔒 Privacy & Local-First
|
|
155
|
+
|
|
156
|
+
Pinak CLI is strictly local-first and privacy-focused. All configuration, download history, and media files remain on your local machine. No external tracking or telemetry is performed.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## ⚖️ Educational Purpose & Legal Disclaimer
|
|
161
|
+
|
|
162
|
+
Pinak CLI is developed as an **educational project, technical study of CLI architecture, and personal-archiving tool** wrapper around `yt-dlp` and `ffmpeg`. You are solely responsible for how you use it:
|
|
163
|
+
|
|
164
|
+
- **Personal Archival Only:** Only download content you own, that is freely licensed (e.g., Creative Commons), or that you have explicit permission to save.
|
|
165
|
+
- **Terms of Service:** Automated downloading may violate the Terms of Service of platforms such as YouTube, Instagram, or TikTok; your account or IP could be restricted by those platforms. Use at your own risk.
|
|
166
|
+
- **Be Excellent to Creators:** Do not use this tool to pirate, redistribute, or monetize copyrighted material without authorization. Always support and respect creators.
|
|
167
|
+
- **No DRM Circumvention:** Pinak CLI does not bypass or defeat Digital Rights Management (DRM) or access restrictions.
|
|
168
|
+
- **Limitation of Liability:** The authors provide this software "as is" under the [MIT License](LICENSE) and accept no liability for misuse.
|
pinak_cli-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pinak Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pinak_cli-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pinak-cli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A powerful, aesthetic command-line media downloader using yt-dlp
|
|
5
|
+
Author: Pinak Team
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/pinak-project/pinak-cli
|
|
8
|
+
Project-URL: Repository, https://github.com/pinak-project/pinak-cli
|
|
9
|
+
Keywords: yt-dlp,downloader,cli,video,media,instagram
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Multimedia :: Video
|
|
18
|
+
Classifier: Topic :: Utilities
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: yt-dlp>=2025.1.1
|
|
23
|
+
Requires-Dist: rich>=13.0.0
|
|
24
|
+
Requires-Dist: prompt-toolkit>=3.0.0
|
|
25
|
+
Requires-Dist: win11toast; sys_platform == "win32"
|
|
26
|
+
Requires-Dist: questionary
|
|
27
|
+
Requires-Dist: pydantic>=2.0
|
|
28
|
+
Requires-Dist: pydantic-settings>=2.0
|
|
29
|
+
Requires-Dist: platformdirs
|
|
30
|
+
Requires-Dist: typer
|
|
31
|
+
Requires-Dist: Pillow>=10.0.0
|
|
32
|
+
Requires-Dist: mutagen>=1.47
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-mock>=3.12; extra == "dev"
|
|
37
|
+
Requires-Dist: hypothesis>=6.0; extra == "dev"
|
|
38
|
+
Requires-Dist: ruff>=0.4; extra == "dev"
|
|
39
|
+
Requires-Dist: black>=24.0; extra == "dev"
|
|
40
|
+
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
41
|
+
Requires-Dist: bandit>=1.7; extra == "dev"
|
|
42
|
+
Requires-Dist: pip-audit>=2.7; extra == "dev"
|
|
43
|
+
Requires-Dist: cyclonedx-bom>=7.0; extra == "dev"
|
|
44
|
+
Requires-Dist: pre-commit>=3.0; extra == "dev"
|
|
45
|
+
Provides-Extra: test
|
|
46
|
+
Requires-Dist: pytest>=8.0; extra == "test"
|
|
47
|
+
Requires-Dist: pytest-cov>=5.0; extra == "test"
|
|
48
|
+
Requires-Dist: pytest-mock>=3.12; extra == "test"
|
|
49
|
+
Requires-Dist: hypothesis>=6.0; extra == "test"
|
|
50
|
+
Provides-Extra: ffmpeg
|
|
51
|
+
Requires-Dist: static-ffmpeg>=2.5; extra == "ffmpeg"
|
|
52
|
+
Dynamic: license-file
|
|
53
|
+
|
|
54
|
+
# 🔱 PINAK CLI — Media Content Downloader
|
|
55
|
+
|
|
56
|
+
PINAK CLI is a powerful, highly aesthetic command-line media downloader wrapper around `yt-dlp` and `ffmpeg`. It features a rich, interactive REPL shell with auto-completions, suggestions, customized banners, diagnostic tools, and automatic download tracking.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 🚀 Key Features
|
|
61
|
+
|
|
62
|
+
* **Interactive REPL Shell**: Features a terminal command prompt with auto-completions, command suggestions, and command history.
|
|
63
|
+
* **Aesthetic UI**: Powered by `rich` and `prompt-toolkit` with vibrant color themes, tables, custom progress bars, and desktop toast notifications.
|
|
64
|
+
* **Media Formats**: Download as best-quality video, select resolutions (360p, 720p, 1080p, etc.), or convert directly to high-quality MP3 audio.
|
|
65
|
+
* **Local-First & Private**: All data, settings, and download histories remain strictly local on your machine with zero remote tracking.
|
|
66
|
+
* **Self-Diagnostics**: High-detail environmental doctor checks (`/doctor`) to verify internet, dependencies, rate limits, and configuration.
|
|
67
|
+
* **Local SQLite History**: Keeps record of your download URLs, sizes, durations, and output paths in a local SQLite database (`history.db`).
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 📦 Directory Structure
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
cli/
|
|
75
|
+
├── pinak/ # Core Package Folder
|
|
76
|
+
│ ├── __init__.py
|
|
77
|
+
│ ├── __main__.py # Entry point (python -m pinak)
|
|
78
|
+
│ ├── cli.py # REPL Interactive Shell & Typer CLI handler
|
|
79
|
+
│ ├── commands/ # Modular REPL & info subcommands
|
|
80
|
+
│ ├── downloader.py # yt-dlp & FFmpeg downloader logic
|
|
81
|
+
│ ├── config.py # Application configurations (Pydantic-Settings)
|
|
82
|
+
│ ├── history.py # SQLite storage & local tracking
|
|
83
|
+
│ ├── doctor.py # Dependencies & connection diagnostics
|
|
84
|
+
│ ├── ffmpeg_setup.py # Static FFmpeg installer utility
|
|
85
|
+
│ ├── notify.py # Desktop notifications & terminal banners
|
|
86
|
+
│ ├── updater.py # Update checker
|
|
87
|
+
│ └── utils.py # Formatting & utility helpers
|
|
88
|
+
├── tests/ # Automated test suite (pytest)
|
|
89
|
+
├── pyproject.toml # Pyproject packaging config
|
|
90
|
+
├── requirements-lock.txt # Locked dependencies for reproducible installs
|
|
91
|
+
├── Dockerfile # Container image (ffmpeg included)
|
|
92
|
+
├── .dockerignore # Docker build ignore patterns
|
|
93
|
+
└── LICENSE # MIT license
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
> **Note:** FFmpeg is *not* bundled with the PyPI package. See
|
|
97
|
+
> [FFmpeg setup](#-ffmpeg-setup) below — one command installs it.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 🛠️ Installation & Setup
|
|
102
|
+
|
|
103
|
+
### Requirements
|
|
104
|
+
* Python 3.10 or higher.
|
|
105
|
+
* FFmpeg (see [FFmpeg setup](#-ffmpeg-setup) — one command).
|
|
106
|
+
|
|
107
|
+
### Step 1: Install from PyPI
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pip install pinak-cli
|
|
111
|
+
# recommended (isolated, always on PATH):
|
|
112
|
+
pipx install pinak-cli
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
This registers the global `pinak` command. From source (developers):
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
cd cli
|
|
119
|
+
pip install -e ".[dev]"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Step 2: Test Command
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
pinak --doctor
|
|
126
|
+
pinak
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
> **`pinak` not found after install?** Your Python Scripts folder isn't on
|
|
130
|
+
> PATH. Either add it, use `pipx install pinak-cli`, or run
|
|
131
|
+
> `python -m pinak` instead — it works identically. `pinak --doctor`
|
|
132
|
+
> includes a "CLI on PATH" check that tells you exactly what to do.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 🎞️ FFmpeg setup
|
|
137
|
+
|
|
138
|
+
FFmpeg merges formats and extracts MP3s. Pick one option:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
pinak --install-ffmpeg # single-command mode: downloads a static build
|
|
142
|
+
/ffmpeg # same thing, inside the interactive REPL
|
|
143
|
+
pip install "pinak-cli[ffmpeg]" # manual equivalent (static-ffmpeg extra)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Or install FFmpeg system-wide ([ffmpeg.org/download](https://ffmpeg.org/download.html))
|
|
147
|
+
and make sure it is on PATH. Docker users already have it (`cli/Dockerfile`).
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 🔄 Keeping everything fresh
|
|
152
|
+
|
|
153
|
+
Sites change often; an outdated `yt-dlp` is the #1 cause of sudden failures.
|
|
154
|
+
Pinak checks PyPI in the background (max once per day) and notifies you —
|
|
155
|
+
about new `yt-dlp` **and** new Pinak releases. Inside the REPL, update both
|
|
156
|
+
any time with:
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
/update
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
This runs `pip install --upgrade yt-dlp` and `pip install --upgrade
|
|
163
|
+
pinak-cli`, tells you exactly what changed (`Updated … 1.0.0 → 1.1.0` vs
|
|
164
|
+
`already the latest`), and — if Pinak itself was upgraded — asks you to
|
|
165
|
+
restart the CLI (`/exit`, then run `pinak` again) so the new version loads.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 💻 CLI Commands
|
|
170
|
+
|
|
171
|
+
When running the interactive REPL shell (`pinak`), the following commands are available:
|
|
172
|
+
|
|
173
|
+
| Command | Description |
|
|
174
|
+
| :--- | :--- |
|
|
175
|
+
| `/help` | Display the list of all available commands and shortcuts |
|
|
176
|
+
| `/doctor` | Run comprehensive environment and connectivity checks |
|
|
177
|
+
| `/audio <url>` | Download the media from the URL as an MP3 audio track |
|
|
178
|
+
| `/video <url>` | Download video from a URL |
|
|
179
|
+
| `/instagram <url>` | Download Instagram post, reel, or IGTV with metadata |
|
|
180
|
+
| `/batch <file>` | Download multiple URLs from a text file |
|
|
181
|
+
| `/history` | View a list of recent downloads from your history database |
|
|
182
|
+
| `/config` | Print out the current config settings and environment |
|
|
183
|
+
| `/setout <dir>` | Change the output downloads directory |
|
|
184
|
+
| `/open` | Open the downloads directory in File Explorer |
|
|
185
|
+
| `/platform [q]` | List supported platforms or search filter them |
|
|
186
|
+
| `/update` | Update yt-dlp and Pinak CLI to the latest versions |
|
|
187
|
+
| `/ffmpeg` | Download a static FFmpeg build automatically |
|
|
188
|
+
| `/exit` | Terminate the interactive REPL shell |
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## ⚙️ Configuration File
|
|
193
|
+
|
|
194
|
+
Pinak CLI saves user-specific configuration (like download directory, quality, retry counts) in a standard configuration folder (via `platformdirs`).
|
|
195
|
+
|
|
196
|
+
- **Windows**: `%LOCALAPPDATA%\pinak\pinak-cli\config.json`
|
|
197
|
+
- **macOS**: `~/Library/Application Support/pinak-cli/config.json`
|
|
198
|
+
- **Linux**: `~/.config/pinak-cli/config.json`
|
|
199
|
+
- **SQLite history**: alongside it (`history.db`)
|
|
200
|
+
|
|
201
|
+
Run `pinak --config-path` anywhere to print your exact path, or `/config`
|
|
202
|
+
inside the REPL (the path is shown above the table). Change the output
|
|
203
|
+
folder with `/setout <absolute_path>`.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 🔒 Privacy & Local-First
|
|
208
|
+
|
|
209
|
+
Pinak CLI is strictly local-first and privacy-focused. All configuration, download history, and media files remain on your local machine. No external tracking or telemetry is performed.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## ⚖️ Educational Purpose & Legal Disclaimer
|
|
214
|
+
|
|
215
|
+
Pinak CLI is developed as an **educational project, technical study of CLI architecture, and personal-archiving tool** wrapper around `yt-dlp` and `ffmpeg`. You are solely responsible for how you use it:
|
|
216
|
+
|
|
217
|
+
- **Personal Archival Only:** Only download content you own, that is freely licensed (e.g., Creative Commons), or that you have explicit permission to save.
|
|
218
|
+
- **Terms of Service:** Automated downloading may violate the Terms of Service of platforms such as YouTube, Instagram, or TikTok; your account or IP could be restricted by those platforms. Use at your own risk.
|
|
219
|
+
- **Be Excellent to Creators:** Do not use this tool to pirate, redistribute, or monetize copyrighted material without authorization. Always support and respect creators.
|
|
220
|
+
- **No DRM Circumvention:** Pinak CLI does not bypass or defeat Digital Rights Management (DRM) or access restrictions.
|
|
221
|
+
- **Limitation of Liability:** The authors provide this software "as is" under the [MIT License](LICENSE) and accept no liability for misuse.
|