Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # This script downloads YouTube videos and converts them
- # You will end up with an MPG video and MP3 audio of each YouTube movie
- # You need to install the following three programs:
- # youtube_dl, ffmpeg, and mplayer
- # Use this script at your own risk!
- # Make sure that you understand how it works before you use it!
- # USAGE:
- # Make a file called videos.txt with the URL of 1 YouTube video on each line.
- # Don't leave any blank lines in the file
- # Put the videos.txt file in an empty folder along with this script
- # run this script with the following commands:
- # $ ./youtube_downloader.sh
- # It will take a long time to run, depending on
- # how many videos you have in your videos.txt file.
- while read inputline
- do
- youtube_url="$(echo $inputline)"
- youtube-dl $youtube_url
- done < videos.txt
- # Convert the flv files to mpg and mp3 files
- for i in *.flv
- do
- ffmpeg -i $i $i.mpg
- # comment out the next line if you don't want MP3's extracted
- mplayer -dumpaudio $i -dumpfile $i.mp3
- # The next line deletes all FLV files in the current directory to cleanup
- rm $i
- done
Add Comment
Please, Sign In to add comment