update(downloader/deluge): adds deluge-mover script and language fixes (#1638)
Co-authored-by: TRaSH <trash-pm@protonmail.ch>pull/1644/head
@ -1,6 +1,6 @@
|
||||
nav:
|
||||
- Installing: index.md
|
||||
- Basic-Setup: Basic-Setup.md
|
||||
- Using Labels: Using-Labels.md
|
||||
- Port forwarding: Port-Forwarding.md
|
||||
- Tips: Tips.md
|
||||
- Installing: index.md
|
||||
- Basic-Setup: Basic-Setup.md
|
||||
- Using Labels: Using-Labels.md
|
||||
- Port forwarding: Port-Forwarding.md
|
||||
- Tips
|
||||
|
@ -0,0 +1,54 @@
|
||||
# Thin Client
|
||||
|
||||
## Daemon
|
||||
|
||||
If you are already running Deluge in `daemon` or `console` mode, or running via Docker, this is usually enabled by default. You will need to check your compose or core.conf for the "daemon_port" if you do not know it.
|
||||
|
||||
!!! tip
|
||||
You can also access the daemon settings in `Preferences` in the WebUI if you do not have access to the GTK/UI
|
||||
|
||||
You will need to have "Allow Remote Connections" enabled if you are not connecting to Deluge from localhost.
|
||||
|
||||
![!Daemon Settings](images/Deluge-tc-daemon.png)
|
||||
|
||||
!!! info
|
||||
If you do not have access to the WebUI, and are instead doing this by editing Deluge's `core.conf`, you will need to change "allow_remote" to true.
|
||||
|
||||
Restart Deluge for the changes to take effect.
|
||||
|
||||
------
|
||||
|
||||
## Switching to Thin-Client
|
||||
|
||||
Once your daemon is up and running, it's time to set up the client you'll be using to manage your daemon. This will usually be on a second computer, but if you wish to use Deluge with Thin-Client locally (to always seed in the background) that works as well.
|
||||
|
||||
Simply go to `Edit` => `Preferences` and switch from `Standalone` to `Thin Client`
|
||||
|
||||
![!Thin-Client Toggle](images/Deluge-tc-settings.png)
|
||||
|
||||
Restart Deluge.
|
||||
|
||||
!!! info
|
||||
You will still need to set the daemon to run at start-up.
|
||||
|
||||
### Connections Manager
|
||||
|
||||
After switching to `Thin Client` you will need to connect to your daemon. Go to `Edit` => `Connections Manager` and click on `Add` to add the daemon.
|
||||
|
||||
![!Label Options](images/Deluge-tc-connman.png)
|
||||
|
||||
!!! ATTENTION
|
||||
If you mistyped your password while adding the connection, it will prompt you to enter it. There is a bug that does not accept/save the correct password unless it is entered through the `Add`/`Edit` Menu.
|
||||
|
||||
If you mistype the password while you are adding the connection, go to `Edit` on the connection and retype the password into the password field.
|
||||
|
||||
!!! WARNING
|
||||
You can find your users and passwords for the daemon in the `auth` file inside your appdata/config folder for Deluge.
|
||||
|
||||
You can add users in the `Daemon` settings in preferences as well.
|
||||
|
||||
BE AWARE: These passwords are stored in PLAIN-TEXT in your `auth` file.
|
||||
|
||||
{! include-markdown "../../../../includes/support.md" !}
|
||||
|
||||
<!-- --8<-- "includes/support.md" -->
|
@ -0,0 +1,263 @@
|
||||
# unRAID Mover and Deluge
|
||||
|
||||
When you make use of the unRAID cache drive for your `/data/torrents` share, and the torrents in Deluge are still seeding, the mover can't move files since they are still in use.
|
||||
|
||||
Using the following instructions will allow you to move the files with the use of the Deluge JSON-RPC.
|
||||
|
||||
!!! abstract "Workflow Rules"
|
||||
|
||||
1. Pause torrents in a specified age range that reside on your cache drive.
|
||||
1. Run the unRAID mover.
|
||||
1. Resume the torrents after the mover has completed.
|
||||
|
||||
!!! warning
|
||||
|
||||
The screenshots below are only **EXAMPLES** to show you how it should look and where you need to place the data that you need to add. They are **NOT** always a 100% reflection of the actual data, and not always the actual values you need to add.
|
||||
|
||||
- Always follow the recommendations described in the guide.
|
||||
- If you have any questions, or aren't sure, just click the chat badge to join the Discord Channel where you can ask your questions directly.
|
||||
|
||||
## Needed
|
||||
|
||||
### `deluge-mover` script
|
||||
|
||||
Download the following standalone Python script.
|
||||
|
||||
- [Script (deluge-mover.py)](https://raw.githubusercontent.com/zakkarry/deluge-mover/master/deluge-mover.py){:target="_blank" rel="noopener noreferrer"}
|
||||
|
||||
Thanks to [zakary](https://github.com/zakkarry){:target="_blank" rel="noopener noreferrer"} (Developer on [cross-seed](https://github.com/cross-seed/cross-seed){:target="_blank" rel="noopener noreferrer"})
|
||||
|
||||
### Plugins
|
||||
|
||||
Install the following Plugins.
|
||||
|
||||
- User Scripts
|
||||
- NerdTools
|
||||
- python3 <sup>(*1*)</sup>
|
||||
- python-setuptools <sup>(*1*)</sup>
|
||||
- python-pip <sup>(*1*)</sup>
|
||||
|
||||
!!! info "<sup>(*1*)</sup> These need to be installed from NerdTools."
|
||||
|
||||
------
|
||||
|
||||
## Setup
|
||||
|
||||
After you install the needed `Plugins` - it's time to configure everything.
|
||||
|
||||
### `requests` module
|
||||
|
||||
`deluge-mover.py` needs the requests Python module, so we need to make sure it's installed when your unRAID server starts, or when the Array is started the first time.
|
||||
|
||||
You can choose one of the following 3 options to install `requests`.
|
||||
|
||||
- [User scripts](#user-scripts)
|
||||
- [Go File](#go-file)
|
||||
- [Python venv](#python-venv)
|
||||
|
||||
#### User scripts
|
||||
|
||||
With this option, we're going to install the `requests` module when the Array is started the first time.
|
||||
|
||||
In your unRAID Dashboard, go to your `Settings` tab and select `User Scripts` in the `User Utilities` section at the bottom.
|
||||
|
||||
![!User Scripts](images/Unraid-settings-user-scripts-icon.png)
|
||||
|
||||
At the bottom of the `User Scripts` page select the `ADD NEW SCRIPT` button.
|
||||
|
||||
![!Add New Script](images/Unraid-user-scripts-add-new-script-icon.png)
|
||||
|
||||
A popup will appear asking you to name the script. For this example, we're going to use `Install requests (deluge-mover)` and then click on `OK`.
|
||||
|
||||
![!Install requests module](images/Unraid-user-scripts-add-new-script-enter-name.png)
|
||||
|
||||
Click on the cogwheel of the new script in the list, and select `Edit Script`.
|
||||
|
||||
![!Select user script](images/Unraid-settings-user-scripts-edit-requests.png)
|
||||
|
||||
Copy/Paste the following in the new window that opens, then click `SAVE CHANGES`.
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
pip3 install requests
|
||||
```
|
||||
|
||||
![!Bash script](images/Unraid-settings-user-scripts-requests.png)
|
||||
|
||||
Select in the schedule list when the script should run, and choose `At First Array Start Only`.
|
||||
|
||||
![!Set Run Time](images/Unraid-settings-user-scripts-requests-schedule.png)
|
||||
|
||||
Click on `Apply`.
|
||||
|
||||
Finally, you will need to choose `RUN IN BACKGROUND` or restart your unRAID server to install the `requests` module.
|
||||
|
||||
------
|
||||
|
||||
#### Go File
|
||||
|
||||
With this option, we're going to install the `requests` module when the unRAID server is started.
|
||||
|
||||
On your USB stick/key go to `/boot/config` and open the `go` file with your text editor ([VSCode](https://code.visualstudio.com/){:target="_blank" rel="noopener noreferrer"}/[Notepad++](https://notepad-plus-plus.org/downloads/){:target="_blank" rel="noopener noreferrer"}).
|
||||
|
||||
Copy/paste the following command
|
||||
|
||||
```bash
|
||||
pip3 install requests
|
||||
```
|
||||
|
||||
Restart your unRAID Server or run the above command from the terminal.
|
||||
|
||||
------
|
||||
|
||||
#### Python venv
|
||||
|
||||
With this option, we're going to create a [Python virtual environment](https://docs.python.org/3/library/venv.html) on our disk. We will use this to run and store dependencies (`requests`) for this specific environment.
|
||||
|
||||
By doing this, we will **only need to configure this once** and it will be persistent after reboots *(this differs from the previous steps)*.
|
||||
|
||||
First, you need to choose a location to start a new Python environment.
|
||||
|
||||
!!! info
|
||||
In the next steps, you will be asked to choose a [location to store the script](#copy-script-to-your-preferred-location), try to be consistent.
|
||||
|
||||
Suggestions:
|
||||
|
||||
- `/mnt/user/appdata/deluge/scripts/.venv`
|
||||
- `/mnt/user/data/scripts/.venv`
|
||||
|
||||
Run the following command in unRAID's terminal in the directory you chose:
|
||||
|
||||
```bash
|
||||
python3 -m venv --clear /mnt/user/data/scripts/.venv
|
||||
```
|
||||
|
||||
We now need to enter this new environment and install our dependency (`requests`) in it, run:
|
||||
|
||||
```bash
|
||||
source /mnt/user/data/scripts/.venv/bin/activate
|
||||
pip3 install requests
|
||||
deactivate # to leave the environment
|
||||
```
|
||||
|
||||
!!! info
|
||||
Replace `/mnt/user/data/scripts/.venv` with the path you have chosen.
|
||||
|
||||
------
|
||||
|
||||
### Script
|
||||
|
||||
Now, using your favorite text editor ([VSCode](https://code.visualstudio.com/){:target="_blank" rel="noopener noreferrer"}/[Notepad++](https://notepad-plus-plus.org/downloads/){:target="_blank" rel="noopener noreferrer"}) edit the script you downloaded at the beginning of the guide ([HERE](#deluge-mover-script)).
|
||||
|
||||
You only need to change a few options at the top of the script.
|
||||
|
||||
```python
|
||||
# this webui will need to be the JSON-RPC endpoint
|
||||
# this ends with '/json'
|
||||
deluge_webui = "http://localhost:8112/json"
|
||||
deluge_password = "deluged"
|
||||
|
||||
# this changes whether the actual cache drive is checked for
|
||||
# applicable files to pause/move before pausing.
|
||||
#
|
||||
# if this is false, it will pause all torrents in the age-range
|
||||
# instead of only torrents in that range that exist on the cache
|
||||
check_fs = False
|
||||
|
||||
# this is the absolute host path to your cache drive's downloads
|
||||
# you only need this to be changed/set if using 'check_fs = True'
|
||||
cache_download_path = "/mnt/cache/torrents/completed"
|
||||
|
||||
# the age range of days to look for relevant torrents to move
|
||||
age_day_min = 2
|
||||
age_day_max = 5
|
||||
```
|
||||
|
||||
- `deluge_webui` => The URL you use to access Deluge locally. (*the* `"` *should remain*)
|
||||
- `deluge_password` => Your Deluge WebUI `Password`. (*the* `"` *should remain*)
|
||||
- `check_fs` => If set to `True`, it will check for the file on the cache drive before pausing.
|
||||
- `cache_download_path` => The location (host path) for your cache folder (if check_fs is True)
|
||||
- `age_day_min` => Set the minimum age (days) of the torrents that you wish to move.
|
||||
- `age_day_max` => Set the maximum age (days) of the torrents that you wish to move.
|
||||
|
||||
!!! warning ""
|
||||
Depending on whether you use the unRAID `Mover Tuning` app, you may need to change **line 164**:
|
||||
|
||||
- If you do not use `Mover Tuning`, you **DO NOT** have to make any changes.
|
||||
- If you use `Mover Tuning` but **don't** want to use it for the script, change **line 164** from `system('/usr/local/sbin/mover start')` to `system('/usr/local/sbin/mover.old start')`
|
||||
- If you use `Mover Tuning` and **DO** want to use it for the script, you will not have to make any changes. However, for this option, inside the `Mover Tuner` you will need to set `Move Now button follows plugin filters` to `Yes` and `Disable Mover running on a schedule` to `No`.
|
||||
|
||||
#### Copy the script to your preferred location
|
||||
|
||||
Place the script you just edited somewhere easy to access/remember.
|
||||
|
||||
Suggestions:
|
||||
|
||||
- `/mnt/user/appdata/deluge/scripts/deluge-mover.py`
|
||||
- `/mnt/user/data/scripts/deluge-mover.py`
|
||||
|
||||
#### Final steps
|
||||
|
||||
Set up the scheduler for when the mover should run.
|
||||
|
||||
In your unRAID Dashboard, go to your `Settings` tab and select `User Scripts` in the `User Utilities` section at the bottom.
|
||||
|
||||
![!User Scripts](images/Unraid-settings-user-scripts-icon.png)
|
||||
|
||||
At the bottom of the `User Scripts` page select the `ADD NEW SCRIPT` button.
|
||||
|
||||
![!Add New Script](images/Unraid-user-scripts-add-new-script-icon.png)
|
||||
|
||||
A popup will appear asking you to name the script. For this example, we're going to use `deluge-mover` and then click on `OK`.
|
||||
|
||||
![!Deluge Mover](images/Unraid-user-scripts-add-new-script-enter-name-deluge.png)
|
||||
|
||||
Click on the cogwheel of the new script in the list.
|
||||
|
||||
![!Select user script](images/Unraid-settings-user-scripts-edit-deluge-mover.png)
|
||||
|
||||
Copy/Paste the following in the new window that opens, then click `SAVE CHANGES`.
|
||||
=== "Python (Native)"
|
||||
|
||||
``` bash
|
||||
#!/bin/bash
|
||||
/usr/local/emhttp/plugins/dynamix/scripts/notify -s "Deluge Mover" -d "Deluge Mover starting @ `date +%H:%M:%S`."
|
||||
echo "executing script to pause torrents and run mover."
|
||||
python3 /mnt/user/data/scripts/deluge-mover.py
|
||||
echo "deluge-mover completed and resumed all paused torrents."
|
||||
/usr/local/emhttp/plugins/dynamix/scripts/notify -s "Deluge Mover" -d "Deluge Mover completed @ `date +%H:%M:%S`."
|
||||
```
|
||||
|
||||
=== "Python (venv)"
|
||||
|
||||
``` bash
|
||||
#!/bin/bash
|
||||
/usr/local/emhttp/plugins/dynamix/scripts/notify -s "Deluge Mover" -d "Deluge Mover starting @ `date +%H:%M:%S`."
|
||||
echo "executing script to pause torrents and run mover."
|
||||
/mnt/user/data/scripts/venv/bin/python3 /mnt/user/data/scripts/deluge-mover.py
|
||||
echo "deluge-mover completed and resumed all paused torrents."
|
||||
/usr/local/emhttp/plugins/dynamix/scripts/notify -s "Deluge Mover" -d "Deluge Mover completed @ `date +%H:%M:%S`."
|
||||
```
|
||||
|
||||
!!! info
|
||||
Replace `/mnt/user/data/scripts/` in the script with the path you have chosen for the Python script.
|
||||
|
||||
![!Bash script](images/Unraid-settings-user-scripts-deluge-mover.png)
|
||||
|
||||
Click the schedule dropdown to choose when the script should run. We want to select `Custom`.
|
||||
|
||||
![!Set Run Time](images/Unraid-settings-user-scripts-deluge-mover-schedule.png)
|
||||
|
||||
After changing to `Custom` you will get an extra text field on the right where you can set your schedule (cron).
|
||||
|
||||
For this example, we're going to tell the script to run every day at 4 AM.
|
||||
|
||||
`0 4 * * *`
|
||||
|
||||
You can generate your scheduling [HERE](https://crontab.guru/)
|
||||
|
||||
![!Set Run Time](images/Unraid-settings-user-scripts-deluge-mover-cron.png)
|
||||
|
||||
{! include-markdown "../../../../includes/support.md" !}
|
||||
|
||||
<!-- --8<-- "includes/support.md" -->
|
After Width: | Height: | Size: 124 KiB |
After Width: | Height: | Size: 975 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 201 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 946 KiB |
After Width: | Height: | Size: 472 KiB |
After Width: | Height: | Size: 334 KiB |
After Width: | Height: | Size: 341 KiB |
After Width: | Height: | Size: 22 KiB |