Created Wed Jul, 09 2025 at 03:36PM
I recently had to download some web video from a popular site to learn FreeCAD. I kept trying various arguments that didn't always work correctly.. often i'd get pretty crappy quality or no audio. This has been working really well so far and it downloads entire playlists and names them so they retain their ordering. e.g. 01 - orig title.mp4, 02 - next title.mp4
#!/bin/sh
if [ $# -lt 1 ];then
echo "Usage: $0 <playlist URL>"
fi
set -x
yt-dlp --embed-metadata --embed-thumbnail --embed-chapters \
--sub-lang en --sub-format srt/vtt --write-auto-sub --progress \
--yes-playlist --restrict-filenames -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" \
-f "bv*[height>=1440][ext=mp4][vcodec^=avc1]+ba*[ext=m4a],bv*[height>=1080][ext=mp4][vcodec^=avc1]+ba*[ext=m4a],bv*[height>=720][ext=mp4][vcodec^=avc1]+ba*[ext=m4a]" \
-N 4 -S +res,+fps --parse-metadata "playlist_index:%(track_number)s" $*