Date created: Monday, May 18, 2020 3:22:02 PM. Last modified: Monday, October 14, 2024 2:34:20 PM

'youtube-dl' Notes

Update:

$ sudo -H pip3 install -U youtube-dl

 

List available formats:

$ youtube-dl -F https://www.youtube.com/watch?v=aL4shpt17Mw
[youtube] aL4shpt17Mw: Downloading webpage
[youtube] aL4shpt17Mw: Downloading video info webpage
[info] Available formats for aL4shpt17Mw:
format code extension resolution note
249 webm audio only tiny 53k , opus @ 50k (48000Hz), 758.66KiB
250 webm audio only tiny 70k , opus @ 70k (48000Hz), 996.79KiB
140 m4a audio only tiny 128k , m4a_dash container, mp4a.40.2@128k (44100Hz), 2.04MiB
251 webm audio only tiny 131k , opus @160k (48000Hz), 1.93MiB
278 webm 192x144 144p 27k , webm container, vp9, 25fps, video only, 188.89KiB
160 mp4 192x144 144p 53k , avc1.4d400c, 15fps, video only, 425.64KiB
242 webm 320x240 240p 54k , vp9, 25fps, video only, 311.75KiB
243 webm 480x360 360p 87k , vp9, 25fps, video only, 475.78KiB
133 mp4 320x240 240p 120k , avc1.4d400d, 25fps, video only, 907.37KiB
244 webm 640x480 480p 150k , vp9, 25fps, video only, 814.36KiB
134 mp4 480x360 360p 185k , avc1.4d4015, 25fps, video only, 1.69MiB
135 mp4 640x480 480p 390k , avc1.4d401e, 25fps, video only, 2.67MiB
18 mp4 480x360 360p 158k , avc1.42001E, 25fps, mp4a.40.2@ 96k (44100Hz), 2.55MiB (best)

 

Download one of the available formats listed above by format code:

$ youtube-dl -f 140 https://www.youtube.com/watch?v=aL4shpt17Mw

 

Automatically download the best quality audio available in m4a format:

$ youtube-dl -f 'bestaudio[ext=m4a]' https://www.youtube.com/watch?v=aL4shpt17Mw

 

Automatically download the best quality audio available in YouTube's native format (which is likely m4a):

$ youtube-dl -f bestaudio https://www.youtube.com/watch?v=aL4shpt17Mw

 

Download the best quality audio available and convert it to a specific format, mp3 in this example:

$ youtube-dl -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0 https://www.youtube.com/watch?v=aL4shpt17Mw

 


Previous page: 'wget' - Notes
Next page: 'yt-dlp' - Notes