Download media with yt-dlp, with sane options, to expected locations.
Recommended Extra Setup:
Just run this python uv script:
```
uv run --script ${baseDir}/dl.py $url
```
Which will auto detect Video/Music and Single/Playlist info from the url, and save to corresponding locations.
Or, you can still use following shell cmds:
Download Single Video, save into ~/Movies as mp4:
```
uvx yt-dlp@latest --js-runtime node --remote-components ejs:github \
-f "bestvideo[vcodec^=avc1]+bestaudio/best" --merge-output-format=mp4 --max-filesize=2000M \
-P "$HOME/Movies" \
-o "%(title).240B.%(ext)s" --no-playlist \
${url}
```
Download Video Playlist, save into ~/Movies/<playlist>/ as mp4:
```
uvx yt-dlp@latest --js-runtime node --remote-components ejs:github \
-f "bestvideo[vcodec^=avc1]+bestaudio/best" --merge-output-format=mp4 --max-filesize=2000M \
-P "$HOME/Movies" \
-o "%(playlist_title)s/%(title).240B.%(ext)s" --max-downloads=30 \
${url}
```
Download Single Music, save into ~/Music as m4a:
```
uvx yt-dlp@latest --js-runtime node --remote-components ejs:github \
-f "bestaudio/best" --extract-audio --audio-format=m4a --audio-quality=0 --max-filesize=30M \
-P "$HOME/Music" \
-o "%(title).240B.%(ext)s" --no-playlist \
${url}
```
Download Music Playlist, save into ~/Music/<playlist>/ as m4a:
```
uvx yt-dlp@latest --js-runtime node --remote-components ejs:github \
-f "bestaudio/best" --extract-audio --audio-format=m4a --audio-quality=0 --max-filesize=30M \
-P "$HOME/Music" \
-o "%(playlist_title)s/%(title).240B.%(ext)s" --max-downloads=30 \
${url}
```
Tips:
Adjust the cmds when needed.
Leave a review
No reviews yet. Be the first to review this skill!