From: Nathaniel Escribano Date: 2009-01-14T10:15:39+09:00 Subject: Downloading an MP3 from the internet ------=_Part_246957_2495497.1231895791654 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I am trying to write a simple script that downloads a music file from the internet. For example: if i want to download http://cdn.stereogum.com/mp3/My%20Morning%20Jacket%20-%20Celebration%20(Live).mp3 how exactly would you do it? I found someone who was able to download a flickr photo using this script: require 'net/http' Net::HTTP.start("farm1.static.flickr.com") { |http| resp = http.get("/92/218926700_ecedc5fef7_o.jpg") open("fun.jpg", "wb") { |file| file.write(resp.body) } } puts 'Downloaded' With a slight modification shouldn't this work for the music file? What makes downloading a photo any different than an mp3 file? require 'net/http' Net::HTTP.start("cdn.stereogum.com") { |http| resp = http.get("/mp3/My Morning Jacket - Celebration (Live).mp3") open("Celebration.mp3", "wb") { |file| file.write(resp.body) } } puts "the song has been downloaded" Why doesn't it work? What needs to be changed? Any help would be great! Thanks. ------=_Part_246957_2495497.1231895791654--