Skip to content

Instantly share code, notes, and snippets.

@leviathan
Last active March 29, 2023 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leviathan/517db799bdff3e2f4079f78913b66262 to your computer and use it in GitHub Desktop.
Save leviathan/517db799bdff3e2f4079f78913b66262 to your computer and use it in GitHub Desktop.
youtube-dl command line

youtube-dl command line

Use master version directly via:

python3 -m pip install --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz
yt-dlp xx

https://github.com/ytdl-org/youtube-dl

$ youtube-dl https://www.youtube.com/watch?v=36GT2zI8lVA

Use -F option to list the available formats for the video.

$> youtube-dl -F https://www.youtube.com/watch\?v\=36GT2zI8lVA
[youtube] 36GT2zI8lVA: Downloading webpage
[info] Available formats for 36GT2zI8lVA:
format code  extension  resolution note
249          webm       audio only tiny   50k , webm_dash container, opus @ 50k (48000Hz), 2.74MiB
250          webm       audio only tiny   67k , webm_dash container, opus @ 67k (48000Hz), 3.63MiB
140          m4a        audio only tiny   95k , m4a_dash container, mp4a.40.2@ 95k (44100Hz), 5.13MiB
251          webm       audio only tiny   99k , webm_dash container, opus @ 99k (48000Hz), 5.35MiB
160          mp4        192x144    144p   43k , mp4_dash container, avc1.4d400c@  43k, 30fps, video only, 2.35MiB
278          webm       192x144    144p   71k , webm_dash container, vp9@  71k, 30fps, video only, 3.86MiB
133          mp4        320x240    240p   82k , mp4_dash container, avc1.4d400d@  82k, 30fps, video only, 4.44MiB
242          webm       320x240    240p  144k , webm_dash container, vp9@ 144k, 30fps, video only, 7.78MiB
18           mp4        320x240    240p  333k , avc1.42001E, 30fps, mp4a.40.2 (44100Hz), 18.00MiB (best)

Pick one of the listed format code and use it to download just the specific video format.

$> youtube-dl -f 18 https://www.youtube.com/watch\?v\=36GT2zI8lVA
[youtube] 36GT2zI8lVA: Downloading webpage
[download] Destination: Richard Feynman. Why.-36GT2zI8lVA.mp4
[download] 100% of 18.00MiB in 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment