Problem with direct links to current fight songs

Let us know when something isn't working correctly, or if you find a typo. Do not post complaints or suggestions here.
Post Reply
User avatar
Lunkhead
You're No Good
Posts: 8106
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Problem with direct links to current fight songs

Post by Lunkhead »

This is probably not something you guys will not want to bother with, but if I post a link to a current entry (e.g. http://www.songfight.org/music/made_to_ ... e_mtbp.mp3) in Facebook, it winds up using the following link:

http://www.songfight.org/songpage.php?k ... e_mtbp.mp3

I think it's got something to do with either the referer header check or a cookie not being set or something, and whatever stuff you guys have in place to prevent people from directly linking to mp3s in the archive. That's all fine, except in this case there is no archive page for the fight since it's a current fight. If you go to that URL the site times out after 30 seconds with an error:
Fatal error: Maximum execution time of 30 seconds exceeded in /home/.jocasta/fightmaster/songfight.org/songpage.php on line 44
It would be great if people got redirected to the current fight page for current fight mp3s, rather than to an archive fight page. But like I said, I imagine you've got better things to do than worry about people linking to their songs on Facebook.
User avatar
fluffy
Eruption
Posts: 11029
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: Problem with direct links to current fight songs

Post by fluffy »

Yeah, it's because of the lazy way in which I implemented hotlink prevention. It will only work with archived songs, and there's a few older fights where it won't work. Detecting if the key is the current fight is difficult with the way the archive is currently set up. A few people were abusing the archive as free song hosting and it was starting to actually make a noticeable dent in bandwidth usage.

Basically, don't hotlink.
User avatar
fluffy
Eruption
Posts: 11029
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: Problem with direct links to current fight songs

Post by fluffy »

Just implemented a quick-and-dirty workaround. Let me know if that breaks things.
User avatar
Lunkhead
You're No Good
Posts: 8106
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Re: Problem with direct links to current fight songs

Post by Lunkhead »

Now when I go to that link it sends me to the homepage, which is definitely an improvement. Thanks fluffy.
User avatar
fluffy
Eruption
Posts: 11029
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: Problem with direct links to current fight songs

Post by fluffy »

I figured the index page would be better since that's where the voting is. I don't see much point to forwarding people to the 'current song' page.

When the next fight goes up it will automatically forward to the archive page instead.

Oh, and as a bonus, this means that if you link to the songpage.php?key=current_fight key it will now do the right thing, so those of us who like to link to the fight page from our songfight pages don't have to remember to fix their links later.

I guess I could also add a "permanent link to this fight" URL to the main and/or current song page that takes advantage of this (it is literally one line of code), if the actual fightmasters don't mind and aren't already too pissed at me for overstepping my bounds on this one.
User avatar
Lunkhead
You're No Good
Posts: 8106
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Re: Problem with direct links to current fight songs

Post by Lunkhead »

Cool! I was always annoyed that I couldn't just use the same link for a fight all the time, and had to use one for when it was "current" and one when it was "archived".
User avatar
irwin
Mean Street
Posts: 617
Joined: Mon Jan 22, 2007 10:09 pm
Instruments: insecurity
Recording Method: scotch
Submitting as: suckweasel, kasper, nutwalls
Location: Woodland, CA

Re: Problem with direct links to current fight songs

Post by irwin »

Lunkhead wrote:Cool! I was always annoyed that I couldn't just use the same link for a fight all the time, and had to use one for when it was "current" and one when it was "archived".
Seconded.
"Ouch. I wonder if this guy sounds like this when he speaks." -- Puce
User avatar
Spud
Hot for Teacher
Posts: 4770
Joined: Fri Sep 24, 2004 10:25 am
Instruments: Bass, Keyboards, eHorn
Submitting as: Octothorpe
Location: Seattle
Contact:

Re: Problem with direct links to current fight songs

Post by Spud »

The fightmasters prefer that you don't hotlink. It was not set up to be easy on purpose, and fluffy was asked to do a little something to make it harder. Personally, I think every hotlink should take you to the front page. Get yer own damned webspace!
"I only listen to good music. And Octothorpe." - Marcus Kellis
Song Fight! The Rockening
User avatar
fluffy
Eruption
Posts: 11029
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: Problem with direct links to current fight songs

Post by fluffy »

Well, I didn't want to penalize people TOO much, since most hotlinking is the result of cluelessness rather than malice. And of course the 'file' parameter is there both for tracking purposes and for the idea that maybe in the future the original item could be highlighted but that seems suspiciously like "making it too easy."

But it is definitely preferred for people to link to the fight rather than an individual song, and to that end, http://songfight.org/currentsong.php now has a 'permanent link' link for the convenient copying-and-pasting, completely orthogonal to the hotlink issue.
User avatar
Lunkhead
You're No Good
Posts: 8106
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Re: Problem with direct links to current fight songs

Post by Lunkhead »

Do you guys pay for bandwidth still? Dreamhost appears to be advertising "unlimited" disk storage and bandwidth in their plans now:

http://www.dreamhost.com/hosting.html

Or do they have some secret bandwidth threshold above which they get annoyed or something?

Not that I'm saying you should be everyone's Web host. I can and usually do host my own files. Just curious.
User avatar
fluffy
Eruption
Posts: 11029
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: Problem with direct links to current fight songs

Post by fluffy »

Dreamhost is in the business of massively overselling their capabilities and banking on the fact that most people would have no legitimate use to even scratch the surface of their allocation. Historically, whenever a site actually does start to do that, Dreamhost gets a bit pissy and tries to move them over to virtual private servers with metered bandwidth (although they generally care much more about CPU usage).

Right now, most of the hotlinking to the site isn't actually from inconsiderate users so much as goddamn music search engines like soso and qq and whatever. From a quick perusal of the stats, they account for at least 99% of the hotlinking. But it's much easier to provide a catch-all solution than to try to be maximally-nice to real people vs. INFORMATION WANTS TO BE FREEtards.

Anyway, it's just bad practice to assume that a site that's not under your control will keep your outbound links valid. What if the server goes down? What if songfight shuts down for a while? What if someone gets a wild hair up their ass to refactor the directory structure? What if the site gets hacked and some jackass redirects all mp3s to lemonparty.org (NSFW) or replaces all your good(?) songs with Best Of LIghtning Ear Fart?
User avatar
Lunkhead
You're No Good
Posts: 8106
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Re: Problem with direct links to current fight songs

Post by Lunkhead »

All good points. Guess I'd better start mirroring the archive then. ;)
User avatar
fluffy
Eruption
Posts: 11029
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: Problem with direct links to current fight songs

Post by fluffy »

I've been mirroring it for years :D
User avatar
jb
Hot for Teacher
Posts: 4159
Joined: Sat Sep 25, 2004 10:12 am
Instruments: Guitar, Cello, Keys, Uke, Vox, Perc
Recording Method: Logic X
Submitting as: The John Benjamin Band
Pronouns: he/him
Location: WASHINGTON, DC
Contact:

Re: Problem with direct links to current fight songs

Post by jb »

Lunkhead wrote:Do you guys pay for bandwidth still? Dreamhost appears to be advertising "unlimited" disk storage and bandwidth in their plans now:

http://www.dreamhost.com/hosting.html

Or do they have some secret bandwidth threshold above which they get annoyed or something?

Not that I'm saying you should be everyone's Web host. I can and usually do host my own files. Just curious.
There is ALWAYS a secret limit.
blippity blop ya don’t stop heyyyyyyyyy
Post Reply