viper25

Download YouTube

Oct 20th, 2016 (edited)
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.45 KB | None | 0 0
  1. Download only audio
  2. set url = http://www.youtube.com/watch?v=Q-p9MDAw2yyEE
  3. youtube-dl %url% --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --output "%(title)s.%(ext)s" --batch-file ./my_list_of_URLs.txt
  4.  
  5. In a batch file:
  6. youtube-dl %url% --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 160K --output %%(title)s.^%%(ext)s
  7.  
  8. OLD:
  9.     youtube-dl -f 140 http://www.youtube.com/watch?v=Q-p9MDAw2yyEE
  10.     youtube-dl -f 140 https://www.youtube.com/playlist?list=PLeKaU7RrCHNoy_8WHfm2irN5z7_sdSsYd
  11.  
  12.     ffmpeg.exe -v 5 -y -i input.m4a -acodec libmp3lame -ac 2 -ab 128k output.mp3
  13.  
  14.     In one command:
  15.     youtube-dl -f 140 %url% -o - | ffmpeg.exe -v 5 -y -i pipe: -acodec libmp3lame -ac 2 -ab 128k %(title)s-.mp3
  16. ==========================
  17. Download a playlist
  18.  
  19. youtube-dl.exe --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" https://www.youtube.com/playlist?list=PLeKaU7RrCHNoy_8WHfm2irN5z7_sdSsYd
  20.  
  21. If the above doesn't work use this (download audio stream):
  22. youtube-dl -i -f mp3 --yes-playlist  https://www.youtube.com/playlist?list=PLAxUii9jTsdxZ7SuRbRn4KyTzLa8QTCT_
  23.  
  24. ==========================
  25. Convert a bunch of files
  26.  
  27. for %A in ("*.m4a") do call "ffmpeg.exe" -v 5 -y -i "%A" -acodec libmp3lame -ac 2 -ab 128k "newfiles\%~nA.mp3"
  28.  
  29. Convert webm to mp3
  30.  
  31. for %FILE in *.webm; do
  32.     echo -e "Processing video '\e[32m$FILE\e[0m'";
  33.     ffmpeg -i "${FILE}" "${FILE%.webm}.mp3";
  34. done;
  35.  
  36. ==========================
  37. Continuously download a playlist. archive.txt contains a list of files already downloaded. E.g.
  38. youtube mI3Xig4IfqI
  39. youtube 0Q2zD-mI3Xig4IfqI
  40.  
  41. LOGFILE="$PWD/download_logs_$(date +"%Y_%m_%d_%H_%M_%S").log"
  42.  
  43. exec 3>&1 4>&2 >>$LOGFILE 2>&1
  44. ./youtube-dl --verbose --ignore-errors --no-continue --no-overwrites --keep-video --no-post-overwrites --download-archive archive.txt --output "my_videos/%(title)s - %(upload_date)s.%(ext)s" -f bestvideo[ext=mp4]+bestaudio[ext=m4a] -- $1
  45.  
  46. OR try:
  47. ./youtube-dl --download-archive archive.txt --add-metadata -f bestvideo[ext=vp9]+bestaudio[ext=opus]/bestvideo+bestaudio --merge-output-format mkv -i -o "my_videos/%(uploader)s/%(playlist)s/%(title)s.%(ext)s" 29DwZkz0jWI -- $1
  48.  
  49.  
  50. ==========================
  51. Download the best Audio quality
  52. youtube-dl -f bestaudio -o "%(title)s.%(ext)s" nlcIKh6sBtc
  53. youtube-dl -f bestaudio -o "%(title)s.%(ext)s" --yes-playlist https://www.youtube.com/playlist?list=PLm2nCoXppbGez_O4C75BVplAzsvwFh0Uq
  54. ffmpeg -i input.webm output.mp3
Add Comment
Please, Sign In to add comment