How to download all mp3 files from this website?

P

Phlip

Li said:
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...
 
L

Li Chen

Phlip said:
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
 
L

Li Chen

Michael said:

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
 
R

Reid Thompson

Li said:
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

try

$ mp3scrape --help
 
L

Li Chen

Reid said:
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
 
R

Reid Thompson

Li said:
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
you need to run

# gem install main

then you will prob also need to run

# gem install threadify


then run

$ mp3scrape --help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top