Skip to content

Commit 5899f2b

Browse files
feat!: restructure CLI commands and improve code quality
BREAKING CHANGE: CLI command structure has been reorganized: - 'downie download [url]' → 'downie video download [url]' - 'subtitle-dl download [url]' → 'downie subtitle download [url]' Additional improvements: * Apply black and isort code formatting * Enhance CLI help messages and documentation * Fix subtitle CLI --auto-generated implementation * Update changelog for v0.2.0 This commit improves code organization and consistency while introducing a cleaner CLI command structure.
1 parent f5ca10e commit 5899f2b

32 files changed

+1421
-1118
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A clear and concise description of any alternative solutions or features you've
1919
How would this feature be used? Please provide example commands or code:
2020

2121
```bash
22-
downie download --new-feature value
22+
downie --new-feature value
2323
```
2424

2525
**Additional context**

.github/workflows/tests.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,9 @@ jobs:
4747
python -m pip install --upgrade pip
4848
pip install -e ".[dev,test]"
4949
50-
# - name: Run linting
51-
# run: |
52-
# black . --check
53-
# isort . --check-only
54-
# flake8 .
55-
# mypy src/
56-
5750
- name: Run tests
5851
run: |
59-
pytest --cov=downie --cov-report=xml
52+
pytest --cov=downie --cov-report=xml -v --tb=short
6053
6154
- name: Upload coverage to Codecov
6255
uses: codecov/codecov-action@v3

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Changelog
2+
3+
## [v0.2.0] (2024-10-29)
4+
5+
### ⚠️ Breaking Changes
6+
7+
#### CLI Command Structure Redesign
8+
9+
Old commands:
10+
```bash
11+
downie download [url]
12+
subtitle-dl download [url]
13+
```
14+
15+
New commands:
16+
```bash
17+
downie video download [url]
18+
downie subtitle download [url]
19+
```
20+
21+
### 🔄 Changes
22+
23+
- Applied code formatting standards using black and isort
24+
- Improved CLI documentation and help messages
25+
- Enhanced inline code documentation
26+
27+
### 🐛 Bug Fixes
28+
29+
- Fixed subtitle CLI implementation to properly handle the `--auto-generated` flag
30+
```bash
31+
# Now working correctly
32+
downie subtitle download [url] --auto-generated
33+
```
34+
35+
---
36+
37+
## [v0.1.0] (Initial Release)
38+
39+
- First public release

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ pip install downie
3434

3535
```bash
3636
# Download video
37-
downie download "https://youtube.com/watch?v=example"
37+
downie video download "https://youtube.com/watch?v=example"
3838

3939
# Download with processing
40-
downie download "https://youtube.com/watch?v=example" --process --resize 1080p
40+
downie video download "https://youtube.com/watch?v=example" --process --resize 1080p
4141

4242
# Download subtitles
43-
subtitle-dl download "https://youtube.com/watch?v=example" -l en,es
43+
downie subtitle download "https://youtube.com/watch?v=example" -l en,es
4444
```
4545

4646
## Documentation

docs/guides/advanced-usage.md

Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ Use complex format selectors to get exactly what you want:
1010

1111
```bash
1212
# Select best MP4 format under 1080p
13-
downie download "URL" -f 'bestvideo[ext=mp4][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best'
13+
downie video download "URL" -f 'bestvideo[ext=mp4][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best'
1414

1515
# Prefer VP9 codec
16-
downie download "URL" -f 'bestvideo[vcodec^=vp9]+bestaudio/best'
16+
downie video download "URL" -f 'bestvideo[vcodec^=vp9]+bestaudio/best'
1717

1818
# Download specific format
19-
downie download "URL" -f 137+140
19+
downie video download "URL" -f 137+140
2020
```
2121

2222
### Video Processing Pipeline
2323

2424
Chain multiple processing operations:
2525

2626
```bash
27-
downie download "URL" \
27+
downie video download "URL" \
2828
--process \
2929
--resize 1920x1080 \
3030
--crop 1920:800:0:140 \
@@ -42,22 +42,67 @@ Advanced HDR to SDR conversion options:
4242

4343
```bash
4444
# Custom HDR to SDR settings
45-
downie download "URL" \
45+
downie video download "URL" \
4646
--process \
4747
--hdr-to-sdr \
4848
--tonemap-mode hable \
4949
--peak-target-nits 200 \
5050
--dynamic-range 15
5151

5252
# With color space conversion
53-
downie download "URL" \
53+
downie video download "URL" \
5454
--process \
5555
--hdr-to-sdr \
5656
--color-space bt709 \
5757
--color-primaries bt709 \
5858
--color-trc bt709
5959
```
6060

61+
## Rate Limiting and Proxies
62+
63+
### Advanced Download Control
64+
65+
```bash
66+
# Rate limiting with burst
67+
downie video download "URL" \
68+
--limit-rate 1M \
69+
--limit-rate-burst 5M \
70+
--sleep-interval 2 \
71+
--max-sleep-interval 10
72+
73+
# With proxy rotation
74+
downie video download "URL" \
75+
--proxy-file proxies.txt \
76+
--proxy-rotation-interval 30
77+
```
78+
79+
### Proxy Configuration
80+
81+
```bash
82+
# Multiple proxy types
83+
downie video download "URL" \
84+
--http-proxy http://proxy1:8080 \
85+
--https-proxy https://proxy2:8443 \
86+
--socks-proxy socks5://proxy3:1080
87+
```
88+
89+
## Authentication and Cookies
90+
91+
### Complex Authentication
92+
93+
```bash
94+
# Using cookies and authentication
95+
downie video download "URL" \
96+
--cookies cookies.txt \
97+
--username "$USERNAME" \
98+
--password "$PASSWORD" \
99+
--two-factor "$2FA_CODE" \
100+
--netrc
101+
```
102+
103+
# Planned Features
104+
The following features are currently under development and will be available in future releases:
105+
61106
## Batch Processing
62107

63108
### Batch Download from File
@@ -81,13 +126,13 @@ downie batch urls.txt \
81126

82127
```bash
83128
# Download playlist with specific items
84-
downie download "PLAYLIST_URL" \
129+
downie video download "PLAYLIST_URL" \
85130
--playlist-items 1-3,7,10-12 \
86131
--playlist-reverse \
87132
--playlist-random
88133

