# Mp3scrape

**URL:** <https://www.ruby-forum.com/t/mp3scrape/144686>\
**Category:** Ruby\
**Created:** [August 1, 2008, 6:12am UTC](https://www.ruby-forum.com/t/mp3scrape/144686 "2008-08-01T06:12:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahoward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@ahoward](https://www.ruby-forum.com/u/ahoward)\
**Post date:** [August 1, 2008, 6:12am UTC](https://www.ruby-forum.com/t/mp3scrape/144686/1 "2008-08-01T06:12:08Z")

</div>

NAME  
mp3scrape

SYNOPSIS  
mp3scrape uri [options]+

DESCRIPTION  
mp3scrape will scour any url for it’s mp3 content - the script  
mirrors,  
never downloading the same file twice. it does not, however, crawl a  
website for links, it simple scapes all the songs from a single page.

PARAMETERS  
uri (1 → uri(uri))  
the uri to scrape  
–pattern=pattern, -p (0 ~\> pattern='"  
["'])  
specifiy the mp3 pattern  
–basedir=basedir, -b (0 ~\> basedir=/Users/ahoward/mp3)  
specifiy the base download dir - default(/Users/ahoward/mp3)  
–destination=destination, -d (0 ~\> destination)  
specifiy the absolute download dir -  
default(/Users/ahoward/mp3/auto-based-on-uri)  
–list  
only list the mp3s that would be scraped  
–threads=threads, -t (0 ~\> integer(threads=8))  
specify the number of threads to download with in parallel -  
default(8)  
–noop, -n  
show the downloads that would be performed  
–help, -h

INSTALL  
sudo gem install mp3scrape

URI  
[http://codeforpeople.com](http://codeforpeople.com)

EXAMPLES

1. get a bunch of xmas tunes  
mp3scrape  
[I AM FUEL, YOU ARE FRIENDS: Christmas mixery](http://fuelfriends.blogspot.com/2007/12/christmas-mixery.html)

2. get a bunch of tunes  
mp2scrape [http://troubledsoulsunite.blogspot.com/](http://troubledsoulsunite.blogspot.com/)

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

---

<div class="post-metadata">

**Author:** ![ahoward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@ahoward](https://www.ruby-forum.com/u/ahoward)\
**Post date:** [August 4, 2008, 3:19am UTC](https://www.ruby-forum.com/t/mp3scrape/144686/2 "2008-08-04T03:19:38Z")

</div>

On Fri, Aug 1, 2008 at 1:10 PM, ara howard [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> website for links, it simple scapes all the songs from a single page.  
> default(/Users/ahoward/mp3/auto-based-on-uri)  
> sudo gem install mp3scrape
> 
> URI  
> [http://codeforpeople.com](http://codeforpeople.com)
> 
> EXAMPLES
> 
> 1. get a bunch of xmas tunes  
> mp3scrape [I AM FUEL, YOU ARE FRIENDS: Christmas mixery](http://fuelfriends.blogspot.com/2007/12/christmas-mixery.html)
> 
> 2. get a bunch of tunes  
> mp2scrape [http://troubledsoulsunite.blogspot.com/](http://troubledsoulsunite.blogspot.com/)

Nice, i’ve been doing similar stuff with a script of mine:  
[http://p.ramaze.net/1818](http://p.ramaze.net/1818)

That i would use like:  
curl -s [I AM FUEL, YOU ARE FRIENDS: Christmas mixery](http://fuelfriends.blogspot.com/2007/12/christmas-mixery.html)  
| uris | egrep ‘.mp3$’ | xargs wget

But thanks, I’ll check this one out 🙂  
^ manveru

---

<div class="post-metadata">

**Author:** ![ahoward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@ahoward](https://www.ruby-forum.com/u/ahoward)\
**Post date:** [August 4, 2008, 6:34pm UTC](https://www.ruby-forum.com/t/mp3scrape/144686/3 "2008-08-04T18:34:19Z")

</div>

On Aug 3, 2008, at 7:18 PM, Michael F. wrote:

> Nice, i’ve been doing similar stuff with a script of mine:  
> [http://p.ramaze.net/1818](http://p.ramaze.net/1818)
> 
> That i would use like:  
> curl -s [I AM FUEL, YOU ARE FRIENDS: Christmas mixery](http://fuelfriends.blogspot.com/2007/12/christmas-mixery.html)  
> | uris | egrep ‘.mp3$’ | xargs wget
> 
> But thanks, I’ll check this one out 🙂  
> ^ manveru

cool. my next plan is to make it crawl - but limiting is a big  
issue… rfc 😉

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

---

<div class="post-metadata">

**Author:** ![ahoward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@ahoward](https://www.ruby-forum.com/u/ahoward)\
**Post date:** [September 9, 2008, 7:12pm UTC](https://www.ruby-forum.com/t/mp3scrape/144686/4 "2008-09-09T19:12:57Z")

</div>

Thanks for this gem, Ara.

Attached is a patch which changes mp3scrape to use Hpricot. It also  
prepends  
the supplied URL to relative URLs (that do not match with /^http:/).  
This  
allows mp3scrape to be used on pages such as

```
http://staff.telkomsa.net/packages/SRPMS/openldap/

```

to download RPMs instead. Please let me know what you think.

---

<div class="post-metadata">

**Author:** ![ahoward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@ahoward](https://www.ruby-forum.com/u/ahoward)\
**Post date:** [August 7, 2008, 2:44pm UTC](https://www.ruby-forum.com/t/mp3scrape/144686/5 "2008-08-07T14:44:38Z")

</div>

On Thu, Aug 7, 2008 at 9:08 AM, Joel VanderWerf  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ara howard wrote:
> 
> > mp3scrape will scour any url for it’s mp3 content - the script mirrors,  
> > never downloading the same file twice. it does not, however, crawl a  
> > website for links, it simple scapes all the songs from a single page.
> 
> Might be nice as a firefox plugin, too.

See [http://www.downthemall.net/](http://www.downthemall.net/)

^ manveru

---

<div class="post-metadata">

**Author:** ![ahoward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/779978/32.png) [@ahoward](https://www.ruby-forum.com/u/ahoward)\
**Post date:** [August 7, 2008, 2:11am UTC](https://www.ruby-forum.com/t/mp3scrape/144686/6 "2008-08-07T02:11:17Z")

</div>

ara howard wrote:

> mp3scrape will scour any url for it’s mp3 content - the script mirrors,  
> never downloading the same file twice. it does not, however, crawl a  
> website for links, it simple scapes all the songs from a single page.

Might be nice as a firefox plugin, too.
