# Seedbox tools (seedboxtools)
| Donate to support this free software |
|:------------------------------------:|
| <img width="164" height="164" title="" alt="" src="doc/bitcoin.png" /> |
| [12cXnYY3wabbPmLpS7ZgACh4mBawrXdndk](bitcoin:12cXnYY3wabbPmLpS7ZgACh4mBawrXdndk) |
The seedbox tools will help you download all those Linux ISOs that you
downloaded on your remote seedbox (whether it's a Transmission Web, or
TorrentFlux-b4rt, or a PulsedMedia seedbox) 100% automatically, without any
manual intervention on your part.
With this program installed on your home computer, all you need to do is
simply start a torrent in your seedbox, from anywhere you are; then, when
you get back home, all your downloads will be fully downloaded at home,
ready to use and enjoy.
## Tools included in this set
This package contains several tools:
1. leechtorrents: a tool that leeches finished downloads from a torrent
seedbox to your local computer.
2. configleecher: a configuration wizard to set up the clients to work
properly against your seedbox.
3. uploadtorrents: a tool that lets you queue up a torrent or magnet link
for download on your seedbox.
## What you need to have before using this package
* Python 3.7 on your local machine
* Python iniparse installed there
* Python requests installed there, version 0.11.1 or higher (with SSL support)
* a seedbox running TorrentFlux-b4rt or Transmission Web + API, or
a PulsedMedia ruTorrent seedbox from PulsedMedia.com
* an SSH server on your seedbox
* an SSH client on your local machine
* a public key-authenticated user account in the seedbox, so that your user
can log in without passwords and can read the torrents and downloads
directories in the seedbox
* rsync installed on both machines
* if you are using TorrentFlux-b4rt on your seedbox:
* the command torrentinfo-console from the BitTorrent package, installed
on the seedbox
* the command fluxcli installed and operational on the seedbox
* if you are using Transmission on your seedbox:
* the command transmission-remote from the Transmission package,
installed on your local machine
* the API server port open so that transmission-remote can query it
* if you are using a PulsedMedia seedbox, you don't need to do anything
## Installation
You will need to install this package on your local machine.
You can install this package directly from PyPI using pip::
```
pip install seedboxtools
```
If you are on an RPM-based distribution, build an RPM from the source package
and install the resulting RPM::
```
make rpm
```
Otherwise, just use the standard Python installation system::
```
python -m build -s
pip install dist/*.tar.gz
```
You can also run it directly from the unpacked source directory::
```
export PYTHONPATH=src
bin/leechtorrents --help
```
## Configuration
The tools require some configuration after installation. There is a nifty
configuration wizard that will set the configuration file up. Run it and
answer a few questions::
```
configleecher
```
The script will ask you for the necessary configuration values before you can
run the tools here. You should run this wizard on the machine where you'll
be running `leechtorrents` (see below).
Note: Both TorrentFlux and Transmission protect their download and torrent
directories using permissions. You should become part of the UNIX group
they use to protect those directories, and change the permissions
accordingly so you have at least read and list permissions (rx).
## Downloading finished torrents with the leecher tool
The leecher tool will contact your seedbox and ask for a listing of finished
torrents, then download them locally to the directory you chose during
configuration. There are various ways to run the script:
* manually on a terminal window
* with cron
* in a systemd unit file as a service
In all cases, the leecher tool will figure out finished torrents, download
them to the download folder you configured during the `configleecher` stage,
then create a file named `.<downloaded file>.done` within the download folder,
to indicate that the torrent has finished downloading. This marker helps the
leecher tool remember which torrents were fully downloaded, so that it doesn't
attempt to download them yet again.
### Manually
In your terminal program of choice, just run the command::
```
leechtorrents
```
There are various options you can supply to the program to change its
behavior, such as enabling periodic checks and logging to a file. Run
`leechtorrents -h` to see the options.
### With cron
Put this in your crontab to run it every minute::
```
* * * * * leechtorrents -Dql
```
`leechtorrents` will daemonize itself, write to its default log file (which
you could change with another command line option), and be quiet if no work
needs to be done. Locking prevents multiple `leechtorrents` processes from
running simultaneously.
### With systemd
Enable the respective unit file for your user:
```
# $USER contains the user that will run leechtorrents.
# Only run this after configuring the torrent leecher!
sudo systemctl enable --now leechtorrents@$USER
```
You can configure command line options in `/etc/default/leechtorrents` as well
as with `~/.config/leechtorrents-environment`. The environment variable
`$LEECHTORRENTS_OPTS` is defined in either of those files, and carries the
command-line options that will be used by the program.
You can verify if there are any errors using:
```
sudo systemctl status leechtorrents@$USER
# and
sudo journalctl -b -u leechtorrents@$USER
```
# Removing completed torrents once they have been fully downloaded
The leecher tool has the ability to remove completed downloads that aren't
seeding from your seedbox. Just pass the command line option `-r` to the
leecher tool `leechtorrents`, and it will automatically remove from the
seedbox each torrent it successfully downloads, so long as the torrent
is not seeding anymore. This feature helps conserve disk space in your
seedbox. Note that, once a torrent has been removed from the seedbox,
its corresponding `.<downloaded file>.done` file on the download folder
will be eliminated, to clear up clutter in the download folder.
Example::
```
leechtorrents -r
```
# Running a program after a torrent is finished downloading
The leecher tool has the capacity to run a program (non-interactively) right
after a download is completed, and will also pass the full path to the file
or directory that was downloaded to the program. This program will be run
right after the download is done, and (if you have enabled said option)
before the torrent is removed from the seedbox, and its marker file removed
from the download folder.
To activate the running of the post-download program, pass the option `-s`
followed by the path to the program you want to run.
Here is an example that runs a particular program to process downloads::
```
leechtorrents -s /usr/local/bin/blend-linux-distributions
```
In this example, right after your favorite Linux distribution torrent
(which surely is `Fedora-22.iso`) is done and saved to your download folder
`/srv/seedbox`, `leechtorrents` will execute the following command line::
```
/usr/local/bin/blend-linux-distributions /srv/seedbox/Fedora-22.iso
```
The standard output and standard error of the program are passed to the
standard output and standard error of `leechtorrents`, which may be your
terminal, a logging service, or the log file set aside for logging purposes
by the `leechtorrents` command line parameter `-l`. Standard input will
be nullified, so no option for interacting with the program will exist.
Note that your program will only ever execute once per downloaded torrent.
Also note that the return value of your program will be ignored. Finally,
please note that if your program doesn't finish, this will block further
downloads, so make sure to equip your program with a timeout (perhaps using
`SIGALRM` or such mechanisms).
If you want to run a shell or other language script against the downloaded
file or directory, you are advised to write a script file and pass that as
the argument to `-s`, then use the first argument to the script file as
the path to the downloaded file (it's usually `$1` in sh-like languages,
like it is `sys.argv[1]` in Python).
How to upload torrents to your seedbox
--------------------------------------
The `uploadtorrents` command-line tool included in this package will upload the
provided torrent files or magnet links to your seedbox::
```
uploadtorrents TORRENT [TORRENT ...]
```
This tool currently only supports PulsedMedia clients.
Raw data
{
"_id": null,
"home_page": "https://github.com/Rudd-O/seedboxtools",
"name": "seedboxtools",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "seedbox,TorrentFlux,Transmission,PulsedMedia,torrents,download",
"author": "Manuel Amador (Rudd-O)",
"author_email": "rudd-o@rudd-o.com",
"download_url": "https://files.pythonhosted.org/packages/c2/ae/fc4accac7c63f4e6ac8f7913e88b1374f31e30477b6c812d129730529706/seedboxtools-1.6.7.tar.gz",
"platform": null,
"description": "# Seedbox tools (seedboxtools)\n\n| Donate to support this free software |\n|:------------------------------------:|\n| <img width=\"164\" height=\"164\" title=\"\" alt=\"\" src=\"doc/bitcoin.png\" /> |\n| [12cXnYY3wabbPmLpS7ZgACh4mBawrXdndk](bitcoin:12cXnYY3wabbPmLpS7ZgACh4mBawrXdndk) |\n\nThe seedbox tools will help you download all those Linux ISOs that you\ndownloaded on your remote seedbox (whether it's a Transmission Web, or\nTorrentFlux-b4rt, or a PulsedMedia seedbox) 100% automatically, without any\nmanual intervention on your part.\n\nWith this program installed on your home computer, all you need to do is\nsimply start a torrent in your seedbox, from anywhere you are; then, when\nyou get back home, all your downloads will be fully downloaded at home,\nready to use and enjoy.\n\n## Tools included in this set\n\nThis package contains several tools:\n \n1. leechtorrents: a tool that leeches finished downloads from a torrent\n seedbox to your local computer.\n2. configleecher: a configuration wizard to set up the clients to work\n properly against your seedbox.\n3. uploadtorrents: a tool that lets you queue up a torrent or magnet link\n for download on your seedbox.\n\n## What you need to have before using this package\n \n* Python 3.7 on your local machine\n* Python iniparse installed there\n* Python requests installed there, version 0.11.1 or higher (with SSL support)\n* a seedbox running TorrentFlux-b4rt or Transmission Web + API, or\n a PulsedMedia ruTorrent seedbox from PulsedMedia.com\n* an SSH server on your seedbox\n * an SSH client on your local machine\n * a public key-authenticated user account in the seedbox, so that your user\n can log in without passwords and can read the torrents and downloads\n directories in the seedbox\n * rsync installed on both machines\n * if you are using TorrentFlux-b4rt on your seedbox:\n * the command torrentinfo-console from the BitTorrent package, installed\n on the seedbox\n * the command fluxcli installed and operational on the seedbox\n * if you are using Transmission on your seedbox:\n * the command transmission-remote from the Transmission package,\n installed on your local machine\n * the API server port open so that transmission-remote can query it\n * if you are using a PulsedMedia seedbox, you don't need to do anything\n\n## Installation\n\nYou will need to install this package on your local machine.\n\nYou can install this package directly from PyPI using pip::\n\n```\npip install seedboxtools\n```\n\nIf you are on an RPM-based distribution, build an RPM from the source package\nand install the resulting RPM::\n \n```\nmake rpm\n```\n\nOtherwise, just use the standard Python installation system::\n\n```\npython -m build -s\npip install dist/*.tar.gz\n```\n\nYou can also run it directly from the unpacked source directory::\n\n```\nexport PYTHONPATH=src\nbin/leechtorrents --help\n```\n\n## Configuration\n\nThe tools require some configuration after installation. There is a nifty\nconfiguration wizard that will set the configuration file up. Run it and\nanswer a few questions::\n\n```\nconfigleecher\n```\n\nThe script will ask you for the necessary configuration values before you can\nrun the tools here. You should run this wizard on the machine where you'll\nbe running `leechtorrents` (see below).\n\nNote: Both TorrentFlux and Transmission protect their download and torrent\ndirectories using permissions. You should become part of the UNIX group\nthey use to protect those directories, and change the permissions\naccordingly so you have at least read and list permissions (rx).\n \n## Downloading finished torrents with the leecher tool\n\nThe leecher tool will contact your seedbox and ask for a listing of finished\ntorrents, then download them locally to the directory you chose during\nconfiguration. There are various ways to run the script:\n\n* manually on a terminal window\n* with cron\n* in a systemd unit file as a service\n\nIn all cases, the leecher tool will figure out finished torrents, download\nthem to the download folder you configured during the `configleecher` stage,\nthen create a file named `.<downloaded file>.done` within the download folder,\nto indicate that the torrent has finished downloading. This marker helps the\nleecher tool remember which torrents were fully downloaded, so that it doesn't\nattempt to download them yet again.\n\n### Manually\n\nIn your terminal program of choice, just run the command::\n\n```\nleechtorrents\n```\n\nThere are various options you can supply to the program to change its\nbehavior, such as enabling periodic checks and logging to a file. Run\n`leechtorrents -h` to see the options.\n\n### With cron\n\nPut this in your crontab to run it every minute::\n\n```\n* * * * * leechtorrents -Dql\n```\n\n`leechtorrents` will daemonize itself, write to its default log file (which\nyou could change with another command line option), and be quiet if no work\nneeds to be done. Locking prevents multiple `leechtorrents` processes from\nrunning simultaneously.\n\n### With systemd\n\nEnable the respective unit file for your user:\n\n```\n# $USER contains the user that will run leechtorrents.\n# Only run this after configuring the torrent leecher!\nsudo systemctl enable --now leechtorrents@$USER\n```\n\nYou can configure command line options in `/etc/default/leechtorrents` as well\nas with `~/.config/leechtorrents-environment`. The environment variable\n`$LEECHTORRENTS_OPTS` is defined in either of those files, and carries the\ncommand-line options that will be used by the program.\n\nYou can verify if there are any errors using:\n\n```\nsudo systemctl status leechtorrents@$USER\n# and\nsudo journalctl -b -u leechtorrents@$USER\n```\n\n# Removing completed torrents once they have been fully downloaded\n\nThe leecher tool has the ability to remove completed downloads that aren't\nseeding from your seedbox. Just pass the command line option `-r` to the\nleecher tool `leechtorrents`, and it will automatically remove from the\nseedbox each torrent it successfully downloads, so long as the torrent\nis not seeding anymore. This feature helps conserve disk space in your\nseedbox. Note that, once a torrent has been removed from the seedbox,\nits corresponding `.<downloaded file>.done` file on the download folder\nwill be eliminated, to clear up clutter in the download folder.\n\nExample::\n\n```\nleechtorrents -r\n```\n\n# Running a program after a torrent is finished downloading\n\nThe leecher tool has the capacity to run a program (non-interactively) right\nafter a download is completed, and will also pass the full path to the file\nor directory that was downloaded to the program. This program will be run\nright after the download is done, and (if you have enabled said option)\nbefore the torrent is removed from the seedbox, and its marker file removed\nfrom the download folder.\n\nTo activate the running of the post-download program, pass the option `-s`\nfollowed by the path to the program you want to run.\n\nHere is an example that runs a particular program to process downloads::\n\n```\nleechtorrents -s /usr/local/bin/blend-linux-distributions\n```\n\nIn this example, right after your favorite Linux distribution torrent\n(which surely is `Fedora-22.iso`) is done and saved to your download folder\n`/srv/seedbox`, `leechtorrents` will execute the following command line::\n\n```\n/usr/local/bin/blend-linux-distributions /srv/seedbox/Fedora-22.iso\n```\n\nThe standard output and standard error of the program are passed to the\nstandard output and standard error of `leechtorrents`, which may be your\nterminal, a logging service, or the log file set aside for logging purposes\nby the `leechtorrents` command line parameter `-l`. Standard input will\nbe nullified, so no option for interacting with the program will exist.\n\nNote that your program will only ever execute once per downloaded torrent.\nAlso note that the return value of your program will be ignored. Finally,\nplease note that if your program doesn't finish, this will block further\ndownloads, so make sure to equip your program with a timeout (perhaps using\n`SIGALRM` or such mechanisms).\n\nIf you want to run a shell or other language script against the downloaded\nfile or directory, you are advised to write a script file and pass that as\nthe argument to `-s`, then use the first argument to the script file as\nthe path to the downloaded file (it's usually `$1` in sh-like languages,\nlike it is `sys.argv[1]` in Python).\n\nHow to upload torrents to your seedbox\n--------------------------------------\n\nThe `uploadtorrents` command-line tool included in this package will upload the\nprovided torrent files or magnet links to your seedbox::\n\n```\nuploadtorrents TORRENT [TORRENT ...]\n```\n\nThis tool currently only supports PulsedMedia clients.\n",
"bugtrack_url": null,
"license": "",
"summary": "A tool to automate downloading finished torrents from a seedbox",
"version": "1.6.7",
"split_keywords": [
"seedbox",
"torrentflux",
"transmission",
"pulsedmedia",
"torrents",
"download"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c2aefc4accac7c63f4e6ac8f7913e88b1374f31e30477b6c812d129730529706",
"md5": "b86bef00cfeb593affe74b46b82a8091",
"sha256": "ebde3dea43cd2766b9b2a50212786b2069dc55f0cf5f323c5331811886e337be"
},
"downloads": -1,
"filename": "seedboxtools-1.6.7.tar.gz",
"has_sig": false,
"md5_digest": "b86bef00cfeb593affe74b46b82a8091",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 25031,
"upload_time": "2023-04-27T00:32:15",
"upload_time_iso_8601": "2023-04-27T00:32:15.922457Z",
"url": "https://files.pythonhosted.org/packages/c2/ae/fc4accac7c63f4e6ac8f7913e88b1374f31e30477b6c812d129730529706/seedboxtools-1.6.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-27 00:32:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Rudd-O",
"github_project": "seedboxtools",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "seedboxtools"
}