Page 1 of 1
Problem with direct links to current fight songs
Posted: Tue Sep 29, 2009 10:58 am
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.
Re: Problem with direct links to current fight songs
Posted: Tue Sep 29, 2009 11:07 am
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.
Re: Problem with direct links to current fight songs
Posted: Tue Sep 29, 2009 12:05 pm
by fluffy
Just implemented a quick-and-dirty workaround. Let me know if that breaks things.
Re: Problem with direct links to current fight songs
Posted: Tue Sep 29, 2009 5:05 pm
by Lunkhead
Now when I go to that link it sends me to the homepage, which is definitely an improvement. Thanks fluffy.
Re: Problem with direct links to current fight songs
Posted: Tue Sep 29, 2009 5:11 pm
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.
Re: Problem with direct links to current fight songs
Posted: Tue Sep 29, 2009 8:11 pm
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".
Re: Problem with direct links to current fight songs
Posted: Tue Sep 29, 2009 8:47 pm
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.
Re: Problem with direct links to current fight songs
Posted: Tue Sep 29, 2009 11:14 pm
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!
Re: Problem with direct links to current fight songs
Posted: Tue Sep 29, 2009 11:33 pm
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.
Re: Problem with direct links to current fight songs
Posted: Tue Sep 29, 2009 11:58 pm
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.
Re: Problem with direct links to current fight songs
Posted: Wed Sep 30, 2009 12:08 am
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?
Re: Problem with direct links to current fight songs
Posted: Wed Sep 30, 2009 12:15 am
by Lunkhead
All good points. Guess I'd better start mirroring the archive then.

Re: Problem with direct links to current fight songs
Posted: Wed Sep 30, 2009 12:47 am
by fluffy
I've been mirroring it for years :D
Re: Problem with direct links to current fight songs
Posted: Wed Sep 30, 2009 6:29 am
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.