ytfetch 2.0.0__tar.gz → 3.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.
- ytfetch-3.0.0/PKG-INFO +347 -0
- ytfetch-3.0.0/README.md +333 -0
- {ytfetch-2.0.0 → ytfetch-3.0.0}/pyproject.toml +4 -4
- ytfetch-3.0.0/src/ytfetch/cli.py +78 -0
- {ytfetch-2.0.0 → ytfetch-3.0.0}/src/ytfetch/formatter.py +5 -1
- ytfetch-3.0.0/src/ytfetch/main.py +113 -0
- ytfetch-3.0.0/src/ytfetch/updater.py +92 -0
- {ytfetch-2.0.0 → ytfetch-3.0.0}/src/ytfetch/utils.py +3 -2
- ytfetch-2.0.0/PKG-INFO +0 -161
- ytfetch-2.0.0/README-pypi.md +0 -114
- ytfetch-2.0.0/README.md +0 -147
- ytfetch-2.0.0/src/ytfetch/cli.py +0 -43
- ytfetch-2.0.0/src/ytfetch/main.py +0 -97
- {ytfetch-2.0.0 → ytfetch-3.0.0}/.gitattributes +0 -0
- {ytfetch-2.0.0 → ytfetch-3.0.0}/.github/workflows/publish.yaml +0 -0
- {ytfetch-2.0.0 → ytfetch-3.0.0}/.gitignore +0 -0
- {ytfetch-2.0.0 → ytfetch-3.0.0}/LICENSE +0 -0
- {ytfetch-2.0.0 → ytfetch-3.0.0}/src/ytfetch/__init__.py +0 -0
ytfetch-3.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ytfetch
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: A wrapper for yt-dlp with some flexible args
|
|
5
|
+
Project-URL: Homepage, https://github.com/voidsnax/ytFetch
|
|
6
|
+
Author: voidsnax
|
|
7
|
+
License: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: converter,downloader,h264,mp3,playlist,youtubedownloader
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Requires-Dist: colorama
|
|
12
|
+
Requires-Dist: yt-dlp[curl-cffi,default]
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# ytFetch
|
|
16
|
+
|
|
17
|
+
**ytfetch** simplifies media downloading and playlist management by adding playlist searching, and streamlined format handling on top of [yt-dlp](https://github.com/yt-dlp/yt-dlp) engine.
|
|
18
|
+
|
|
19
|
+
## ✨ Features
|
|
20
|
+
|
|
21
|
+
- **Search:** Use `-list` to display or search across one or more playlists.
|
|
22
|
+
- **Direct Download:** Download video in AVC/H.264 with MP3 audio, or extract audio only.
|
|
23
|
+
- **Video Quality:** Set the preferred video quality directly.
|
|
24
|
+
- **Native Compatibility:** Can also pass through any `yt-dlp` flag.
|
|
25
|
+
- **Minimal logs:** Clean and minimal logs.
|
|
26
|
+
- **Auto-Update:** Automatically checks for updates to ytfetch and its dependencies when enabled.
|
|
27
|
+
|
|
28
|
+
## 📋 Requirements
|
|
29
|
+
|
|
30
|
+
- [Python](https://www.python.org/): 3.11 or higher.
|
|
31
|
+
- [uv](https://docs.astral.sh/uv/getting-started/installation/): recommended, optional.
|
|
32
|
+
- [FFmpeg](https://ffmpeg.org/) and [FFprobe](https://ffmpeg.org/ffprobe.html): Must be available in your system PATH.
|
|
33
|
+
Download builds from [here](https://ffmpeg.org/download.html).
|
|
34
|
+
<details>
|
|
35
|
+
<summary>or using your system's package manager</summary>
|
|
36
|
+
- On Windows:
|
|
37
|
+
```bash
|
|
38
|
+
winget install BtbN.FFmpeg.GPL
|
|
39
|
+
```
|
|
40
|
+
or
|
|
41
|
+
```bash
|
|
42
|
+
winget install Gyan.FFmpeg
|
|
43
|
+
```
|
|
44
|
+
- On Termux (android):
|
|
45
|
+
```bash
|
|
46
|
+
pkg install ffmpeg
|
|
47
|
+
```
|
|
48
|
+
- On Mac (using Homebrew):
|
|
49
|
+
```bash
|
|
50
|
+
brew install ffmpeg
|
|
51
|
+
```
|
|
52
|
+
</details>
|
|
53
|
+
|
|
54
|
+
- [Deno](https://deno.com/): Or other JavaScript runtime/engine like [node.js](https://nodejs.org/en) or [bun](https://bun.sh/).
|
|
55
|
+
|
|
56
|
+
Check this [guide](https://github.com/yt-dlp/yt-dlp/wiki/EJS) for more info.
|
|
57
|
+
Also check [yt-dlp dependency](https://github.com/yt-dlp/yt-dlp#dependencies) for optional dependencies.
|
|
58
|
+
|
|
59
|
+
<details>
|
|
60
|
+
<summary>On Termux</summary>
|
|
61
|
+
|
|
62
|
+
Install uv or Deno with the `pkg` package manager:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pkg install uv
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pkg install deno
|
|
70
|
+
```
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
## 📦 Installation
|
|
74
|
+
|
|
75
|
+
### via uv (Recommended)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
uv tool install ytfetch
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### via pip
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pip install ytfetch
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Auto-update is intended for uv tool installations. If enabled while running a
|
|
88
|
+
pip installation, it still runs `uv tool upgrade ytfetch`; that updates a
|
|
89
|
+
uv-managed installation, if present, rather than the pip-installed copy.
|
|
90
|
+
|
|
91
|
+
## 🔄 Auto-Update
|
|
92
|
+
|
|
93
|
+
When enabled, auto-update runs `uv tool upgrade ytfetch`. This upgrades the
|
|
94
|
+
uv-managed ytfetch tool and its dependencies, including yt-dlp. Set the
|
|
95
|
+
`YTFETCH_UPDATE` environment variable to select the update channel:
|
|
96
|
+
|
|
97
|
+
| Value | Channel | Check frequency |
|
|
98
|
+
| --------------- | ---------------------------- | --------------- |
|
|
99
|
+
| `nightly` | yt-dlp nightly (pre-release) | once per day |
|
|
100
|
+
| `stable` | yt-dlp stable | once per week |
|
|
101
|
+
| unset / invalid | disabled | – |
|
|
102
|
+
|
|
103
|
+
### Setting `YTFETCH_UPDATE`
|
|
104
|
+
|
|
105
|
+
Set the value to `nightly` for daily checks or `stable` for weekly checks.
|
|
106
|
+
Changes to startup files or Windows user variables take effect in new terminal
|
|
107
|
+
sessions unless you also set the variable in the current session.
|
|
108
|
+
|
|
109
|
+
**Bash (Linux/macOS)** — append the setting to `~/.bashrc` so it persists
|
|
110
|
+
across sessions, then load it into the current session:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
printf '\nexport YTFETCH_UPDATE=nightly\n' >> ~/.bashrc
|
|
114
|
+
source ~/.bashrc
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
If your login shell does not load `~/.bashrc`, add the line to the startup file
|
|
118
|
+
it does load, such as `~/.profile`. On macOS, the default shell is usually zsh;
|
|
119
|
+
for zsh, use `~/.zshrc` instead:
|
|
120
|
+
|
|
121
|
+
```zsh
|
|
122
|
+
printf '\nexport YTFETCH_UPDATE=nightly\n' >> ~/.zshrc
|
|
123
|
+
source ~/.zshrc
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Run the append command only once. To change or remove the setting later, edit
|
|
127
|
+
the corresponding startup file.
|
|
128
|
+
|
|
129
|
+
**Fish** — set a persistent, exported variable:
|
|
130
|
+
|
|
131
|
+
```fish
|
|
132
|
+
set -Ux YTFETCH_UPDATE nightly
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Use `stable` instead of `nightly` to select the stable update channel.
|
|
136
|
+
|
|
137
|
+
**Windows PowerShell** — set the variable for your Windows user account:
|
|
138
|
+
|
|
139
|
+
```powershell
|
|
140
|
+
[Environment]::SetEnvironmentVariable("YTFETCH_UPDATE", "nightly", "User")
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
This applies to newly opened terminals. To set it in the current PowerShell
|
|
144
|
+
session too, run:
|
|
145
|
+
|
|
146
|
+
```powershell
|
|
147
|
+
$env:YTFETCH_UPDATE = "nightly"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Windows Environment Variables settings** — to set it manually:
|
|
151
|
+
|
|
152
|
+
1. Open Start and search for **Edit environment variables for your account**.
|
|
153
|
+
2. Under **User variables**, choose **New...**, or select `YTFETCH_UPDATE` and
|
|
154
|
+
choose **Edit...** if it already exists.
|
|
155
|
+
3. Set the variable name to `YTFETCH_UPDATE` and its value to `nightly` or
|
|
156
|
+
`stable`, then confirm the dialogs.
|
|
157
|
+
4. Open a new terminal for the change to take effect.
|
|
158
|
+
|
|
159
|
+
To check the value, use `echo "$YTFETCH_UPDATE"` in bash/zsh,
|
|
160
|
+
`echo $YTFETCH_UPDATE` in fish, or `$env:YTFETCH_UPDATE` in PowerShell.
|
|
161
|
+
|
|
162
|
+
Notes:
|
|
163
|
+
|
|
164
|
+
- If an update fails, the next retry happens after **1 hour** instead of the
|
|
165
|
+
normal interval.
|
|
166
|
+
- To disable persistently in bash/zsh, remove the export line from the startup
|
|
167
|
+
file; run `unset YTFETCH_UPDATE` to disable it in the current session.
|
|
168
|
+
- In fish, use `set -eU YTFETCH_UPDATE` to remove the persistent universal
|
|
169
|
+
variable. To disable updates only in the current session, use
|
|
170
|
+
`set -gx YTFETCH_UPDATE ""`.
|
|
171
|
+
- In Windows, remove the User variable; to disable it in the current
|
|
172
|
+
PowerShell session, run `Remove-Item Env:YTFETCH_UPDATE`.
|
|
173
|
+
|
|
174
|
+
### Switching from nightly to stable
|
|
175
|
+
|
|
176
|
+
`uv tool upgrade` never downgrades. If a nightly build is installed and you
|
|
177
|
+
switch to `stable`, yt-dlp will stay on the nightly until a **newer** stable
|
|
178
|
+
release appears — then stable takes over automatically.
|
|
179
|
+
|
|
180
|
+
To switch immediately, force-reinstall:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
uv tool install --reinstall ytfetch
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## 🚀 Usage
|
|
187
|
+
|
|
188
|
+
### General Syntax and Options
|
|
189
|
+
|
|
190
|
+
```text
|
|
191
|
+
usage: ytfetch [OPTIONS] [yt-dlp OPTIONS] URL ...
|
|
192
|
+
|
|
193
|
+
options:
|
|
194
|
+
-h Show this help message and exit
|
|
195
|
+
--help Show yt-dlp help message and exit
|
|
196
|
+
-avcmp3 Download video in AVC (h.264) & audio in mp3 format
|
|
197
|
+
-q QUALITY Video quality (e.g., 1080, 720). Default will pick best video
|
|
198
|
+
-mp3 Extract audio only as MP3
|
|
199
|
+
-audio Extract audio only (bestaudio)
|
|
200
|
+
-list [NAME] List playlist contents. Accepts values for searching across playlist
|
|
201
|
+
|
|
202
|
+
output template aliases:
|
|
203
|
+
-o autonumber/num -> playlist-numbered naming
|
|
204
|
+
-o music/song -> title + artist naming
|
|
205
|
+
-o default -> default ytdlp naming
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Examples
|
|
209
|
+
|
|
210
|
+
#### Downloading
|
|
211
|
+
|
|
212
|
+
Download a video at the best quality:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
ytfetch "VIDEO_URL"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Download a video in 1080p:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
ytfetch -q 1080 "VIDEO_URL"
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
List the available formats for a video:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
ytfetch -F "VIDEO_URL"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Download a video as AVC/H.264 with MP3 audio in an MP4 container:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
ytfetch -avcmp3 "VIDEO_URL"
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
#### Audio
|
|
237
|
+
|
|
238
|
+
Extract audio only (best available audio):
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
ytfetch -audio "VIDEO_URL"
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Extract audio as MP3:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
ytfetch -mp3 "VIDEO_URL"
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
#### Listing and searching playlists
|
|
251
|
+
|
|
252
|
+
List a playlist:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
ytfetch -list "PLAYLIST_URL"
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
List only entries 10 through 50:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
ytfetch -I "10:50" -list "PLAYLIST_URL"
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
List in reverse order:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
ytfetch -I "30:20:-1" -list "PLAYLIST_URL"
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Search a playlist by title (case-insensitive):
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
ytfetch -list "remix" "PLAYLIST_URL"
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
#### Downloading part of a playlist
|
|
277
|
+
|
|
278
|
+
Download only items 10 through 50:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
ytfetch -I "10:50" "PLAYLIST_URL"
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Download from item 30 backwards to 20 in reverse order:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
ytfetch -I "30:20:-1" "PLAYLIST_URL"
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
#### Output templates and paths
|
|
291
|
+
|
|
292
|
+
Use the playlist-numbered naming scheme:
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
ytfetch -o num "PLAYLIST_URL"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Use the music scheme (title + artist):
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
ytfetch -o music "VIDEO_URL"
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Use the default naming scheme of yt-dlp:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
ytfetch -o default "VIDEO_URL"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Download songs with thumbnail and metadata embedded, using the music template:
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
ytfetch -o music --embed-thumbnail --embed-metadata "VIDEO_URL"
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Use a download archive to skip already-downloaded items:
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
ytfetch --embed-thumbnail --embed-metadata --download-archive archive.txt -o music "PLAYLIST_URL"
|
|
320
|
+
```
|
|
321
|
+
Save to a custom directory:
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
ytfetch "VIDEO_URL" --paths "~/Downloads"
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
#### Downloading a specific time range
|
|
328
|
+
|
|
329
|
+
Download only a portion of the video:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
ytfetch --download-sections "*0:30-2:00" "VIDEO_URL"
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
#### Rate limiting
|
|
336
|
+
|
|
337
|
+
Sleep between downloads to avoid rate limits:
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
ytfetch --sleep-interval 5 --max-sleep-interval 15 "PLAYLIST_URL"
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
_and so on..._
|
|
344
|
+
|
|
345
|
+
## 🔖 License
|
|
346
|
+
|
|
347
|
+
MIT License
|
ytfetch-3.0.0/README.md
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# ytFetch
|
|
2
|
+
|
|
3
|
+
**ytfetch** simplifies media downloading and playlist management by adding playlist searching, and streamlined format handling on top of [yt-dlp](https://github.com/yt-dlp/yt-dlp) engine.
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- **Search:** Use `-list` to display or search across one or more playlists.
|
|
8
|
+
- **Direct Download:** Download video in AVC/H.264 with MP3 audio, or extract audio only.
|
|
9
|
+
- **Video Quality:** Set the preferred video quality directly.
|
|
10
|
+
- **Native Compatibility:** Can also pass through any `yt-dlp` flag.
|
|
11
|
+
- **Minimal logs:** Clean and minimal logs.
|
|
12
|
+
- **Auto-Update:** Automatically checks for updates to ytfetch and its dependencies when enabled.
|
|
13
|
+
|
|
14
|
+
## 📋 Requirements
|
|
15
|
+
|
|
16
|
+
- [Python](https://www.python.org/): 3.11 or higher.
|
|
17
|
+
- [uv](https://docs.astral.sh/uv/getting-started/installation/): recommended, optional.
|
|
18
|
+
- [FFmpeg](https://ffmpeg.org/) and [FFprobe](https://ffmpeg.org/ffprobe.html): Must be available in your system PATH.
|
|
19
|
+
Download builds from [here](https://ffmpeg.org/download.html).
|
|
20
|
+
<details>
|
|
21
|
+
<summary>or using your system's package manager</summary>
|
|
22
|
+
- On Windows:
|
|
23
|
+
```bash
|
|
24
|
+
winget install BtbN.FFmpeg.GPL
|
|
25
|
+
```
|
|
26
|
+
or
|
|
27
|
+
```bash
|
|
28
|
+
winget install Gyan.FFmpeg
|
|
29
|
+
```
|
|
30
|
+
- On Termux (android):
|
|
31
|
+
```bash
|
|
32
|
+
pkg install ffmpeg
|
|
33
|
+
```
|
|
34
|
+
- On Mac (using Homebrew):
|
|
35
|
+
```bash
|
|
36
|
+
brew install ffmpeg
|
|
37
|
+
```
|
|
38
|
+
</details>
|
|
39
|
+
|
|
40
|
+
- [Deno](https://deno.com/): Or other JavaScript runtime/engine like [node.js](https://nodejs.org/en) or [bun](https://bun.sh/).
|
|
41
|
+
|
|
42
|
+
Check this [guide](https://github.com/yt-dlp/yt-dlp/wiki/EJS) for more info.
|
|
43
|
+
Also check [yt-dlp dependency](https://github.com/yt-dlp/yt-dlp#dependencies) for optional dependencies.
|
|
44
|
+
|
|
45
|
+
<details>
|
|
46
|
+
<summary>On Termux</summary>
|
|
47
|
+
|
|
48
|
+
Install uv or Deno with the `pkg` package manager:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pkg install uv
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pkg install deno
|
|
56
|
+
```
|
|
57
|
+
</details>
|
|
58
|
+
|
|
59
|
+
## 📦 Installation
|
|
60
|
+
|
|
61
|
+
### via uv (Recommended)
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
uv tool install ytfetch
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### via pip
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install ytfetch
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Auto-update is intended for uv tool installations. If enabled while running a
|
|
74
|
+
pip installation, it still runs `uv tool upgrade ytfetch`; that updates a
|
|
75
|
+
uv-managed installation, if present, rather than the pip-installed copy.
|
|
76
|
+
|
|
77
|
+
## 🔄 Auto-Update
|
|
78
|
+
|
|
79
|
+
When enabled, auto-update runs `uv tool upgrade ytfetch`. This upgrades the
|
|
80
|
+
uv-managed ytfetch tool and its dependencies, including yt-dlp. Set the
|
|
81
|
+
`YTFETCH_UPDATE` environment variable to select the update channel:
|
|
82
|
+
|
|
83
|
+
| Value | Channel | Check frequency |
|
|
84
|
+
| --------------- | ---------------------------- | --------------- |
|
|
85
|
+
| `nightly` | yt-dlp nightly (pre-release) | once per day |
|
|
86
|
+
| `stable` | yt-dlp stable | once per week |
|
|
87
|
+
| unset / invalid | disabled | – |
|
|
88
|
+
|
|
89
|
+
### Setting `YTFETCH_UPDATE`
|
|
90
|
+
|
|
91
|
+
Set the value to `nightly` for daily checks or `stable` for weekly checks.
|
|
92
|
+
Changes to startup files or Windows user variables take effect in new terminal
|
|
93
|
+
sessions unless you also set the variable in the current session.
|
|
94
|
+
|
|
95
|
+
**Bash (Linux/macOS)** — append the setting to `~/.bashrc` so it persists
|
|
96
|
+
across sessions, then load it into the current session:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
printf '\nexport YTFETCH_UPDATE=nightly\n' >> ~/.bashrc
|
|
100
|
+
source ~/.bashrc
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
If your login shell does not load `~/.bashrc`, add the line to the startup file
|
|
104
|
+
it does load, such as `~/.profile`. On macOS, the default shell is usually zsh;
|
|
105
|
+
for zsh, use `~/.zshrc` instead:
|
|
106
|
+
|
|
107
|
+
```zsh
|
|
108
|
+
printf '\nexport YTFETCH_UPDATE=nightly\n' >> ~/.zshrc
|
|
109
|
+
source ~/.zshrc
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Run the append command only once. To change or remove the setting later, edit
|
|
113
|
+
the corresponding startup file.
|
|
114
|
+
|
|
115
|
+
**Fish** — set a persistent, exported variable:
|
|
116
|
+
|
|
117
|
+
```fish
|
|
118
|
+
set -Ux YTFETCH_UPDATE nightly
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Use `stable` instead of `nightly` to select the stable update channel.
|
|
122
|
+
|
|
123
|
+
**Windows PowerShell** — set the variable for your Windows user account:
|
|
124
|
+
|
|
125
|
+
```powershell
|
|
126
|
+
[Environment]::SetEnvironmentVariable("YTFETCH_UPDATE", "nightly", "User")
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
This applies to newly opened terminals. To set it in the current PowerShell
|
|
130
|
+
session too, run:
|
|
131
|
+
|
|
132
|
+
```powershell
|
|
133
|
+
$env:YTFETCH_UPDATE = "nightly"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Windows Environment Variables settings** — to set it manually:
|
|
137
|
+
|
|
138
|
+
1. Open Start and search for **Edit environment variables for your account**.
|
|
139
|
+
2. Under **User variables**, choose **New...**, or select `YTFETCH_UPDATE` and
|
|
140
|
+
choose **Edit...** if it already exists.
|
|
141
|
+
3. Set the variable name to `YTFETCH_UPDATE` and its value to `nightly` or
|
|
142
|
+
`stable`, then confirm the dialogs.
|
|
143
|
+
4. Open a new terminal for the change to take effect.
|
|
144
|
+
|
|
145
|
+
To check the value, use `echo "$YTFETCH_UPDATE"` in bash/zsh,
|
|
146
|
+
`echo $YTFETCH_UPDATE` in fish, or `$env:YTFETCH_UPDATE` in PowerShell.
|
|
147
|
+
|
|
148
|
+
Notes:
|
|
149
|
+
|
|
150
|
+
- If an update fails, the next retry happens after **1 hour** instead of the
|
|
151
|
+
normal interval.
|
|
152
|
+
- To disable persistently in bash/zsh, remove the export line from the startup
|
|
153
|
+
file; run `unset YTFETCH_UPDATE` to disable it in the current session.
|
|
154
|
+
- In fish, use `set -eU YTFETCH_UPDATE` to remove the persistent universal
|
|
155
|
+
variable. To disable updates only in the current session, use
|
|
156
|
+
`set -gx YTFETCH_UPDATE ""`.
|
|
157
|
+
- In Windows, remove the User variable; to disable it in the current
|
|
158
|
+
PowerShell session, run `Remove-Item Env:YTFETCH_UPDATE`.
|
|
159
|
+
|
|
160
|
+
### Switching from nightly to stable
|
|
161
|
+
|
|
162
|
+
`uv tool upgrade` never downgrades. If a nightly build is installed and you
|
|
163
|
+
switch to `stable`, yt-dlp will stay on the nightly until a **newer** stable
|
|
164
|
+
release appears — then stable takes over automatically.
|
|
165
|
+
|
|
166
|
+
To switch immediately, force-reinstall:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
uv tool install --reinstall ytfetch
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## 🚀 Usage
|
|
173
|
+
|
|
174
|
+
### General Syntax and Options
|
|
175
|
+
|
|
176
|
+
```text
|
|
177
|
+
usage: ytfetch [OPTIONS] [yt-dlp OPTIONS] URL ...
|
|
178
|
+
|
|
179
|
+
options:
|
|
180
|
+
-h Show this help message and exit
|
|
181
|
+
--help Show yt-dlp help message and exit
|
|
182
|
+
-avcmp3 Download video in AVC (h.264) & audio in mp3 format
|
|
183
|
+
-q QUALITY Video quality (e.g., 1080, 720). Default will pick best video
|
|
184
|
+
-mp3 Extract audio only as MP3
|
|
185
|
+
-audio Extract audio only (bestaudio)
|
|
186
|
+
-list [NAME] List playlist contents. Accepts values for searching across playlist
|
|
187
|
+
|
|
188
|
+
output template aliases:
|
|
189
|
+
-o autonumber/num -> playlist-numbered naming
|
|
190
|
+
-o music/song -> title + artist naming
|
|
191
|
+
-o default -> default ytdlp naming
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Examples
|
|
195
|
+
|
|
196
|
+
#### Downloading
|
|
197
|
+
|
|
198
|
+
Download a video at the best quality:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
ytfetch "VIDEO_URL"
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Download a video in 1080p:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
ytfetch -q 1080 "VIDEO_URL"
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
List the available formats for a video:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
ytfetch -F "VIDEO_URL"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Download a video as AVC/H.264 with MP3 audio in an MP4 container:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
ytfetch -avcmp3 "VIDEO_URL"
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
#### Audio
|
|
223
|
+
|
|
224
|
+
Extract audio only (best available audio):
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
ytfetch -audio "VIDEO_URL"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Extract audio as MP3:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
ytfetch -mp3 "VIDEO_URL"
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
#### Listing and searching playlists
|
|
237
|
+
|
|
238
|
+
List a playlist:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
ytfetch -list "PLAYLIST_URL"
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
List only entries 10 through 50:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
ytfetch -I "10:50" -list "PLAYLIST_URL"
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
List in reverse order:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
ytfetch -I "30:20:-1" -list "PLAYLIST_URL"
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Search a playlist by title (case-insensitive):
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
ytfetch -list "remix" "PLAYLIST_URL"
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
#### Downloading part of a playlist
|
|
263
|
+
|
|
264
|
+
Download only items 10 through 50:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
ytfetch -I "10:50" "PLAYLIST_URL"
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Download from item 30 backwards to 20 in reverse order:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
ytfetch -I "30:20:-1" "PLAYLIST_URL"
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
#### Output templates and paths
|
|
277
|
+
|
|
278
|
+
Use the playlist-numbered naming scheme:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
ytfetch -o num "PLAYLIST_URL"
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Use the music scheme (title + artist):
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
ytfetch -o music "VIDEO_URL"
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Use the default naming scheme of yt-dlp:
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
ytfetch -o default "VIDEO_URL"
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
Download songs with thumbnail and metadata embedded, using the music template:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
ytfetch -o music --embed-thumbnail --embed-metadata "VIDEO_URL"
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Use a download archive to skip already-downloaded items:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
ytfetch --embed-thumbnail --embed-metadata --download-archive archive.txt -o music "PLAYLIST_URL"
|
|
306
|
+
```
|
|
307
|
+
Save to a custom directory:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
ytfetch "VIDEO_URL" --paths "~/Downloads"
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
#### Downloading a specific time range
|
|
314
|
+
|
|
315
|
+
Download only a portion of the video:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
ytfetch --download-sections "*0:30-2:00" "VIDEO_URL"
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
#### Rate limiting
|
|
322
|
+
|
|
323
|
+
Sleep between downloads to avoid rate limits:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
ytfetch --sleep-interval 5 --max-sleep-interval 15 "PLAYLIST_URL"
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
_and so on..._
|
|
330
|
+
|
|
331
|
+
## 🔖 License
|
|
332
|
+
|
|
333
|
+
MIT License
|
|
@@ -4,20 +4,20 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ytfetch"
|
|
7
|
-
version = "
|
|
8
|
-
description = "A wrapper for yt-dlp with
|
|
7
|
+
version = "3.0.0"
|
|
8
|
+
description = "A wrapper for yt-dlp with some flexible args"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "voidsnax" }
|
|
11
11
|
]
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
license = { text = "MIT" }
|
|
14
|
-
requires-python = ">=3.
|
|
14
|
+
requires-python = ">=3.11"
|
|
15
15
|
dependencies = [
|
|
16
16
|
"yt-dlp[default,curl-cffi]",
|
|
17
17
|
"colorama"
|
|
18
18
|
]
|
|
19
19
|
|
|
20
|
-
keywords = ["youtubedownloader", "converter", "h264", "mp3", "playlist"]
|
|
20
|
+
keywords = ["downloader", "youtubedownloader", "converter", "h264", "mp3", "playlist"]
|
|
21
21
|
|
|
22
22
|
[project.urls]
|
|
23
23
|
Homepage = "https://github.com/voidsnax/ytFetch"
|