Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeouts when running commands #51

Open
HeyItsJono opened this issue Nov 5, 2024 · 4 comments
Open

Timeouts when running commands #51

HeyItsJono opened this issue Nov 5, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@HeyItsJono
Copy link

Hey there, I'm excited to finally have an alternative to the sluggish web interface, but unfortunately many of these commands seem to just time out. Here's an example below (sensitive info has been replaced by placeholders).

jdcli download link list --device DEVICE--debug

2024-11-05T22:58:24.170+1100    DEBUG   jdownloader/client.go:235       POST https://api.jdownloader.org/my/connect?email=EMAIL&appkey=jdcli&rid=1&signature=938c63ea23446a02652a4c936a000c98f7ba75f3bf34c442eb11b972257d419a @ 1
2024-11-05T22:58:25.776+1100    DEBUG   jdownloader/client.go:248       HTTP200 @ 1
2024-11-05T22:58:25.777+1100    DEBUG   jdownloader/client.go:235       GET https://api.jdownloader.org/my/listdevices?sessiontoken=TOKEN&rid=2&signature=cd01d092f9817bc34cad9c5ca38051268365b3aa07c1e267e65437955b671db6 @ 2
2024-11-05T22:58:26.162+1100    DEBUG   jdownloader/client.go:248       HTTP200 @ 2
2024-11-05T22:58:26.163+1100    DEBUG   jdownloader/client.go:235       POST https://api.jdownloader.org/t_TOKEN_c9dcac34920f7ef91076d51c25973393/downloadsV2/queryLinks @ 3
2024-11-05T22:58:27.846+1100    DEBUG   jdownloader/client.go:248       HTTP200 @ 3
2024-11-05T22:58:56.164+1100    DEBUG   jdownloader/client.go:235       POST https://api.jdownloader.org/my/disconnect?sessiontoken=TOKEN&rid=4&signature=3f4a8bfbdc123e9042c9d160646fa65c01ad122e4bab84b2ca5197cc9c06bc58 @ 4
2024-11-05T22:58:56.557+1100    DEBUG   jdownloader/client.go:248       HTTP200 @ 4
Error: unable to fully consume response body: context deadline exceeded (Client.Timeout or context cancellation while reading body)
Usage:
  jdcli download link list [flags]

Flags:
      --debug           Debugging flag
      --device string   Device name to use for this operation
  -h, --help            help for list

panic: unable to fully consume response body: context deadline exceeded (Client.Timeout or context cancellation while reading body)

goroutine 1 [running]:
main.main()
        /home/runner/work/jdownloader-cli/jdownloader-cli/cmd/cli.go:26 +0x56
@rkosegi
Copy link
Owner

rkosegi commented Nov 5, 2024

Hi @HeyItsJono, thank you for report.
I've seen this myself before, it's quite nondeterministic - probably depends on responsiveness of api.jdownloader.org. I need to think about how to make this more resilient. According to my experience, retrying command will eventually work.

@rkosegi rkosegi added the enhancement New feature or request label Nov 5, 2024
@HeyItsJono
Copy link
Author

Hi @HeyItsJono, thank you for report.
I've seen this myself before, it's quite nondeterministic - probably depends on responsiveness of api.jdownloader.org. I need to think about how to make this more resilient. According to my experience, retrying command will eventually work.

Is there a way to interface with the JD instance directly over the local network? JD API allows direct connection which may bypass the issue with API timeouts, I know the Python JD library allows for this

@rkosegi
Copy link
Owner

rkosegi commented Nov 13, 2024

Non-default API endpoint is not supported by CLI (yet?)
Do you have a link to Python JD library that is capable of direct connection?

@HeyItsJono
Copy link
Author

Sure, mind you I haven't tested it myself yet.

Sample:
https://github.com/pglaum/pyjd/blob/master/examples/direct.py

Relevant parts of the Python Library:
https://github.com/pglaum/pyjd/blob/master/pyjd/direct_connector.py
https://github.com/pglaum/pyjd/blob/master/pyjd/direct_connection_helper.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants