Page 1 of 1

[BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Fri Jan 02, 2015 12:27 am
by SergeGardien
I've figured out how to enable JDownloader 2 with FlashGot under Mac OSX 10.9.5, which is to modify the value of the preference name "flashgot.dmsopts.JDownloader.path" (in Firefox about:config) from the JDownloader 2 path of the *.jar file to the actual executable of JDownloader. In other words I've changed the value of the "flashgot.dmsopts.JDownloader.path" preference from "/Applications/JDownloader 2.0/JDownloader.jar" (which comes pre-set from FlashGot) to "/Applications/JDownloader 2.0/JDownloader2".

In this case FlashGot and JDownloader 2 work fine together as long as JDownloader is already open before starting a download but there are serious problems in case JDownloader is closed. In this last case, if I try to download a file using FlashGot with JDownloader, Firefox gives me back the message "Cannot launch JDownloader. Please launch it manually or ensure java is enabled in your browser" and the preference "flashgot.dmsopts.JDownloader.path" get erased to an empty value. In this case I need to reset it to "/Applications/JDownloader 2.0/JDownloader2" before having the possibility to use JDownloader again (still by opening it before starting the download with FlashGot).

Could you please take a look at this issue?

Many thanks

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Fri Jan 02, 2015 3:49 pm
by user
What does the log say? FlashGot Options -> Advanced tab -> Log (at the bottom) -> uncheck Disable.

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Thu Jan 08, 2015 3:56 pm
by SergeGardien
Sorry for the late reply.
Given that I cannot copy paste the log (the forum is rejecting my post), I've uploaded an image:

Image

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Wed Jan 14, 2015 12:39 pm
by user
Cool. And now the log for the case when you get the error message, i.e. when JDownloader is not running and FlashGot fails to launch it.

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Wed Jan 14, 2015 11:07 pm
by Thrawn
SergeGardien wrote:I cannot copy paste the log (the forum is rejecting my post)
Starting point is to try wrapping it in [ code ] tags.

Or you can always send it to a moderator via private message.

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Mon Jan 19, 2015 9:49 pm
by SergeGardien
user wrote:Cool. And now the log for the case when you get the error message, i.e. when JDownloader is not running and FlashGot fails to launch it.
Sorry for the late reply.
I've basically found where the problem lies. It's in the Java call to the Jar file.

I give you the whole picture.

Given that I've had some further issues with Firefox, I've decided to reset it (guide at: https://support.mozilla.org/en-US/kb/re ... t-problems).

After having done this step I've got some improvements given that I've been able to set the value of the "flashgot.dmsopts.JDownloader.path" preference to "/Applications/JDownloader 2.0/JDownloader.jar" and the java problem mentioned earlier disappeared.

Now I've got the following error:
"JDownloader not responding on http://127.0.0.1:9666/flashgot!
Please check your firewall settings."

I've pasted the FG log post JD call on PasteBin: http://pastebin.com/zeruS906

The problem lies in the Java call made by FG:
2015-01-19T21:02:57.869Z Running /usr/bin/java /Applications/JDownloader 2.0/JDownloader.jar -- async

First of all I've changed the name of the folder from "/Applications/JDownloader 2.0/" to "/Applications/JDownloader_2.0/" but the FG java call should have the -jar option.

Summarizing, instead of making the call:
/usr/bin/java /Applications/JDownloader_2.0/JDownloader.jar -- async
FG needs to make the call:
/usr/bin/java -jar /Applications/JDownloader_2.0/JDownloader.jar -- async
(I've tried this on Terminal and it works).

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Mon Jan 19, 2015 9:51 pm
by SergeGardien
Thrawn wrote:
SergeGardien wrote:I cannot copy paste the log (the forum is rejecting my post)
Starting point is to try wrapping it in [ code ] tags.
Tried that with no luck
Thrawn wrote:Or you can always send it to a moderator via private message.
I prefer PasteBin ;-)

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Tue Jan 20, 2015 1:35 pm
by user
You're right about the "-jar" part. What I don't understand is the underscore/no underscore part. Does the actual path to JDownloader has an underscore or not? If it does, why are you setting the preference to a path that doesn't have an underscore? And if it doesn't, why are you using a path with an underscore in Terminal? And how does it even work - does your /usr/bin/java (or shell/Terminal) replace underscores with spaces or what?
BTW, the "-- async" (or "-- blocking") string at the end is not part of the command line, it's just for the log.

Here's a version that fixes the "-jar" part (and a couple other JDownloader and YouTube related things):

Code: Select all

http://rghost.net/private/60457246/82354dbc444c1a7b1c5607cf155aa2a9

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Tue Jan 20, 2015 2:02 pm
by SergeGardien
Cool that was the issue. Just tested and it is working fine.
Many thanks :-)

The underscore/no underscore part is because I've made a test on the Terminal, if the folder name is without underscore and I execute the command with such a path I receive back an error, if instead I fix the folder name by adding the underscore and I execute the Terminal command with such a fixed path (folder name with underscore) everything is fine and JDownload starts.

To answer your specific questions:
Does the actual path to JDownloader has an underscore or not?
Earlier no, there wasn't an underscore but I've added it after I've discovered the issue by making the tests in the Terminal (so I've modified the folder name and the path wherever I was using it).

If it does, why are you setting the preference to a path that doesn't have an underscore?
I've changed that contextually with the change of the folder name: folder name with underscore => FG path with underscore

And if it doesn't, why are you using a path with an underscore in Terminal? And how does it even work - does your /usr/bin/java (or shell/Terminal) replace underscores with spaces or what?
Nope, /usr/bin/java (or shell/Terminal) doesn't change anything, I'm the one that made the changes.

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Tue Jan 20, 2015 3:53 pm
by user
Ah, spaces, I see. You can enslose a string with spaces in double quotes if you want it to be interpreted as a single argument. For example:

Code: Select all

/usr/bin/java -jar "/Applications/JDownloader 2.0/JDownloader.jar"

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Tue Jan 20, 2015 4:25 pm
by SergeGardien
Yes, sure. Sorry for the misunderstanding, I haven't been that clear. I know that "normally" I need to use the quotas "..." in case the path/string has a space. I was just trying to replicate FG behavior manually in the Terminal and then trying to accommodate its needs by changing the folder name :-)

One last thing. It's not urgent but could you please increase the timer for JD to answer back to FG? Sometimes it happens that I receive back from FG the error mentioned earlier ("JDownloader not responding on http://127.0.0.1:9666/flashgot! Please check your firewall settings.") even though JD starts.

Thanks again

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Tue Jan 20, 2015 7:25 pm
by user
FlashGot tries to contact JD 6 times (the number is hardcoded), and there's a preference called flashgot.dmsopts.JDownloader.delay that sets the interval (in seconds) between retries. It's 8 by default, so JD has 40 seconds to become ready before FlashGot gives up and shows you the error message.

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Tue Jan 20, 2015 8:53 pm
by SergeGardien
Ok. Thanks again.

Re: [BUG] FlashGot & JDownloader 2 (Beta) in Mac OSX

Posted: Tue Jan 20, 2015 9:15 pm
by Giorgio Maone
Changes merged in 1.5.6.9, thanks user.