Advertisement
Guest User

Untitled

a guest
Jan 10th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #!/bin/bash
  2. # youtube-dl-playlist-to-mp3
  3. #
  4. # Utility to download Youtube playlist videos and ripp off their audio into mp3
  5. #
  6. # @author Angel Docampo
  7. # @license WTFPL version 2
  8. # some minor improvements made by Stormer97 (all credit for the original script to Mr. Docampo)
  9. echo "This script is useful when you want to download and rip a complete Youtuble playlist into mp3"
  10. echo "Enter a name for the playlist"
  11. read -r NAME
  12. echo "Enter the Youtube playlist URL to begin the process (e.g: http://www.youtube.com/playlist?list=PL3DFF2F30C0A04640 ):"
  13. read PL
  14. rm -rf "$NAME"
  15. mkdir "$NAME" && cd "$NAME"
  16. rm -rf .tmp
  17. mkdir .tmp && cd .tmp
  18. youtube-dl -o '%(stitle)s.%(ext)s' $PL --ignore-errors
  19. for i in *.flv; do
  20. ffmpeg -i "$i" -acodec libmp3lame -ac 2 -ab 128 "${i%flv}mp3";
  21. done
  22. for i in *.mp4; do
  23. ffmpeg -i "$i" -acodec libmp3lame -ac 2 -ab 128 "${i%mp4}mp3";
  24. done
  25. rm -rf *.flv *.mp4
  26. cd .. && mv .tmp/*.mp3 . && rm -rf .tmp
  27. echo "Conversion finished!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement