ytdwn 1.0.1 → 1.1.0
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.
- package/README.md +121 -81
- package/dist/index.js +459 -363
- package/dist/src/cli/commands.d.ts +18 -0
- package/dist/src/cli/errors.d.ts +8 -0
- package/dist/src/cli/index.d.ts +2 -0
- package/dist/src/config.d.ts +6 -3
- package/dist/src/layers/AppLive.d.ts +14 -0
- package/dist/src/layers/index.d.ts +1 -0
- package/dist/src/lib/errors.d.ts +92 -0
- package/dist/src/lib/filesystem.d.ts +27 -0
- package/dist/src/lib/http.d.ts +6 -0
- package/dist/src/lib/index.d.ts +3 -0
- package/dist/src/services/BinaryService.d.ts +14 -0
- package/dist/src/services/DownloadService.d.ts +22 -0
- package/dist/src/services/SettingsService.d.ts +14 -0
- package/dist/src/services/index.d.ts +3 -0
- package/dist/src/timestamp.d.ts +16 -0
- package/package.json +6 -3
- package/dist/src/binary.d.ts +0 -12
- package/dist/src/download.d.ts +0 -16
- package/dist/src/settings.d.ts +0 -24
package/README.md
CHANGED
|
@@ -1,136 +1,176 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```
|
|
4
|
+
██╗ ██╗ ████████╗ ██████╗ ██╗ ██╗ ███╗ ██╗
|
|
5
|
+
╚██╗ ██╔╝ ╚══██╔══╝ ██╔══██╗ ██║ ██║ ████╗ ██║
|
|
6
|
+
╚████╔╝ ██║ ██║ ██║ ██║ █╗ ██║ ██╔██╗ ██║
|
|
7
|
+
╚██╔╝ ██║ ██║ ██║ ██║███╗██║ ██║╚██╗██║
|
|
8
|
+
██║ ██║ ██████╔╝ ╚███╔███╔╝ ██║ ╚████║
|
|
9
|
+
╚═╝ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚═╝ ╚═══╝
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**A fast and simple CLI tool to download audio and video from YouTube**
|
|
13
|
+
|
|
14
|
+
[](https://www.npmjs.com/package/ytdwn)
|
|
15
|
+
[](LICENSE)
|
|
16
|
+
|
|
17
|
+
</div>
|
|
4
18
|
|
|
5
19
|
## ✨ Features
|
|
6
20
|
|
|
7
|
-
- 🎵
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
21
|
+
- 🎵 **Audio Downloads** - MP3, OPUS, M4A, FLAC, and more
|
|
22
|
+
- 🎥 **Video Downloads** - MP4, MKV, WebM with best quality *(new in v1.1.0)*
|
|
23
|
+
- ✂️ **Clip Sections** - Download only specific time ranges
|
|
24
|
+
- 📁 **Custom Folders** - Set a default download directory
|
|
25
|
+
- 🚀 **Fast Downloads** - Parallel fragment downloading
|
|
26
|
+
- 🎨 **Beautiful UI** - Gradient banner, spinners, progress bars
|
|
27
|
+
- 📦 **Auto-Setup** - Downloads yt-dlp binary automatically
|
|
13
28
|
|
|
14
29
|
## 📋 Requirements
|
|
15
30
|
|
|
16
31
|
- [Node.js](https://nodejs.org) >= 18.0.0 or [Bun](https://bun.sh) >= 1.0.0
|
|
32
|
+
- [FFmpeg](https://ffmpeg.org) (for video merging and audio conversion)
|
|
17
33
|
|
|
18
|
-
## 🚀
|
|
19
|
-
|
|
20
|
-
### Using npm/npx
|
|
34
|
+
## 🚀 Quick Start
|
|
21
35
|
|
|
22
36
|
```bash
|
|
23
|
-
#
|
|
24
|
-
npx ytdwn prepare
|
|
25
|
-
npx ytdwn https://www.youtube.com/watch?v=VIDEO_ID
|
|
26
|
-
|
|
27
|
-
# Or install globally
|
|
37
|
+
# Install globally
|
|
28
38
|
npm install -g ytdwn
|
|
29
|
-
ytdwn prepare
|
|
30
|
-
ytdwn https://www.youtube.com/watch?v=VIDEO_ID
|
|
31
|
-
```
|
|
32
39
|
|
|
33
|
-
|
|
40
|
+
# First-time setup (downloads yt-dlp)
|
|
41
|
+
ytdwn prepare
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
bunx ytdwn prepare
|
|
38
|
-
bunx ytdwn https://www.youtube.com/watch?v=VIDEO_ID
|
|
43
|
+
# Download audio (MP3)
|
|
44
|
+
ytdwn "https://www.youtube.com/watch?v=VIDEO_ID"
|
|
39
45
|
|
|
40
|
-
#
|
|
41
|
-
|
|
42
|
-
ytdwn prepare
|
|
43
|
-
ytdwn https://www.youtube.com/watch?v=VIDEO_ID
|
|
46
|
+
# Download video (MP4)
|
|
47
|
+
ytdwn "https://www.youtube.com/watch?v=VIDEO_ID" -f mp4
|
|
44
48
|
```
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
## 📖 Usage
|
|
51
|
+
|
|
52
|
+
### Basic Examples
|
|
47
53
|
|
|
48
54
|
```bash
|
|
49
|
-
#
|
|
50
|
-
|
|
51
|
-
cd ytdwn
|
|
55
|
+
# Download as MP3 (default)
|
|
56
|
+
ytdwn "https://youtube.com/watch?v=VIDEO_ID"
|
|
52
57
|
|
|
53
|
-
#
|
|
54
|
-
|
|
58
|
+
# Download as MP4 video
|
|
59
|
+
ytdwn "https://youtube.com/watch?v=VIDEO_ID" -f mp4
|
|
55
60
|
|
|
56
|
-
#
|
|
57
|
-
|
|
58
|
-
bun run index.ts https://www.youtube.com/watch?v=VIDEO_ID
|
|
61
|
+
# Clip a specific section (1:30 to 2:45)
|
|
62
|
+
ytdwn "https://youtube.com/watch?v=VIDEO_ID" -c 1:30-2:45
|
|
59
63
|
|
|
60
|
-
#
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
# Download video clip
|
|
65
|
+
ytdwn "https://youtube.com/watch?v=VIDEO_ID" -f mp4 -c 1:30-2:45
|
|
66
|
+
|
|
67
|
+
# Quiet mode (outputs only filename)
|
|
68
|
+
ytdwn "https://youtube.com/watch?v=VIDEO_ID" -q
|
|
63
69
|
```
|
|
64
70
|
|
|
65
|
-
|
|
71
|
+
### Options
|
|
72
|
+
|
|
73
|
+
| Flag | Description | Example |
|
|
74
|
+
|------|-------------|---------|
|
|
75
|
+
| `-f, --format <format>` | Output format (mp3, mp4, mkv, etc.) | `-f mp4` |
|
|
76
|
+
| `-c, --clip <range>` | Clip time range | `-c 1:30-2:45` |
|
|
77
|
+
| `-q, --quiet` | Minimal output | `-q` |
|
|
78
|
+
| `-v, --version` | Show version | `-v` |
|
|
79
|
+
| `-h, --help` | Show help | `-h` |
|
|
66
80
|
|
|
67
|
-
###
|
|
81
|
+
### Commands
|
|
68
82
|
|
|
69
83
|
```bash
|
|
70
|
-
# Download
|
|
71
|
-
ytdwn
|
|
84
|
+
# Download yt-dlp binary
|
|
85
|
+
ytdwn prepare
|
|
72
86
|
|
|
73
|
-
#
|
|
74
|
-
ytdwn
|
|
75
|
-
```
|
|
87
|
+
# Set default download folder
|
|
88
|
+
ytdwn setDefaultFolder ~/Downloads/YouTube
|
|
76
89
|
|
|
77
|
-
|
|
90
|
+
# View current folder
|
|
91
|
+
ytdwn setDefaultFolder
|
|
78
92
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
| `-c, --clip <range>` | Clip a specific time range | `-c 01:30-02:45` |
|
|
83
|
-
| `-q, --quiet` | Minimal output (only filename) | `-q` |
|
|
84
|
-
| `-v, --version` | Show version | `-v` |
|
|
85
|
-
| `-h, --help` | Show help | `-h` |
|
|
93
|
+
# Reset to current directory
|
|
94
|
+
ytdwn setDefaultFolder --reset
|
|
95
|
+
```
|
|
86
96
|
|
|
87
|
-
###
|
|
97
|
+
### Supported Formats
|
|
88
98
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
99
|
+
| Type | Formats |
|
|
100
|
+
|------|---------|
|
|
101
|
+
| Audio | mp3, opus, m4a, flac, aac, wav |
|
|
102
|
+
| Video | mp4, mkv, webm, avi, mov |
|
|
92
103
|
|
|
93
|
-
|
|
94
|
-
ytdwn https://www.youtube.com/watch?v=VIDEO_ID -f opus
|
|
104
|
+
## 🛠️ Installation Options
|
|
95
105
|
|
|
96
|
-
|
|
97
|
-
ytdwn https://www.youtube.com/watch?v=VIDEO_ID -c 1:30-2:45
|
|
106
|
+
### npm / npx
|
|
98
107
|
|
|
99
|
-
|
|
100
|
-
|
|
108
|
+
```bash
|
|
109
|
+
# Run without installing
|
|
110
|
+
npx ytdwn prepare
|
|
111
|
+
npx ytdwn "https://youtube.com/watch?v=VIDEO_ID"
|
|
112
|
+
|
|
113
|
+
# Install globally
|
|
114
|
+
npm install -g ytdwn
|
|
101
115
|
```
|
|
102
116
|
|
|
103
|
-
###
|
|
117
|
+
### Bun
|
|
104
118
|
|
|
105
119
|
```bash
|
|
106
|
-
#
|
|
107
|
-
ytdwn prepare
|
|
120
|
+
# Run without installing
|
|
121
|
+
bunx ytdwn prepare
|
|
122
|
+
bunx ytdwn "https://youtube.com/watch?v=VIDEO_ID"
|
|
108
123
|
|
|
109
|
-
#
|
|
110
|
-
|
|
124
|
+
# Install globally
|
|
125
|
+
bun add -g ytdwn
|
|
126
|
+
```
|
|
111
127
|
|
|
112
|
-
|
|
113
|
-
ytdwn setDefaultFolder
|
|
128
|
+
### From Source
|
|
114
129
|
|
|
115
|
-
|
|
116
|
-
|
|
130
|
+
```bash
|
|
131
|
+
git clone https://github.com/batikankutluer/ytdwn.git
|
|
132
|
+
cd ytdwn
|
|
133
|
+
bun install
|
|
134
|
+
bun run index.ts prepare
|
|
135
|
+
bun run index.ts "https://youtube.com/watch?v=VIDEO_ID"
|
|
117
136
|
```
|
|
118
137
|
|
|
119
138
|
## ⚙️ Configuration
|
|
120
139
|
|
|
121
140
|
Settings are stored in `~/.ytdwn.json`:
|
|
122
141
|
|
|
123
|
-
|
|
124
|
-
|
|
142
|
+
| Key | Description |
|
|
143
|
+
|-----|-------------|
|
|
144
|
+
| `downloadDir` | Default download folder |
|
|
145
|
+
| `binaryPath` | Cached path to yt-dlp |
|
|
146
|
+
|
|
147
|
+
## 🧪 Development
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Run tests
|
|
151
|
+
bun test
|
|
152
|
+
|
|
153
|
+
# Type check
|
|
154
|
+
bun run typecheck
|
|
155
|
+
|
|
156
|
+
# Build
|
|
157
|
+
bun run build
|
|
158
|
+
```
|
|
125
159
|
|
|
126
160
|
## 🛠️ Tech Stack
|
|
127
161
|
|
|
128
|
-
- **Runtime**:
|
|
129
|
-
- **
|
|
162
|
+
- **Runtime**: Node.js / Bun
|
|
163
|
+
- **Type Safety**: [Effect.TS](https://effect.website)
|
|
164
|
+
- **CLI**: [Commander.js](https://github.com/tj/commander.js)
|
|
130
165
|
- **Downloader**: [yt-dlp](https://github.com/yt-dlp/yt-dlp)
|
|
131
|
-
- **
|
|
132
|
-
- **Styling**: [cfonts](https://github.com/dominikwilkowski/cfonts), [gradient-string](https://github.com/bokub/gradient-string), [picocolors](https://github.com/alexeyraspopov/picocolors)
|
|
166
|
+
- **Binary Management**: [yt-dlp-wrap](https://github.com/foxesdocode/yt-dlp-wrap)
|
|
133
167
|
|
|
134
168
|
## 📄 License
|
|
135
169
|
|
|
136
|
-
MIT - see [LICENSE](LICENSE)
|
|
170
|
+
MIT - see [LICENSE](LICENSE) for details
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
<div align="center">
|
|
175
|
+
Made with ❤️ by <a href="https://github.com/batikankutluer">Batikan Kutluer</a>
|
|
176
|
+
</div>
|