#1
|
|||
|
|||
Adding multiple Links via MyJdownloader. Links separator?
I want to add multiple links via the MyJdwonloader API.
I found this API class for php: **External links are only visible to Support Staff****External links are only visible to Support Staff** Im also looking at the doc: **External links are only visible to Support Staff****External links are only visible to Support Staff** It works when I add one link, but multiple links fail. Here an example request: {"url":"/linkgrabberv2/addLinks","params":["{"priority":"DEFAULT","links":"**External links are only visible to Support Staff**,"autostart":true, "packageName": "test"}"],"rid":1442154803,"apiVer":1}{ "data" : "", "rid" : 1442154803 } As soon as I add 2 or more links, they get separated by "," and look like this (a string variable with the links separated by comma): "links":"**External links are only visible to Support Staff** BUT with some hosters (for example HDStream.to) then only the first links gets parsed correctly by JD. All following ones have the comma as part of their URL and are therefore considered offline. This bug is not present on the Webinterface of MyJD. So how do you separate links there? I also tried separating them by "\r\n". But then JD simply does not add anything. |
#2
|
||||
|
||||
Use NewLines and Don't forget to proper escape your json (in case you create it by manually)
__________________
JD-Dev & Server-Admin |
#3
|
|||
|
|||
Fixed. Thank you
To others struggeling: If you have an array of links: $links = implode( "\\r\\n", $array); You have to use 2 backslashes on it. Then you can build your json via with the json_encode() encode function afterwards: Code:
$params = array("autostart" => false, "links" => $links, "packageName" => $package_name, "extractPassword" => empty($extractPassword) ? null : $extractPassword, "priority" => "DEFAULT", "downloadPassword" => empty($downloadPassword) ? null : $downloadPassword, "destinationFolder" => null); $params = json_encode($params); Last edited by Zordon; 13.09.2015 at 18:51. |
#4
|
||||
|
||||
Thanks for the feedback!
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|