pawamoy / aria2p

Command-line tool and library to interact with an aria2c daemon process with JSON-RPC.
https://pawamoy.github.io/aria2p
ISC License
479 stars 93 forks source link

Open a file right from aria2p #109

Open Bellavene opened 2 years ago

Bellavene commented 2 years ago

Would be useful a lot to open a file with a keystroke and even perfect to make shell custom commands binded to a key.

pawamoy commented 2 years ago

Could you expand a bit? What file? What shell commands?

Bellavene commented 2 years ago

Excuse me, wasn’t clear. Open any downloaded file right from top interface, wouldn’t it be nice to open a video without the need to open the folder elsewhere? And bind keys for custom shell commands, so we can for example move files to predefined directories with simple shell commands and etc. etc. etc.

I have binded a key for aria2p terminal window, a bit annoying that you can’t even go to downloads folder from it like from any downloads manager, but you could.

pawamoy commented 2 years ago

Unfortunately there's absolutely no way to do that from aria2p. We're communicating with the server using the HTTP (JSON-RPC) protocol, so we simply cannot issue shell commands onto the server where the aria2c daemon is running. Of course we could issue commands on the current machine, where aria2p is running, but that would only work when the daemon is also running locally and not on a remote server. If you have suggestions on how to make this work for remote servers as well, please share! In the meantime I'll close this issue.

EDIT: we could argue that aria2p already provides functions that only work locally, so why not add more. Well, indeed, why not. We just need to design a good architecture to handle the situation where the daemon is on a remote server (to replace local ops with no ops and warnings).

Bellavene commented 1 year ago

I meant the aria2p top interface, would be absolutely awesome if we could add a keystroke to open the file or its location in ranger or other file manager via a command.

pawamoy commented 1 year ago

Textual can be used now to re-implement the TUI with it. Happy to review PRs, otherwise I'll get to it when I need to have some fun :slightly_smiling_face: