Possible bug in placeholders?

Bug reports and enhancement requests
Post Reply
jpa
Posts: 2
Joined: Tue Jan 26, 2010 3:57 pm

Possible bug in placeholders?

Post by jpa »

Hi,
First of all, thanks for your software! It is a good program that does what I want, which is to pass information from browsed pages to scripts outside. I'm not sure that it saves me time, since I find me a lot of times working on those scripts, which I wouldn't do if it weren't for flashgot, but then, what would be the fun if flashgot did everything? :D

Anyway, my typical apparatus is to call a DOS batch script with the following placeholders:

[UFILE] [FOLDER] [CFILE] [REFERER]

This is enough for me. But earlier, I had them in a different order, and sometimes I want to experiment with the addition of different placeholders:

[UFILE] [FOLDER] [REFERER] [CFILE]
or
[UFILE] [FOLDER] [CFILE] [REFERER] [URL]

The problem is, when by reasons I'm not able to discern, Flasgot is not able to get the Referrer, it puts in its place the next parameter in the placeholders sequence. I guess this would happens if the templates were being used to construct a arguments line with non-quoted arguments (an empty argument would be interpreted as a larger than usual space between arguments), but that isn't coherent with the prohibition of using quotas in the template window (for what other reason if not to sanitize the template and properly construct the arguments line?).

I'm using a Windows XP SP1, FireFox 3.5 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4), FlashGot 1.2.1.10. The problem is a little older, but only now I got the courage to register in this forum (it is not a regression in the last versions, for all I could see).

I'm intrigued also why Flashgot is unable to get the referer in certain pages. I'm more intrigued even, because that used to be deterministic for certain pages, but today, the same pages where that happened, aren't. I recently upgraded the flashgot to avoid the problem, note that it was occurring still (after restart), yet, at this moment, I'm unable to find them... it is like as if, in certain times, Firefox is able to say the referrer to flashgot, but in other times, not. I'm confuse.

A second nuisance is that sometimes, the referer is passed with an extra space as a sufix.

Cheers,
Joao Pedro Afonso
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Possible bug in placeholders?

Post by Giorgio Maone »

The "disappearing" parameter is intentional, because most download manager accept named, rather than positional, command line arguments and therefore something like

Code: Select all

dm.exe [-r REFERER] [-c COOKIE] [URL]
becomes

Code: Select all

dm.exe URL
automatically if neither the referer or the cookie can be inferred: otherwise the command line would break.

Regarding the missing referer, some requests don't send it by design (notably, <META> refreshes).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)
jpa
Posts: 2
Joined: Tue Jan 26, 2010 3:57 pm

Re: Possible bug in placeholders?

Post by jpa »

Thanks for your speedy answer, Giorgio.

I'm not confused anymore but feeling a little foolish: Had I seen the examples for the other download managers in my own browser, in particular the one for the wget I wrote there in the past (probably cut and past from your FAQ), I should have reached your idea sooner. So, the solution is simply to implement named parameters in the scripts.

It is tempting to ask you to implement some kind of validation here (after all, templates with only positional parameters like the one I wrote are an invitation to the disaster... in that case, at least an empty string "" should have been passed), but writing below the templates box a small example like the one you wrote in your answer, should be enough. May I trust the square brackets to mean, all its content will only appear if the placeholders are successfully substituted?

About the referer, what you are saying is that, how we get the page might influence its existence? That might explain what I experimented (and offer a solution).

Many thanks again!!!!

PS.: Just an afterthought: had you never complains about the position of your remove button? I struck it all the time thinking it to remove placeholders :lol:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4
Post Reply