Post by Michael Uplawski:$ gem install get_mp3
:$ get_mp3http://www.franceculture.fr/player/reecouter?play=4810950 \
/tmp/"la liberté dans le coma - terre à terre".mp3
je viens d'essayer...
après gem install get_mp3, which get_mp3 ne donne rien...
ensuite je crée un script 'get_mp3_TEST.rb' :
#!/usr/bin/env ruby
# encoding: utf-8
require 'rubygems'
require 'get_mp3'
@url = "http://www.franceculture.fr/player/reecouter?play=4810950"
@file = "#{ENV['HOME']}/Downloads/La liberté dans le coma - terre à
terre.mp3"
http_to_file(@file, @url)
quand je le lance, j'ai:
$ ~/bin/tests/get_mp3_TEsT.rb
Missing parameters!!
Usage:
Call with the URL of the audio-player
get_mp3.rb http://www.france[culture|inter].fr/sites/..../xxxxxxxxx
or an URL and a local file-name:
get_mp3.rb http://www.france[culture|inter].fr/sites/..../xxxxxxxxx
local_file.mp3
si je le lance avec url et file:
~/bin/tests/get_mp3_TEsT.rb
"http://www.franceculture.fr/player/reecouter?play=4810950"
~/Dowloads/La_liberté_dans_le_coma__terre_à_terre.mp3
Will download
http://www.franceculture.fr/sites/default/files/sons/2014/03/s12/RF_15093DF3-1299-4106-BFD7-DBF4B9705E1D_GENE.MP3
/Users/yt/.rvm/gems/ruby-2.1.0/gems/get_mp3-0.2/lib/get_mp3.rb:55:in
`initialize': No such file or directory @ rb_sysopen -
/Users/yt/Dowloads/La_liberté_dans_le_coma__terre_à_terre.mp3
(Errno::ENOENT)
from
/Users/yt/.rvm/gems/ruby-2.1.0/gems/get_mp3-0.2/lib/get_mp3.rb:55:in `open'
from
/Users/yt/.rvm/gems/ruby-2.1.0/gems/get_mp3-0.2/lib/get_mp3.rb:55:in
`http_to_file'
from
/Users/yt/.rvm/gems/ruby-2.1.0/gems/get_mp3-0.2/lib/get_mp3.rb:129:in
`<top (required)>'
from
/Users/yt/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in
`require'
from
/Users/yt/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in
`rescue in require'
from
/Users/yt/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in
`require'
from /Users/yt/bin/tests/get_mp3_TEsT.rb:5:in `<main>'
?