#!/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 two programs: # youtube_dl and ffmpg # 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 # ffmpeg -i $i -ab 128 -ar 44100 $i.mp3 mplayer -dumpaudio $i -dumpfile $i.mp3 rm $i done