Giorgio Maone wrote:could you please try to use the same style as the rest of code, e.g. camel case instead of underscores and less spaces around puntuaction?
TheReasonIDontUseCamelCaseIsIHaveTroublesReadingIt. I do try to stick to it in the existing files, it's just hard to always remember to switch the style. As for punctuation, can you give an example? If you're talking about the spaces around the ! operator, the reason is the same as with camel case: I barely notice it (the operator) if it's not whitespaced.
Giorgio Maone wrote:a flashgot.media.YouTube.decode_signature_func.auto preference (default true, obviously)
Yeah, I didn't do that because I didn't have the time to do it properly, i.e. add some synchronization/locking and frequency limiting code around that. Without that, in case you're restoring a session with (a lot of) YouTube tabs/windows, it's just wasted traffic and unnecessary server load (again), and for
"me myself personally", that also means a (3 * the number of such tabs/windows) second GUI freeze.
Giorgio Maone wrote:do not re-add comments containing profanity against Mozilla developers (e.g. about the POST payload management)
LOL, that (re-adding) was totally accidental, sorry. And the comment wasn't targeted at Mozilla devs, but at Grooveshark's clowns. And it turns out I was so mad that I totally forgot to add a host check for that code. On the other hand, you probably could just drop that site-specific code since it's still useless without the required range request header, and I doubt any download manager sends it. ReGet used to send it by default, until they found out that caused troubles with redirects.
Code: Select all
let s = NetUtil.readInputStreamToString(o.postStream, len);
// Remove the headers. For some reason, grooveshark.com
// puts the "Referer", "Content-Type" and "Content-Length" headers
// into channel.uploadStream instead of the headers (visitRequestHeaders()).
// The download manager still has to send the "Range: bytes=0-"
// header in order to get the file.
if (/(?:^|\.)grooveshark\.com$/.test(channel.URI.asciiHost))
{
let idx = s.indexOf("\r\n\r\n");
if (idx !== -1) { s = s.substr(idx + "\r\n\r\n".length); }
}
o.postData = s;