Song Fight download script

Links and other hanky panky that doesn't have to do with anything in particular.
Post Reply
User avatar
Manhattan Glutton
Niemöller
Posts: 1530
Joined: Tue Feb 15, 2005 12:10 pm
Instruments: Angst
Recording Method: REAPER
Location: Madison, WI
Contact:

Song Fight download script

Post by Manhattan Glutton »

This code is pretty old and probably embarrassing since I wrote it many years ago, and there may be other better utilities out there, but I thought I'd share this anyway. Might be helpful to someone... somewhere... for some reason.

It's a PHP command-line script. It will work under linux/unix, and probably Windows or Windows/Cygwin as long as you have PHP installed.

It downloads all mp3s and playlist.m3u to current directory/formatted_song_name/

USAGE:
songfight
Will prompt you which song you want to download this week (it used to be compatible with the multiple songs per week paradigm, but that code's commented out).

songfight -t "Back to the Well"
Will download the song "Back to the Well"

songfight -l back_to_the_well
If my formatting doesn't work on the title for some reason, you can put in the URL-safe formatted name of the song.

Right click -> Save As
Last edited by Manhattan Glutton on Sun Jan 10, 2010 9:44 pm, edited 1 time in total.
If I had a dollar for every one of my songs j$ has called a 90s pastiche, I'd have $1 for every song I've written.

Nur Ein Archives | The New Ugly Podcast
User avatar
irwin
Goldman
Posts: 621
Joined: Mon Jan 22, 2007 10:09 pm
Instruments: insecurity
Recording Method: scotch
Submitting as: suckweasel, kasper, nutwalls
Location: Woodland, CA

Re: Song Fight download script

Post by irwin »

I just do:

mkdir this_week_fight
cd this_week_fight
wget http://www.songfight.org/music/this_wee ... aylist.m3u
wget -i playlist.m3u
rm playlist.m3u

(If I leave the playlist.m3u in there my player picks it up and I get two copies of every song, one local, one from the playlist)

Could wrap it up into a shell script and auto transform the title, I suppose. In OSX, replace wget with curl (and change the flags accordingly), or just install wget.
"Ouch. I wonder if this guy sounds like this when he speaks." -- Puce
User avatar
roymond
Ibárruri
Posts: 5263
Joined: Sat Sep 25, 2004 3:42 pm
Instruments: Guitars, Bass, Vocals, Logic
Recording Method: Logic X, MacBookPro, Focusrite Scarlett 2i2
Submitting as: roymond, Dangerous Croutons, Intentionally Left Bank, Moody Vermin, The Reverend
Pronouns: he/him
Location: brooklyn
Contact:

Re: Song Fight download script

Post by roymond »

I just use DownThemAll! in Firefox.
roymond.com | songfights | covers
"Any more chromaticism and you'll have to change your last name to Wagner!" - Frankie Big Face
User avatar
Manhattan Glutton
Niemöller
Posts: 1530
Joined: Tue Feb 15, 2005 12:10 pm
Instruments: Angst
Recording Method: REAPER
Location: Madison, WI
Contact:

Re: Song Fight download script

Post by Manhattan Glutton »

irwin wrote:I just do:

mkdir this_week_fight
cd this_week_fight
wget http://www.songfight.org/music/this_wee ... aylist.m3u
wget -i playlist.m3u
rm playlist.m3u

(If I leave the playlist.m3u in there my player picks it up and I get two copies of every song, one local, one from the playlist)

Could wrap it up into a shell script and auto transform the title, I suppose. In OSX, replace wget with curl (and change the flags accordingly), or just install wget.
Well, that's a hell of a lot less complicated. I didn't even know wget had that option.
If I had a dollar for every one of my songs j$ has called a 90s pastiche, I'd have $1 for every song I've written.

Nur Ein Archives | The New Ugly Podcast
User avatar
Lunkhead
Rosselli
Posts: 8567
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/mac/tascam4x4
Submitting as: Berkeley Social Scene
Pronouns: he/him
Location: Central Oregon
Contact:

Re: Song Fight download script

Post by Lunkhead »

I listen to the songs in Firefox at http://www.bozos.com/sf/fights/current since I generally only like a couple of songs enough to bother downloading them.
User avatar
irwin
Goldman
Posts: 621
Joined: Mon Jan 22, 2007 10:09 pm
Instruments: insecurity
Recording Method: scotch
Submitting as: suckweasel, kasper, nutwalls
Location: Woodland, CA

Re: Song Fight download script

Post by irwin »

irwin wrote: mkdir this_week_fight
cd this_week_fight
wget http://www.songfight.org/music/this_wee ... aylist.m3u
wget -i playlist.m3u
rm playlist.m3u

In OSX, replace wget with curl (and change the flags accordingly), or just install wget.
Since Ross asked, in OSX, I do:

curl -O (drag 'steam all' link from the fight page into the terminal. This pastes the URL). *enter*
for i in `cat playlist.m3u`; do
curl -O ${i}
done

I do not know of the curl option to feed it a file containing a list of URLs (the equivalent of wget's -i option).
"Ouch. I wonder if this guy sounds like this when he speaks." -- Puce
User avatar
Ross
Churchill
Posts: 2745
Joined: Sun Feb 27, 2005 3:27 pm
Instruments: Guitar, Vox, Bass, Tuned glasses, etc...
Recording Method: Logic on a Macbook.
Submitting as: Ross Durand
Location: Orange CA
Contact:

Re: Song Fight download script

Post by Ross »

I found a cool drag and drop for mac. Just download the .m3u and drag it onto the application's icon and it grabs all teh files

m3u2mp3

http://www.macupdate.com/info.php/id/24220
"I don't like this song, but at least it's good." - veGetar Ianra Ge
http://www.rossdurandmusic.com
User avatar
Manhattan Glutton
Niemöller
Posts: 1530
Joined: Tue Feb 15, 2005 12:10 pm
Instruments: Angst
Recording Method: REAPER
Location: Madison, WI
Contact:

Re: Song Fight download script

Post by Manhattan Glutton »

Lunkhead wrote:I listen to the songs in Firefox at http://www.bozos.com/sf/fights/current since I generally only like a couple of songs enough to bother downloading them.
Lunkhead's trying not to fill up the 4GB hard disk in his Packard Bell.
If I had a dollar for every one of my songs j$ has called a 90s pastiche, I'd have $1 for every song I've written.

Nur Ein Archives | The New Ugly Podcast
User avatar
jast
Niemöller
Posts: 1339
Joined: Tue Jul 29, 2008 7:03 pm
Instruments: Vocals, guitar
Recording Method: Cubase, Steinberg UR44
Submitting as: Jan Krueger
Pronouns: .
Location: near Aachen, Germany
Contact:

Re: Song Fight download script

Post by jast »

Here's another one to download the current fight:

Code: Select all

wget -nd -r -A .mp3 http://www.songfight.org/currentsong.php
rm robots.txt
And here's a shortcut for what irwin pasted for OS X (assuming OS X has 'xargs'... and if it doesn't it's stupid because all BSDs I know have it):

Code: Select all

curl (drag 'stream all' link from the fight page into the terminal) | xargs curl --remote-name-all
That said, I just use DownThemAll!, which also allows me to automatically use the link text in the filename. I don't think wget/curl support that.
User avatar
fluffy
Eisenhower
Posts: 11267
Joined: Sat Sep 25, 2004 10:56 am
Instruments: sometimes
Recording Method: Logic Pro X
Submitting as: Sockpuppet
Pronouns: she/they
Location: Seattle-ish
Contact:

Re: Song Fight download script

Post by fluffy »

I guess I never bothered to post my various songfight download+tag scripts so here they are. http://beesbuzz.biz/code/sf-scripts.tar.gz

These days I run them on a Mac (previously I ran them on Linux, and it would probably work fine on Cygwin as well), although there's a bunch of dependencies you'd need to install (wget, id3v2, perl and a bunch of modules for it, etc.). Basically it uses the RSS feed to grab the current week, and then it uses HTML scraping on the full archive to make sure that it's got all the past fights too, and it tags them all in a uniform manner.

For getting the current fight without tagging you could just do this one-liner:

Code: Select all

wget -A mp3 -r -l 1 http://www.songfight.org/
which is how I get less-frequent stuff like remixfight and GOM.

or if you want to be a bit fancier:

Code: Select all

wget -O - http://songfight.org/playlist.m3u | xargs wget -i -
basically the nice thing about this stuff is there's more than one way to do it.
User avatar
signboy
Goldman
Posts: 712
Joined: Wed Mar 07, 2007 10:33 pm
Instruments: things that make noise
Recording Method: lots of stuff plugged into lots of other stuff
Location: hillbillyland
Contact:

Re: Song Fight download script

Post by signboy »

I've been using Web Ripper because I don't like the way code & scripts stare at me. :) I'm pretty sure it's free (I got it off a friend, not the d/l link) and it works pretty slick, for more than just SF.
Irwin: I'd sell my soul to jesus to program drums like signboy.
User avatar
JonPorobil
Ibárruri
Posts: 5682
Joined: Sat Sep 25, 2004 11:45 am
Instruments: Piano, Guitar, Harmonica, Mandolin, Accordion, Bass, lots of VSTs
Recording Method: Cubase 10.5
Submitting as: Jon Eric, Jon Porobil, others
Pronouns: He/Him
Location: Pittsburgh, PA
Contact:

Re: Song Fight download script

Post by JonPorobil »

This is useful, so... *BUMP*
"Warren Zevon would be proud." -Reve Mosquito

Stages, an album of about dealing with loss, anxiety, and grieving a difficult year, now available on Bandcamp and all streaming platforms! https://jonporobil.bandcamp.com/album/stages
Post Reply