Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # youtube-dl-playlist-to-mp3
- #
- # Utility to download Youtube playlist videos and ripp off their audio into mp3
- #
- # @author Angel Docampo
- # @license WTFPL version 2
- # some minor improvements made by Stormer97 (all credit for the original script to Mr. Docampo)
- echo "This script is useful when you want to download and rip a complete Youtuble playlist into mp3"
- echo "Enter a name for the playlist"
- read -r NAME
- echo "Enter the Youtube playlist URL to begin the process (e.g: http://www.youtube.com/playlist?list=PL3DFF2F30C0A04640 ):"
- read PL
- rm -rf "$NAME"
- mkdir "$NAME" && cd "$NAME"
- rm -rf .tmp
- mkdir .tmp && cd .tmp
- youtube-dl -o '%(stitle)s.%(ext)s' $PL --ignore-errors
- for i in *.flv; do
- ffmpeg -i "$i" -acodec libmp3lame -ac 2 -ab 128 "${i%flv}mp3";
- done
- for i in *.mp4; do
- ffmpeg -i "$i" -acodec libmp3lame -ac 2 -ab 128 "${i%mp4}mp3";
- done
- rm -rf *.flv *.mp4
- cd .. && mv .tmp/*.mp3 . && rm -rf .tmp
- echo "Conversion finished!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement