Convert youtube videos to MP3 audio

My father-in-law who is a music enthusiast was trying to search for Ustad Ghulam Ali’s Ghazals.

He was able to watch and listen his Ghazals from YouTube at my place but he doesn’t have internet at his home. So, I decided to help him by downloading and convert songs to MP3.

Step 1:

I did google and found “youtube-dl” (for Debian Linux) and installed it on my Debian Linux. youtube-dl helped me to download playlists by running below command.

youtube-dl –playlist-start 1 –playlist-end 20 https://www.youtube.com/watch?list=PLDFC0175788C44C2D

We can further specify output format, quality etc.. but for us basic download of the Ghazals was sufficient.

Step 2:

I did search for a tool to convert MP4 to MP3 in Debian and found a tool called “avconv”. Installed and started converting the downloaded files by running the below script all at once 🙂

for i in *.mp4; do avconv -i “$i”  “out-$i.mp3” ; done

Above one liner script would convert all MP4 video files to MP3 audio files with the prefix “out” in  the file names.

Result: We now have the offline Ghazals in mp3 format ready to listen in my father-in-law’s iPod / computer!!

Note: youtube-dl would not download copyrighted, restricted and private files from YouTube.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s