View Single Post
  #550  
Old 18.01.2019, 15:14
Skeeve Skeeve is offline
Linkgrabbing Monster
 
Join Date: Feb 2010
Posts: 86
Default

I think I found the bug in my code :(

Just in case anyone is interested, please find the fixed code below

Code:
  var JDOWNLOADER="**External links are only visible to Support Staff**;
  var data= {
    "passwords" : "",
    "source": "",
    "package": package,
    "urls": link,
    "submit": "submit"
  };
  console.debug(JDOWNLOADER, data);
  GM.xmlHttpRequest({
  	method: "POST",
  	url: JDOWNLOADER,
  	data: objEncodeURIComponent(data),
  	headers: {
 		"Content-Type": "application/x-www-form-urlencoded"
  	},
  });


function objEncodeURIComponent(obj) {
  var str = [];
  for (var p in obj)
    if (obj.hasOwnProperty(p)) {
      str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
    }
  return str.join("&");
}

@pspzockerscene asked me to ask again here. He mentione that @Jiaz or @mpgai might be able to assist.

The original question (in German) can be found here: https://board.jdownloader.org/showthread.php?t=79637


------------

Hi!

I'm using a greasemonkey script to send my URLs to jDownloader.

I also add package information.

jDownloader just receives the links, the package is ignored.

My assumption is, that the packagizer interferes here and sorts my links under "Various Files".

How can I fix that?

This is the part of the code which sends to jDownloader:

Code:
  var JDOWNLOADER="**External links are only visible to Support Staff**;
  var data= {
    "passwords" : "",
    "source": "",
    "package": package,
    "urls": link,
    "submit": "submit"
  };
  console.debug(JDOWNLOADER, data);
  GM.xmlHttpRequest({
  	method: "POST",
  	url: JDOWNLOADER,
  	data: "password=&source=&package=&submit=submit&urls=" +  encodeURIComponent(link),
  	headers: {
 	  	"Content-Type": "application/x-www-form-urlencoded"
  	}
    }
  });
Due to the console output I'm able to verify that the package is indeed sent.

I'm not sure whether or not it's important, but the package name contains spaces.

Last edited by Skeeve; 18.01.2019 at 15:29.
Reply With Quote