Code: Select all
Win wget
Executable path:
C:\System32\cmd.exe
Arguments template:
/C start wget -c [--directory-prefix=FOLDER] [--referer=REFERER] [--post-data=POST]
[--load-cookies=CFILE] [--header=Cookie:COOKIE] [--input-file=UFILE]
[FOLDER] [UFILE] [REFERER] [CFILE] [Cookie:COOKIE] [POST]
I have some troubles that was appeared in two situations:
1. I tried to download this page just for test: http://www.emule-project.net/home/perl/ ... =donations.
Windows command line interpret "&" as separate token and cuts the string. (In my situation referer becomed to "http://www.emule-project.net/home/perl/ ... m=download".)
2. I tried to download some page again, and in post data was a space character, so all params were wrong.
In arguments template we can't use quotes, so I can't fix it even with bat files. I have a simple suggestion that should solve this problem: add an option "Save parameters to file...". And than we can read this file and all parameters as they are and how we need.
And I'll be very thankfull for author if he do it, because my solution is very very ugly, and acutally i don't sure that it even works without bugs, because i delete some code (as i think for wine), and i edited jar file (!), not sources for them (because i don't know technology of writing exts for FF, even Java i don't know)
I show my solution just for those who have similar problem to show how it can be fixed for some time (it very bad solution, don't do it if you really don't need it).
Solution:
1. Edit runNative function in flashgot.jar as shown below. Be carefull, you need to get the same size of file and the end of operation, so edit it in replace mode (hit "Insert" button):
Code: Select all
runNative: function(args, blocking, exeFile) {
const t0 = Date.now();
try {
fg.clearLog();//rvice.clearLog();//ob
exeFile = this.exeFile;//s.exeFile).exists()
// || this.createExecutable()) {
const proc = CC['@mozilla.org/process/util;1'].createInstance(
CI.nsIProcess);
//r exeFile=CC["@mozilla.org/file/local;1"].createInstance(CI.nsILocalFile);//
//r path="c:\\notepad.exe";//e.path);
//eFile.initWithPath(path);//M.wine;
// }
proc.init(exeFile);
this.log(args.join("!"));//"\""];this.log(args.join(""));//" -- " +(blocking ? "blocking" : "async") );1
fg.logFlush();//(blocking, args, args.length, {});
proc.run(blocking, args, args.length, {});// {
// this.log("Warning: native invocation of\n"
// + exeFile.path
// + "\nwith arguments <"
// + args.join(" ")
// + ">\nreturned " + proc.exitValue);
// }
// return proc.exitValue;
// } else {
// this.log("Bad executable " + exeFile);
// }
} catch(err) {
this.log("Error running native executable:\n" + exeFile.path +
" " + args.join(" ") + "\n" + err.message);
} finally {
this.log("Native execution time " + (Date.now() - t0));
}
return 0xffffffff;
}
Code: Select all
for /F "skip=1 delims=! tokens=1-6" %%a in ('cmd /c type c:\utils\ff\profile\flashgot.log') do (
%UNIX_UTILS%\wget.exe -c --directory-prefix="%%a" --input-file="%%b" --referer="%%c" --load-cookies="%%d" --header="%%e" --post-data="%%f" --append-output="%TEMP%\LOG\downloads.log"
echo %UNIX_UTILS%\wget.exe -c --directory-prefix="%%a" --input-file="%%b" --referer="%%c" --load-cookies="%%d" --header="%%e" --post-data="%%f" --append-output="%TEMP%\LOG\downloads.log" >"%TEMP%"\LOG\last_download_command_line.log
)
thx.