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

[Feature Request] - Automation of the download cycle #8357

Open
SpudmanWP opened this issue Dec 24, 2024 · 2 comments
Open

[Feature Request] - Automation of the download cycle #8357

SpudmanWP opened this issue Dec 24, 2024 · 2 comments

Comments

@SpudmanWP
Copy link

SpudmanWP commented Dec 24, 2024

I'd like to set up my Tribler instance to be as hands-off as possible.
It's currently in it's own Linux VM but will be in a Docker container when that gets released for 8.x

To that end, I'd like to propose some features to support automation:

  1. Given that Tribler already supports subfolders in the Watch folder, let those folders represent a "Category".
  2. Have "Category" appear in a UI column for the download.
  3. Have the ability to change the Category after a download has started.
  4. When a file completes, move the Watch folder torrent file to a "completed" folder that mimics the Watch folder, including Category subfolders.
  5. When a file completes, move the completed download folder to another location according to a rules-based filter (based on Category, Name, etc). The file should still be able to be shared after moving.
@qstokkink
Copy link
Contributor

If you want this level of complexity, it's probably a better to make your own script.

Tribler supports a REST API that allows you directly read and modify your downloads. You can play around with this by browsing to http://127.0.0.1:12345/docs (where 127.0.0.1 and 12345 are the IP and port Tribler is running on).

For example, moving a download with infohash abcdefabcdefabcdef00 can be done with an HTTP PATCH request to http://127.0.0.1:12345/api/downloads/abcdefabcdefabcdef00 and the request body:

{
    "state": "move_storage",
    "dest_dir": "/some/directory"
}

@armchairancap
Copy link

If you want this level of complexity, it's probably a better to make your own script.

Makes sense. Such automation belongs to workflow/automation tools and seems out of scope for Tribler.

I created this simple example to get people started.
https://github.com/armchairancap/magnet-link-downloader-tribler-firefox

Notes:

  • It doesn't automate post-download steps, as that was out of scope for me and is highly workflow-dependent
  • What this does is initiate Tribler API (download) requests from the browser,and it shows how the API could be used into implement such workflows and rules in a Firefox browser extension. (That would be out of scope for this extension as well; personally I'd prefer to implement it in another service that would manage them and run workflows).

Image

  • If someone wonders what's the problem with copying links manually and pasting them into Tribler, that was a tool for a chat integration PoC.

Image

  • Another use case is stand-alone, for headless Tribler.

Not to sound completely negative, I think there's some room for (scoped-down) improvement, i.e. if one could add tags to downloads, filtering by some categories could be helpful to API clients that wish to automate workflows. Presently, without tags, I'd probably go with a small Web/DB combo to manage tags and workflows. Not very complicated, but more complicated than a 200 LoC Python script running periodically from cron.

Another idea I've tested was an upload/download bot for the chat I mentioned above. I haven't published that code, but the way it worked is exactly as one may expect - the bot shares and posts magnet links to private chats, and can also download links posted by others (which is OK if in a community of friends or relatives) using Tribler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants