#1
|
|||
|
|||
[API] Cannot connect with the API
Hi,
I am currently working on a Chrome Extension which aims to send magnet or torrent file to the AllDebrid service and then send uptobox link to JDownloader. I already have done the first part (communication with AllDebrid) and now I try to login to the JDownloader API. I read the Google doc documentation but this is not helping. I have an existing account with my email address (MAIL_CENSORED_BY_MOD) but I need an appkey. I tried the default appkey registered in headless JD (JDDEFAULT) and custom ones and it's not working (I only get AUTH_FAILED error). Maybe I did something wrong in my JS code so you can find a screenshot as attachment. Please tell me if I did something wrong... Thank you in advance, Regards Last edited by pspzockerscene; 24.05.2022 at 16:43. Reason: Censored private mail address |
#2
|
||||
|
||||
@winflow: You can use the existing js client from Webinterface
https://my.jdownloader.org/jdapi/jdapi.min.js or the js client from our own webextension, see https://my.jdownloader.org/apps/ or take a look here github.com/malleguisse/node-jdownloader-api github.com/DanielRamosAcosta/jdownloader-client I would not recommend to write it from scratch because of encryption/session/payload handling. For appkey, just use your project or email or anything we can use to get in contact with you. Pay attention for toLowerCase to use correct locale!you should specify english locale as for example this might happen i18nguy.com/unicode/turkish-i18n.html In your screenshot I can see toLowerCase missing in signature method, you have to lowercase it in query as well
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 24.05.2022 at 16:50. |
#3
|
|||
|
|||
Thank you @Jiaz for your answer.
If there is something already done and I can use it of course I won't do it. Do you have some samples in order to see how I can use the library you use for the extension ? |
#4
|
||||
|
||||
@winflow: can you make use of the nodejs/typescript clients I've provided links on github ?
that would be better solution as they are easier to read/better documented. I would have to find a good example for our own js implementation. your own client mostly fails because of the missing toLowerCase in login request
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
@Jiaz I tried to use jdapi.min.js but it seems that it needs at least jQuery and requirejs.
I tried to use the code here : http://privatelink.de/?https://githu...r/example.html with same dependencies version I found in bower.json file but doesn't work... Maybe this is not the good repository (not updated since 5 years ?) ? I would like to have a lightweight extension in vanilla JS... If you could send me a sample that show how to initialize the client, add links and start download it would appreciated. Thank you again for your help Last edited by winflow; 30.05.2022 at 19:13. |
#6
|
||||
|
||||
@winflow: I'm no javascript expert/coder and thus can't be good source of help. But about your own implementation, did you note my comment about "missing toLowerCase"? the login should work then. I don't know if any of the github projects can be modified for vanilla JS but you already have a good base for your own vanilla JS client. Once login is working you only the generic method to call api methods and that's it. That part is not that complicated and I'll try my best to help you
__________________
JD-Dev & Server-Admin |
#7
|
||||
|
||||
Maybe you can share your code, so I can run/test/help?
send to support@jdownloader.org
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|