Download videos from youtube, vimeo, dailymotion, etc.
- youtube-dl http://www.youtube.com/watch?v=w0zw3POq8V4
- youtube-dl http://vimeo.com/75748826
Video id can be used instead of url for youtube:
Multiple videos can downloaded at once
- youtube-dl xklR0Qta3UM IbrOuw2Cumo XbS9Psv_GvQ
File name as video title:
- youtube-dl -t http://www.youtube.com/watch?v=w0zw3POq8V4
Resume if broken downlad (default):
- youtube-dl -c http://www.youtube.com/watch?v=w0zw3POq8V4
Filename from template:
Available parameters: %(id)s , %(url)s , %(uploader)s , %(upload_date)s , %(title)s , %(ext)s , %(autonumber)s , %(epoch)s
- youtube-dl w0zw3POq8V4 -o "%(title)s.%(upload_date)s"
Allow only ASCII chars in filename: --restrict-filenames
- youtube-dl -c --restrict-filenames -f 5/36/17 --extract-audio -o "%(upload_date)s_%(title)s.%(ext)s" qQ2KMKsGpsw ZAPqgh9kktk fQKWX7iYtxY
Download multiple videos with specified formats:
- youtube-dl -f 5/36/17 -o "%(upload_date)s_%(title)s.%(ext)s" xklR0Qta3UM IbrOuw2Cumo XbS9Psv_GvQ
- youtube-dl -i -c --restrict-filenames -f 5/36/17 --extract-audio -o "%(upload_date)s_%(title)s.%(ext)s" qQ2KMKsGpsw ZAPqgh9kktk fQKWX7iYtxY
Download Video and Extract Audio (ffmpeg required):
- youtube-dl --extract-audio xklR0Qta3UM
- youtube-dl --extract-audio --audio-quality 64k --audio-format mp3 XbS9Psv_GvQ
--audio-format: best, mp3, vorbis, wav, aac, m4a
List available formats for a video:
- youtube-dl -F RuH2w8RQeSE
Download using youtube video format and order: -f 22/18/17
webm or mp4:
- youtube-dl -f 46/45/44/22/18/17 http://www.youtube.com/watch?v=0pS5276PvA4
flv:
- youtube-dl -f 35/34/6/5 http://www.youtube.com/watch?v=0pS5276PvA4
Download video by specifying format and extension:
- youtube-dl -f "bestvideo[ext=mp4]+bestaudio/best" vid
- youtube-dl -f "best[ext=mp4]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best" vid
- youtube-dl -f "((bestvideo[vcodec^=vp9]/bestvideo)+(bestaudio[acodec=opus]/bestaudio[acodec=vorbis]/bestaudio[acodec=aac]/bestaudio))/bestvideo[ext=mp4]+bestaudio/best" vid
get download url of youtube video:
- youtube-dl -g 7XviqLltItk
get audio-only url of youtube video:
- youtube-dl -x -g 7XviqLltItk
play only audio of a youtube video by vlc:
- vlc $(youtube-dl -x -g 7XviqLltItk)
download audio from youtube as named file:
- wget $(youtube-dl --extract-audio -g "https://www.youtube.com/watch?v=ALlN8WEgH9s") -O abc.mp3
process youtube video directly with ffmpeg:
- ffmpeg -i "$(youtube-dl --extract-audio -g C8bJ5KVecmM)" -r 44100 "video.mp3"
change speed of youtube audio directly using ffmpeg:
- ffmpeg -i "$(youtube-dl --extract-audio -g C8bJ5KVecmM)" -filter:a "atempo=2.0" -r 44100 "video.mp3"
change audio speed of youtube audio:
- youtube-dl -x --exec "ffmpeg -i {} -filter:a 'atempo=2.0' {}.mp3" QauviCmyzCw
- youtube-dl --audio-format mp3 -x --postprocessor-args "-acodec libmp3lame -filter:a 'atempo=2.0'" QauviCmyzCw
get youtube video title:
- youtube-dl --get-filename --get-title vid
download best video option by size:
- youtube-dl -f "bestvideo[height<=480]+bestaudio/best[height<=480]" RuH2w8RQeSE
get direct url by proxy:
- youtube-dl -g -f 'best[height<=720]/best' --proxy socks5://127.0.0.1:9999/ url
play video directy by getting direct url using proxy:
- mpv --framedrop vo --cache=55000 $(youtube-dl -g -f "best[height<=720]/best" --proxy socks5://127.0.0.1:9999/ url )
process audio after downloading it:
- youtube-dl -v --no-mtime -x --exec 'ffmpeg -y -i {} -acodec libmp3lame -af "atempo=1.6, dynaudnorm=f=500:g=33" {}.mp3; rm {}' "m4JowCM3urk";
search in youtube:
- youtube-dl -s "ytsearch1:mbirgin"
download only subtitles from a youtube video:
- youtube-dl --all-subs --sub-format srt --skip-download https://youtu.be/n9RotLbBtAY
Download videos from youtube playlist:
- youtube-dl http://www.youtube.com/playlist?list=PLH0rzehjnXflsOI4c1kdYD6iz3Uh-iGE3
Download a range from playlist:
- youtube-dl --playlist-start 5 --playlist-end 10 http://www.youtube.com/playlist?list=PLH0rzehjnXflsOI4c1kdYD6iz3Uh-iGE3
- youtube-dl --playlist-start 2 --max-downloads 11 http://www.youtube.com/playlist?list=PLH0rzehjnXflsOI4c1kdYD6iz3Uh-iGE3
Download only matched and/or remove matched videos (REGEX or sub-string):
- youtube-dl --match-title ".*radyo.*" --reject-title "ingiliz" http://www.youtube.com/playlist?list=PLH0rzehjnXflsOI4c1kdYD6iz3Uh-iGE3
Convert video by using pipe and ffmpeg
- youtube-dl OkBbZvkL9XY -o - | ffmpeg -i - -c:v libvpx -c:a libvorbis test.webm
- youtube-dl -f 5 OkBbZvkL9XY -o - | ffmpeg -i - -vn -acodec copy pipe.mp3
- youtube-dl OkBbZvkL9XY -o - | ffmpeg -i - -vn -c:a libvorbis -ab 48k -ac 1 -ar 44100 test.ogg
Note: datebefore, dateafter parameters also can be used to filter videos by upload date.
Download audio only from playlist and don't repeat the previously downloaded videos:
If the process stopped, youtube-dl trying to download the same files again.
By creating download archive file, youtube-dl will not try to download the completed videos.
youtube-dl --download-archive downloaded.txt --no-post-overwrites --no-overwrites -c -x --audio-format mp3 "https://www.youtube.com/watch?v=PWSjq7mjn8o&list=OLAK5uy_n-G7iiIDJbjefCOd3Y3vEG_KuX8aKkAvc";