89134
# Process entire playlist
90-
downie download "PLAYLIST_URL" \
135+
downie video download "PLAYLIST_URL" \
91136
--process \
92137
--resize 1280x720 \
93138
--output "playlist/%(playlist_title)s/%(title)s.%(ext)s"
@@ -99,7 +144,7 @@ downie download "PLAYLIST_URL" \
99144

100145
```bash
101146
# Download, convert, and merge subtitles
102-
subtitle-dl download "URL" \
147+
downie subtitle download "URL" \
103148
--languages en,es,fr \
104149
--convert-srt \
105150
--fix-encoding \
@@ -108,7 +153,7 @@ subtitle-dl download "URL" \
108153
--output-format "%(title)s.%(lang)s.%(ext)s"
109154

110155
# Download with timing adjustment
111-
subtitle-dl download "URL" \
156+
downie subtitle download "URL" \
112157
--languages en \
113158
--time-offset -2.5 \
114159
--split-at "00:05:00,00:10:00" \
@@ -136,11 +181,11 @@ downie extract-subs "video.mkv" \
136181

137182
```bash
138183
# Complex output structure
139-
downie download "URL" \
184+
downie video download "URL" \
140185
--output "%(uploader)s/%(playlist_title)s/%(upload_date)s_%(title)s_%(resolution)s.%(ext)s"
141186

142187
# With custom formatting
143-
downie download "URL" \
188+
downie video download "URL" \
144189
--output "%(title).50s_%(height)dp_%(fps)dfps.%(ext)s" \
145190
--output-na-placeholder "UNKNOWN"
146191
```
@@ -153,47 +198,6 @@ downie download "URL" \
153198
- Time: `duration`, `upload_date`, `timestamp`
154199
- Other: `like_count`, `view_count`, `comment_count`
155200

156-
## Rate Limiting and Proxies
157-
158-
### Advanced Download Control
159-
160-
```bash
161-
# Rate limiting with burst
162-
downie download "URL" \
163-
--limit-rate 1M \
164-
--limit-rate-burst 5M \
165-
--sleep-interval 2 \
166-
--max-sleep-interval 10
167-
168-
# With proxy rotation
169-
downie download "URL" \
170-
--proxy-file proxies.txt \
171-
--proxy-rotation-interval 30
172-
```
173-
174-
### Proxy Configuration
175-
176-
```bash
177-
# Multiple proxy types
178-
downie download "URL" \
179-
--http-proxy http://proxy1:8080 \
180-
--https-proxy https://proxy2:8443 \
181-
--socks-proxy socks5://proxy3:1080
182-
```
183-
184-
## Authentication and Cookies
185-
186-
### Complex Authentication
187-
188-
```bash
189-
# Using cookies and authentication
190-
downie download "URL" \
191-
--cookies cookies.txt \
192-
--username "$USERNAME" \
193-
--password "$PASSWORD" \
194-
--two-factor "$2FA_CODE" \
195-
--netrc
196-
```
197201

198202
### Cookie Management
199203

@@ -205,7 +209,7 @@ downie cookies export \
205209
--output cookies.txt
206210

207211
# Use cookies with specific domains
208-
downie download "URL" \
212+
downie video download "URL" \
209213
--cookies-from-browser firefox \
210214
--cookies-domain youtube.com,google.com
211215
```
@@ -216,7 +220,7 @@ downie download "URL" \
216220

217221
```bash
218222
# Configure retries
219-
downie download "URL" \
223+
downie video download "URL" \
220224
--retries 5 \
221225
--retry-sleep 10 \
222226
--retry-sleep-multiplier 2 \
@@ -227,7 +231,7 @@ downie download "URL" \
227231

228232
```bash
229233
# Handle fragmented downloads
230-
downie download "URL" \
234+
downie video download "URL" \
231235
--fragment-retries 10 \
232236
--skip-unavailable-fragments \
233237
--abort-on-unavailable-fragment \
@@ -240,13 +244,13 @@ downie download "URL" \
240244

241245
```bash
242246
# Detailed logging
243-
downie download "URL" \
247+
downie video download "URL" \
244248
--log-level debug \
245249
--log-file download.log \
246250
--progress-template "%(progress)s%(speed)s%(eta)s"
247251

248252
# With statistics
249-
downie download "URL" \
253+
downie video download "URL" \
250254
--print-traffic \
251255
--print-stats \
252256
--stats-interval 5

0 commit comments

Comments
 (0)