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 CHANGED
@@ -1,136 +1,176 @@
1
- # YTDWN
1
+ <div align="center">
2
2
 
3
- A fast and simple CLI tool to download audio from YouTube videos. Powered by [yt-dlp](https://github.com/yt-dlp/yt-dlp).
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
+ [![npm version](https://img.shields.io/npm/v/ytdwn.svg)](https://www.npmjs.com/package/ytdwn)
15
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
16
+
17
+ </div>
4
18
 
5
19
  ## ✨ Features
6
20
 
7
- - 🎵 Download audio from YouTube in MP3 or other formats
8
- - ✂️ Clip specific sections of videos (e.g., `1:30-2:45`)
9
- - 📁 Set a default download folder
10
- - 🚀 Fast parallel downloads with concurrent fragments
11
- - 🎨 Beautiful progress bar and colored output
12
- - 📦 Auto-downloads yt-dlp binary if not present
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
- ## 🚀 Installation
19
-
20
- ### Using npm/npx
34
+ ## 🚀 Quick Start
21
35
 
22
36
  ```bash
23
- # Run directly without installing
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
- ### Using Bun
40
+ # First-time setup (downloads yt-dlp)
41
+ ytdwn prepare
34
42
 
35
- ```bash
36
- # Run directly without installing
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
- # Or install globally
41
- bun add -g ytdwn
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
- ### From Source
50
+ ## 📖 Usage
51
+
52
+ ### Basic Examples
47
53
 
48
54
  ```bash
49
- # Clone the repository
50
- git clone https://github.com/batikankutluer/ytdwn.git
51
- cd ytdwn
55
+ # Download as MP3 (default)
56
+ ytdwn "https://youtube.com/watch?v=VIDEO_ID"
52
57
 
53
- # Install dependencies
54
- bun install
58
+ # Download as MP4 video
59
+ ytdwn "https://youtube.com/watch?v=VIDEO_ID" -f mp4
55
60
 
56
- # Run directly from source (no build needed)
57
- bun run index.ts prepare
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
- # Or build and use the compiled version
61
- bun run build
62
- node dist/index.js prepare
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
- ## 📖 Usage
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
- ### Basic Download
81
+ ### Commands
68
82
 
69
83
  ```bash
70
- # Download audio from a YouTube URL
71
- ytdwn https://www.youtube.com/watch?v=VIDEO_ID
84
+ # Download yt-dlp binary
85
+ ytdwn prepare
72
86
 
73
- # Or use the short form
74
- ytdwn https://youtu.be/VIDEO_ID
75
- ```
87
+ # Set default download folder
88
+ ytdwn setDefaultFolder ~/Downloads/YouTube
76
89
 
77
- ### Options
90
+ # View current folder
91
+ ytdwn setDefaultFolder
78
92
 
79
- | Flag | Description | Example |
80
- | ----------------------- | ------------------------------ | ---------------- |
81
- | `-f, --format <format>` | Audio format (default: mp3) | `-f opus` |
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
- ### Examples
97
+ ### Supported Formats
88
98
 
89
- ```bash
90
- # Download as MP3 (default)
91
- ytdwn https://www.youtube.com/watch?v=VIDEO_ID
99
+ | Type | Formats |
100
+ |------|---------|
101
+ | Audio | mp3, opus, m4a, flac, aac, wav |
102
+ | Video | mp4, mkv, webm, avi, mov |
92
103
 
93
- # Download as OPUS format
94
- ytdwn https://www.youtube.com/watch?v=VIDEO_ID -f opus
104
+ ## 🛠️ Installation Options
95
105
 
96
- # Download only a portion (from 1:30 to 2:45)
97
- ytdwn https://www.youtube.com/watch?v=VIDEO_ID -c 1:30-2:45
106
+ ### npm / npx
98
107
 
99
- # Quiet mode - outputs only the filename
100
- ytdwn https://www.youtube.com/watch?v=VIDEO_ID -q
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
- ### Commands
117
+ ### Bun
104
118
 
105
119
  ```bash
106
- # Download and prepare yt-dlp binary
107
- ytdwn prepare
120
+ # Run without installing
121
+ bunx ytdwn prepare
122
+ bunx ytdwn "https://youtube.com/watch?v=VIDEO_ID"
108
123
 
109
- # Set default download folder
110
- ytdwn setDefaultFolder ~/Music/YouTube
124
+ # Install globally
125
+ bun add -g ytdwn
126
+ ```
111
127
 
112
- # View current download folder
113
- ytdwn setDefaultFolder
128
+ ### From Source
114
129
 
115
- # Reset to current directory
116
- ytdwn setDefaultFolder --reset
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
- - `downloadDir`: Default folder for downloaded files
124
- - `binaryPath`: Cached path to yt-dlp binary
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**: [Node.js](https://nodejs.org) or [Bun](https://bun.sh)
129
- - **CLI Framework**: [Commander.js](https://github.com/tj/commander.js)
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
- - **Audio Processing**: [FFmpeg](https://ffmpeg.org)
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) file for details
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>