JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 16.06.2024, 07:16
TGU TGU is offline
JD Fan
 
Join Date: Jun 2024
Location: International Waters where DRM/DMCA protections are ignored
Posts: 70
Default Web API - Add endpoint to get a link's status & error reason

Dealing with error handling, I would like to fetch a link's status & error reason rather than handling it by basically extracting it like in https://board.jdownloader.org/showthread.php?p=535365. Adding another 2 parameters to queryLinks would be ideal.

For links within the linkgrabber it's typically one of the jd.plugins.DecrypterRetryException.RetryReason, I'm assuming that the downloads has something similar I didn't go too deep.

There also appears to be jd.plugins.LinkStatus which would be useful.

Slowly going through fully interacting with JD via the API, expect some more requests
Thanks
//TGU

Last edited by TGU; 16.06.2024 at 07:41.
Reply With Quote
  #2  
Old 16.06.2024, 22:10
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,531
Default

@TGU: LinkStatus is internal only and not used by Plugins anymore, only for communication Plugin->Link
I will add new status field to response that will be a combination/concatenation of the internal enum so you can better work on those. right now its label/text only.
I will add new field that contains for example
FinalLinkState.FINISHED_MIRROR
or
ExtractionStatus.ERRROR_FILE_NOT_FOUND
and because multiple states can be possible at ones, I will return array of entries or map, eg

