YouTube to MP3?

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
Chris_C
Level 2
Level 2
Posts: 83
Joined: Tue Feb 08, 2011 7:45 pm

Re: YouTube to MP3?

Post by Chris_C »

Anything wrong with: http://www.mediaconverter.org/

*For Legal purposes: The RIAA, the artist or label company can take suit against a person for illegally copying/downloading music. http://en.wikipedia.org/wiki/Music_download
Dell Latitude D620 Dual-Boot Linux Mint 9/Windows XP Home
MrCleanWithHair
Level 1
Level 1
Posts: 15
Joined: Sun Mar 07, 2010 11:51 pm

Re: YouTube to MP3?

Post by MrCleanWithHair »

Theoretically, assuming you own the rights to the video you are converting you can use clive to download the video, mplayer to extract the audio, and vbrfix to fix the length of track because mplayer will probably botch it up.

If you know how to create a bash script here is one I use to pull the audio from videos I own the rights to I post on youtube.
I only offer you this advice and script for legal purposes, please don't abuse it.

#! /bin/bash
#######################
## F U N C T I O N S ##
#######################

unoURL ()
{
clear
mkdir ./.novid.tmp/ #makes the temp directory novid will download video to
cd ./.novid.tmp/
echo ""

echo -n "Please enter the URL: "
read flv2get # the variable to store the hyperlink

echo -n "Enter the absolute path to the directory you wish to save in: "
read savingto_uno # the variable to save the .mp3 to

echo -n "What you like to name the mp3: "
read mp3nome # the variable to name the .mp3

echo ""
echo "******************"
echo "Starting Download."
echo "******************"
echo ""
clive $flv2get #executes clive to download the video at the
hyperlink saved in $flv2get

declare -x mp3name=$mp3nome #this is a bit silly to transfer a
variable for no reason, but i figured it would look more legit...or
dumb. whatever.

declare -x audio2dump=`find -name *.flv` #finds the name of the .flv
file to export to mplayer for extraction

echo ""
echo "********************"
echo "Starting Extraction."
echo "********************"
echo ""

mplayer -dumpaudio $audio2dump -dumpfile $mp3name #takes the audio
out of the .mp3

echo "Download and Extraction complete. Now exiting."

rm -rf *.flv #deletes the .flv videos NoVid downloaded

vbrfix $mp3name $mp3name
rm -rf vbrfix*
mv * $savingto_uno #saves the file to the requested directory

cd ..

rmdir .novid.tmp/ #removes NoVids temp working directory

}



multiURL()
{
count=0

clear
mkdir ./.novid.tmp/ #makes the temp directory novid will download video to
cd ./.novid.tmp/
echo ""

echo -n "Please enter the absolute path to the list file: "
read p2list
echo -n "Please enter the absolute path to the save the .mp3 files in: "
read saving_to

getlist=( $( cat "$p2list" ) ) #reads list into an array
countflag=${#getlist[@]} #sets countflag to equal
the number of links

while [ "$count" -lt $countflag ] #start while loop to
process all links in the list
do
clive ${getlist[$count]} #runs clive to pull a .flv
from the website
declare -x audio2dump=`find -name *.flv` #finds
the name of flv to extract audio from
declare -x mp3name=$audio2dump.mp3 #sets the name
of the .mp3 to save the audio to
mplayer -dumpaudio $audio2dump -dumpfile
$mp3name #dumps audio from .flv into a .mp3
rm -rf *.flv #removes the .flv
vbrfix $mp3name $mp3name #fixes the
estimated length because mplayer probably guessed wrong
mv $mp3name $saving_to #moves the .mp3 to
the directory set by user
let "count += 1" #increases the loop counter be one
done

rm -rf vbrfix* #removes .log and .tmp? created by vbrfix
cd .. #move up a directory
rmdir .novid.tmp/ #removes NoVids temp working directory
clear
}

############################
## The Inner Workings ##
############################
echo "1) Rip from URL"
echo "2) Rip from a list "
echo -n "Please enter your choice: "
read ripOPT
case $ripOPT in
1 ) unoURL
;;
2 ) multiURL
;;
* ) echo "Not a valid option"
esac
Post Reply

Return to “Software & Applications”