How to Install, Configure and Run FlexGet
FlexGet is a multipurpose automation tool for content like torrents, NZBs, podcasts, comics, series, movies, etc, and can handle different kinds of sources like RSS feeds, HTML pages, and CSV files. This allows you to integrate and create powerful automation between your downloaders, organizers, and your media servers.
This guide shows you the following:
- Install FlexGet to your service
- Create your first FlexGet configuration
Running FlexGetScheduling your FlexGet tasks- Upgrading and Removing FlexGet
Installation of FlexGet via python's virtual environment
- First, log in to your service via SSH
- For more information on how to access your seedbox's SSH, visit this guide to learn more.
- Run the following command and follow the instructions. This will install FlexGet into your service.
bash <(wget -qO- https://raw.githubusercontent.com/ultraseedbox/UltraSeedbox-Scripts/master/Flexget/flexget-install.sh)
Configuring FlexGet
Creating config.yml
- Here, we will now create your first FlexGet YAML. Start by creating FlexGet's config folder by running the following command:
mkdir -p "$HOME"/.config/flexget
cd "$HOME"/.config/flexget
- Create a config.yml with the following
nano config.yml
Refer to FlexGet Configuration for information about making your config as well as FlexGet Cookbook for some basic automation tasks that you can do with FlexGet.
To check if your config is correctly formatted and configured, you may have to douse the following commands:
flexget check
to check the config file for any errorsflexget --test execute
to test run your configuration.
In my example, whenWhen you run it the first time, it may grab and download multiple torrents. To mitigate this, run flexget execute --learn
. This will save the entries accepted so it won't download again in the future.
You may refer to FlexGet Configuration for more information about making your config as well as FlexGet Cookbook for some basic automation tasks that you can do with FlexGet.
Running FlexGet
Now, depending on your config, you can either run it using cron or FlexGet's daemon mode.
Cron
Type in your SSH window:which flexget. Take note of the output. This is the absolute path of FlexGet. Here, the absolute path is/homexx/username/bin/flexget
usbdocs@lw975:~$ which flexget
/home7/usbdocs/bin/flexget
usbdocs@lw975:~$
Then typecrontab -e.If this is your first time running this command, there would be an option asking for your text editor. Select the editor you want but I would suggest selecting1.
To set it running every minute, you may set it as* * * * *then the absolute path of FlexGet, which is/homexx/username/bin/flexget. Then, add in the arguments of FlexGet which is--cron execute.If we put it together, we get* * * * * /homexx/username/bin/flexget --cron execute
You may refer to Crontab Guru which is an quick and simple editor for cron schedule expressions.
If you don't want cron to message you whenever there's an error in FlexGet, append> /dev/null 2>&1right after execute
Save your work withCTRL + O, press ENTER thenCTRL + X
systemd/Daemon mode
For more information, please refer to FlexGet Scheduler.
Open up your FlexGet config and add the scheduler plugin before tasks
YAML config with Scheduler Plugin
schedules:
- tasks: [list, of, tasks]
schedule:
minute: X
hour: X
day: X
day_of_week: X
week: X
month: X
year: X
tasks:
test-1:
rss:
url: https://rss.to/any/f4lt3r-h4h4
all_entries: no
regexp:
accept:
- .*1080p.*
deluge:
host: 127.0.0.1
port: 11123
username: xan
password: somepassword
label: flexget
Say you want to run test-1 at 22:05, 22:45, 23:05, 23:45 every day and test-2 every minute, you'll set it as it is belowTake note that the scheduler plugin also supports cron expressions.
schedules:
- tasks: [test-1]
schedule:
minute: 5,45
hour: 22,23
- tasks: [test-2]
interval:
minute: 1
tasks:
test-1:
rss:
url: https://rss.to/any/f4lt3r-h4h4
all_entries: no
regexp:
accept:
- .*1080p.*
deluge:
host: 127.0.0.1
port: 11123
username: xan
password: somepassword
label: flexget
test-2:
rss:
url: https://rss.to/any/s4h3rz-d1cz
all_entries: no
regexp:
accept:
- .*2160p.*
deluge:
host: 127.0.0.1
port: 11123
username: xan
password: somepassword
label: flexget
Save your work with CTRL + O, press ENTER then CTRL + XThen navigate to/homexx/username/.config/systemd/user/by typingcd /homexx/username/.config/systemd/user/Create a service file (nano flexget-daemon.service) and add the following:
[Unit]
Description=FlexGet Daemon
[Service]
Type=simple
ExecStart=/homexx/xxxxx/bin/flexget daemon start
ExecStop=/homexx/xxxxx/bin/flexget daemon stop
ExecReload=/homexx/xxxxx/bin/flexget daemon reload
[Install]
WantedBy=default.target
Save your work with CTRL + O, press ENTER, then CTRL + XRunsystemctl --user daemon-reloadRunsystemctl --user enable --now flexget-daemon.serviceto immediately start the daemon and to automatically restart whenever the daemon crashed or if there's a server restartTo check if the daemon is running, runflexget daemon status
Upgrading FlexGet
- To upgrade FlexGet, just run the following command:
"$HOME"/flexget/bin/python -m pip install flexget --upgrade
Removing FlexGet
- To remove FlexGet, delete the
flexget
folder and your symbolic link.
rm -rfv "$HOME"/flexget
rm "$HOME"/bin/flexget