JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 24.05.2022, 15:07
winflow winflow is offline
Modem User
 
Join Date: Jul 2017
Posts: 3
Default [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
Attached Images
File Type: png Capture d’écran 2022-05-24 151104.png (88.9 KB, 3 views)

Last edited by pspzockerscene; 24.05.2022 at 15:43. Reason: Censored private mail address
Reply With Quote
  #2  
Old 24.05.2022, 15:46
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,497
Default

@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 15:50.
Reply With Quote
  #3  
Old 24.05.2022, 18:27
winflow winflow is offline
Modem User
 
Join Date: Jul 2017
Posts: 3
Default

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 ?
Reply With Quote
  #4  
Old 25.05.2022, 10:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,497
Default

@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
Reply With Quote
  #5  
Old 30.05.2022, 18:09
winflow winflow is offline
Modem User
 
Join Date: Jul 2017
Posts: 3
Default

@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 18:13.
Reply With Quote
  #6  
Old 30.05.2022, 19:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,497
Default

@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
Reply With Quote
  #7  
Old 30.05.2022, 19:25
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,497
Default

Maybe you can share your code, so I can run/test/help?
send to support@jdownloader.org
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 18:59.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.