Forum: Ruby How to download all mp3 files from this website?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2009-02-01 21:43
Hi all,

I want to download all the mp3 files from this website:
http://rss.sciam.com/sciam/60secsciencepodcast.

But I cannot see the link to each mp3 file in the source file. I wonder
how I can find out each link for the mp3 in source file.

Thanks,

Li
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-02-01 21:55
(Received via mailing list)
Li Chen wrote:
> Hi all,
>
> I want to download all the mp3 files from this website:
> http://rss.sciam.com/sciam/60secsciencepodcast.
>
> But I cannot see the link to each mp3 file in the source file. I wonder
> how I can find out each link for the mp3 in source file.

A> What's the relation to the language Ruby here?

B> If I had cool MP3s, I would munge their addresses to prevent casual
scraping.

Google "Streamripping" to get an idea for the silly arms race currently
in
progress...
D337e2cf7c6d03caac6988d83e0e7f66?d=identicon&s=25 Michael Guterl (mguterl)
on 2009-02-01 22:05
(Received via mailing list)
On Sun, Feb 1, 2009 at 3:42 PM, Li Chen <chen_li3@yahoo.com> wrote:
> Hi all,
>
> I want to download all the mp3 files from this website:
> http://rss.sciam.com/sciam/60secsciencepodcast.
>
> But I cannot see the link to each mp3 file in the source file. I wonder
> how I can find out each link for the mp3 in source file.
>
mp3scrape may work for your needs.

http://codeforpeople.com/lib/ruby/mp3scrape/mp3scrape-0.0.1/

Regards,
Michael Guterl
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2009-02-01 22:40
Phlip wrote:
> Li Chen wrote:
>> Hi all,
>>
>> I want to download all the mp3 files from this website:
>> http://rss.sciam.com/sciam/60secsciencepodcast.
>>
>> But I cannot see the link to each mp3 file in the source file. I wonder
>> how I can find out each link for the mp3 in source file.
>
> A> What's the relation to the language Ruby here?

#Use Ruby script to download a webpage ranging from 15274.html to
15334.html
# and here is an example
#download a webpage based on an address

require 'open-uri'
require 'threadlimiter'

#address='http://www.qenglish.com/samples/15334.html'
#....
#address='http://www.qenglish.com/samples/15274.html'

addresses=[]
address1='http://www.qenglish.com/samples/'
address2=''
address3='.html'


# create the address
(15274..15334) .to_a.each do |i|
  addresses<<(address1 + i.to_s+  address3)
end

#download the files
addresses.threaded_collect(1)do |a_uri|
  open(a_uri) do |a_file|
    f_name=File.basename(a_uri)
    open(f_name,'wb')   do|r_file|
      a_file.each_line do |a_line|
      r_file.write a_line
end
end
end
end
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2009-02-01 23:11
Michael Guterl wrote:
> mp3scrape may work for your needs.
>
> http://codeforpeople.com/lib/ruby/mp3scrape/mp3scrape-0.0.1/
>

Hi Michael,

Thank you very much.

What is the right syntex for using mp3scrape? I can not load mp3scrape
after I use gem install to install the gem.

Li

############################
C:\Users\Alex>irb
irb(main):001:0> require 'mp3scrape'
LoadError: no such file to load -- mp3scrape
        from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
        from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
        from (irb):1
91e1fb8bd265b7629491ab64c42f0906?d=identicon&s=25 Reid Thompson (Guest)
on 2009-02-02 04:49
(Received via mailing list)
Li Chen wrote:
> What is the right syntex for using mp3scrape? I can not load mp3scrape
> `gem_original_require'
>         from
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `require'
>         from (irb):1

try

$ mp3scrape --help
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2009-02-02 20:38
Reid Thompson wrote:

> try
>
> $ mp3scrape --help


Hi Reid,

Here is what I get:

C:\Users\Alex>mp3scrape --help
gem install main

C:\Users\Alex>irb
irb(main):001:0> require 'mp3scrape'
LoadError: no such file to load -- mp3scrape
        from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
        from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
        from (irb):1
irb(main):002:0>

Li
91e1fb8bd265b7629491ab64c42f0906?d=identicon&s=25 Reid Thompson (Guest)
on 2009-02-02 21:32
(Received via mailing list)
Li Chen wrote:
>
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `require'
>         from (irb):1
> irb(main):002:0>
>
> Li
you need to run

# gem install main

then you  will prob also need to run

# gem install threadify


then run

$ mp3scrape --help
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2009-02-02 22:01
Reid Thompson wrote:
> you need to run
>
> # gem install main
>
> then you  will prob also need to run
>
> # gem install threadify
>
>
> then run
>
> $ mp3scrape --help
Hi Reid,

Thank you very much.

 I follow your suggestions and now I am able to download mp3 from
 http://troubledsoulsunite.blogspot.com/.

But I cannot download mp3 from
http://rss.sciam.com/sciam/60secsciencepodcast

Li
91e1fb8bd265b7629491ab64c42f0906?d=identicon&s=25 Reid Thompson (Guest)
on 2009-02-03 15:45
(Received via mailing list)
Li Chen wrote:
>> then run
> http://rss.sciam.com/sciam/60secsciencepodcast
>
> Li
you might have more success at

http://www.sciam.com/podcast/podcasts.cfm?type=60-...

if you can get mp3scrape to follow the podcast urls....
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2009-02-03 20:10
Reid Thompson wrote:
> you might have more success at
>
> http://www.sciam.com/podcast/podcasts.cfm?type=60-...
>
> if you can get mp3scrape to follow the podcast urls....

Hi Reid,

Thanks.

I use a script I wrote in the previous post and download all the mp3 I
need.


Li
This topic is locked and can not be replied to.