Code:
{
"FinalLinkState":{
"id":"FINISHED_MIRROR"}
"ExtractionStatus":{
"id":"ERRROR_FILE_NOT_FOUND"
}
That way the response field is open for multiple status/future changes
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 16.06.2024, 23:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,531
Default

With next core update, set advancedStatus to true in LinkQuery object
and you will get advancedStatus Map response

please test and provide feedback. I've implemented all available status and meta information, so most verbose/detailed api response ever :p
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 17.06.2024 at 00:08.
Reply With Quote
  #4  
Old 18.06.2024, 13:21
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,127
Default

Updates have just been released.
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #5  
Old 21.06.2024, 00:31
TGU TGU is offline
JD Fan
 
Join Date: Jun 2024
Location: International Waters where DRM/DMCA protections are ignored
Posts: 70
Default

@Jiaz, had a chance to finally test the status.

"/downloadsv2/queryLinks":
status: only shown if there's an error ex:"File not found", does not display "finished" or "finished_..." (not sure if expected)
advancedStatus: works good

"/linkgrabberv2/queryLinks":
status: completely missing this json field in response, even though api request has status option (https://my.jdownloader.org/developers/#tag_264)
advancedStatus: missing advancedStatus
Reply With Quote
  #6  
Old 21.06.2024, 00:42
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,531
Default

Quote:
Originally Posted by TGU View Post
status: only shown if there's an error ex:"File not found", does not display "finished" or "finished_..." (not sure if expected)
expected, I did not touch/alter existing field. for finished, there is a boolean. But I guess I can check/modify to properly show finished.
Won't hurt

Quote:
Originally Posted by TGU View Post
advancedStatus: works good
Thanks for the feedback. new field contains all possible status stuff but in case you still miss something or want something different, please let me know



Quote:
Originally Posted by TGU View Post
"/linkgrabberv2/queryLinks":
status: completely missing this json field in response, even though api request has status option (https://my.jdownloader.org/developers/#tag_264)
advancedStatus: missing advancedStatus
not yet done yet, as links in linkgrabber have different status fields and first wanted to wait for feedback to avoid doing work in wrong direction. It's next on my todo then
__________________
JD-Dev & Server-Admin
Reply With Quote
  #7  
Old 21.06.2024, 01:45
TGU TGU is offline
JD Fan
 
Join Date: Jun 2024
Location: International Waters where DRM/DMCA protections are ignored
Posts: 70
Default

Quote:
Originally Posted by Jiaz View Post
Thanks for the feedback. new field contains all possible status stuff but in case you still miss something or want something different, please let me know
Hmm So far I've really only found the ConditionalSkipReason had little bit more than expected:
"ConditionalSkipReason":
Code:
{"ConditionalSkipReason":{"cause":"FILE_TEMP_UNAVAILABLE","iconKey":"kc.9ee0afbc66968155a8a9a2361a9f8484","label":"509 Bandwidth Limit Exceeded","id":"WaitingSkipReason","timeout":109052}}
(the status field is the label)

when compared to a link finished status:
Code:
{"FinalLinkState":"FINISHED"}
I did take a peak at the code for this, so I know you put in some time to get all the info set. So I think than just showing "FINISHED" string, a "standard" json format would be better with all the fields (so far) being {"id", "uuid", "label", "current", "total", "eta", "cause", "traffic", "timeout", "iconKey"}. We're already in the advancedStatus so might as well give it everything and standardize it.


Quote:
Originally Posted by Jiaz View Post
not yet done yet
Ah sure thing, one thing I wanted to say again is that there is NO status in the response even through there is a request option.

Last edited by TGU; 21.06.2024 at 06:15.
Reply With Quote
  #8  
Old 24.06.2024, 21:32
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,531
Default

@TGU: The map is created in a way that the root key defines the object (FinalLinkState, PluginProgress...) the map will contain information for.
the "id" field will hold the id/name of the enum.
the fields "label" and "iconKey" are the old information that were part of normal status but now will be available for all status fields, not just one like in old response format.

Every object map will contain all available/useful information for that specifc object.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 24.06.2024, 21:32
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,531
Default

Quote:
Originally Posted by TGU View Post
when compared to a link finished status:
Code:
{"FinalLinkState":"FINISHED"}
Thanks for the good eyes/hint. That's a bug of course it was meant to be same format with label/id/iconkey.... wait for update

wait for update and then test again. Anything else missing/wanted in that new response field?
with next update, also link status(availability) will be included, also for LinkCrawlerRetry, see
Quote:
Originally Posted by TGU View Post
For links within the linkgrabber it's typically one of the jd.plugins.DecrypterRetryException.RetryReason
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 24.06.2024 at 21:59.
Reply With Quote
  #10  
Old 24.06.2024, 23:21
TGU TGU is offline
JD Fan
 
Join Date: Jun 2024
Location: International Waters where DRM/DMCA protections are ignored
Posts: 70
Default

Quote:
Originally Posted by Jiaz View Post
Anything else missing/wanted in that new response field
From what I saw everything has enough information in order for it to be handled (including the icons); The only thing I haven't really checked/seen was the ExtractionStatus. But with all the fields provided, it should give a good indication if it's something that can be handled automatically or needs user intervention like "wrong password???".

:thumbup: Thanks for pushing this feature up to the front, I'm sure it was already waiting since before 2018. I know all too well as time goes on you spent too much time dealing with support for a new site or issues with a site, It just get's more time consuming over the years leading to less actual development time.

Last edited by TGU; 24.06.2024 at 23:25.
Reply With Quote
  #11  
Old 24.06.2024, 23:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,531
Default

Quote:
Originally Posted by TGU View Post
The only thing I haven't really checked/seen was the ExtractionStatus.
That one was buggy as well wait for update
__________________
JD-Dev & Server-Admin
Reply With Quote
  #12  
Old 08.07.2024, 23:52
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,531
Default

@TGU: any feedback on this?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #13  
Old 11.07.2024, 01:13
TGU TGU is offline
JD Fan
 
Join Date: Jun 2024
Location: International Waters where DRM/DMCA protections are ignored
Posts: 70
Default

Quote:
Originally Posted by Jiaz View Post
@TGU: any feedback on this?
Oh I wasn't aware there was an update

Looks like everything on the DownloadsV2 advancedStatus response is there, including the extraction status; I haven't found any issues when scanning through a few thousand links.

I suppose the only "issue" might be in the normal status field not displaying it's finished, and only shows on errors (for people who don't want to use advancedStatus, but you can check the finished field anyways)
Reply With Quote
  #14  
Old 11.07.2024, 10:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,531
Default

Quote:
Originally Posted by TGU View Post
I suppose the only "issue" might be in the normal status field not displaying it's finished, and only shows on errors (for people who don't want to use advancedStatus, but you can check the finished field anyways)
Will be fixed with next update, thanks for the hint

Quote:
Originally Posted by TGU View Post
Looks like everything on the DownloadsV2 advancedStatus response is there, including the extraction status; I haven't found any issues when scanning through a few thousand links
Thanks for the feedback. I will then add similiar advancedStatus response for linkcollector entries as well and add everything that *makes sense*
Will ping you once the changes are live for testing
__________________
JD-Dev & Server-Admin
Reply With Quote
  #15  
Old 11.07.2024, 16:20
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,531
Default

with next update lincollector will also provided added date and advanced status
__________________
JD-Dev & Server-Admin
Reply With Quote
  #16  
Old 25.07.2024, 05:29
TGU TGU is offline
JD Fan
 
Join Date: Jun 2024
Location: International Waters where DRM/DMCA protections are ignored
Posts: 70
Default

Quote:
Originally Posted by Jiaz View Post
with next update linkcollector will also provided added date and advanced status
Looks good, I saw the addedDate in there and the advancedStatus is much more simpler than what's in the downloadv2. The only issues I have really seen would be things like these aren't really handled.

Code:
Host:"linkcrawlerretry", Comment:"This folder is empty.", Name:"Empty folder!a1dQSb", AdvancedStatus:map[AvailableStatus:{ID:"UNCHECKED" Label:"Not checked" IconKey:"help"}]
Host:"linkcrawlerretry", Comment:"", Name:"Wrong password!GBRvMfhgyJ", AdvancedStatus:map[AvailableStatus:{ID:"UNCHECKED" Label:"Not checked" IconKey:"help"}]
Reply With Quote
  #17  
Old 25.07.2024, 10:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,531
Default

@TGU: Thanks for the feedback. missing linkcrawlerretry info will be fixed with next update
and
Quote:
advancedStatus is much more simpler than what's in the downloadv2
because in linkcollector it does not have any progress/extraction/final... states
__________________
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 19:32.
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 - 2024, Jelsoft Enterprises Ltd.