QBitTorrent

From Bitpost wiki

qBitTorrent is a complete system for mananging torrents. It has server, web, and client components.

I run qBitTorrent-nox, which includes server and web components. I don't need the client app (err, why not though if it doesn't hurt?)

Usage

LAN site

To watch a new tv show:

  • Add watched folder to qB web ui (NOTE: qbt will restart on next cronjob)
  • subscribe to rss

Configuration

Many important settings are available to be set in the qB web ui. Hit the gear icon in the toolbar.

Configure emails to be sent on download

Within qB web ui:

[x] email notification upon dl completion
From: [email protected]
To: [email protected]
SMTP server: smtp.gmail.com
[x] SSL [x] authentication
    u/p (see private)

Within gmail:

  • set up a (from: smtp.bitpost.com, subject: qBittorrent) filter to move/apply label Feed/devops/downloaded
  • set up a gmail phone app notification
app > Settings > [email protected] > Manage labels > Feed/devops/downloaded > All

Config files and folders

The app is supposed to store settings in ~/.config. But it has permissions problems when running as non-root. Once you run as root, the stupid thing stores all its settings under the root [/] folder (NOT the ~root folder!). Idiots.

WARNING: when qbt saves qBittorrent.conf, it destroys the symlink, writing a hard file over it. This really sucks, because everything else respects the symlinking, like qBittorrent-data.conf, watched_folders.json. REALLY sad and inconsistent and just typical Qt fussiness and inconsistency and "i did it this way because i liked it at the moment and so what if it is deep and convoluted it works for me"...

So the bottom line is...

/.local     keep local, remember to cp this out if you need to recreate qbt environment or LOSE ALL SEEDS
/.config    saved in config repo but when qBittorrent.conf loses symlink, we need to copy it (see mh)

Details:

/.config/qBittorrent/qBittorrent.conf          saved; preferences and settings; qb clobbers symlink on save(!)
/.config/qBittorrent/watched_folders.json      saved; all our watched folders, one for movies, one for EVERY TV SHOW
/.config/qBittorrent/qBittorrent-data.conf     apparently just some stats; constantly changes, don't save
/.config/qBittorrent/rss/feeds.json            not used by me (see RSS tag in webUI)
/.config/qBittorrent/rss/storage.lock          not used by me
/.local/share/qBittorrent/BT_backup            cache of torrent files; CRITICAL DATA
/.local/share/qBittorrent/GeoDB                ?
/.local/share/qBittorrent/nova3                ?
/.local/share/qBittorrent/rss/articles         ?
/.local/share/qBittorrent/logs/qbittorrent.log the log, not very verbose; locked by qB (don't symlink)
/spiceflow/safe/data/private/qB/move.log       I created this and append each torrent move to it
/spiceflow/safe/data/private/qB/MDM_backup     I created this and set qB to copy finished torrentfiles here

Installation

Install qbittorrent.

sudo add-apt-repository -y ppa:qbittorrent-team/qbittorrent-stable
sudo apt update
sudo apt install -y qbittorrent-nox
# next we run it directly to accept license and set things up
# you can go to localhost:8080 while it is runnning, but might as well CrtlC and move on
qbittorrent-nox
Ctrl-C

Set up a service.

# set up a service, see bandit ~/config/etc/systemd... for details
# note that I set up a qbittorrent user to run the service under... 
# but that just caused a lot of permissions problems so i am not using it
sudo systemctl enable qbittorrent-nox.service

Set up cron to read rss feed regularly.

# MDM Grab torrents from RSS very often
*/5 * * * * /home/m/scripts/ubuntu/bandit/cron_getrss.sh >/dev/null

# MDM Move torrents into place every minute.
0-59 * * * * /home/m/scripts/ubuntu/bandit/cron_movetorrents.sh >/dev/null

I pushed the crontab to the config repo and stowed it.

🤠 m@bandit  [~] sudo ls -lad /var/spool/cron/crontabs/m
lrwxrwxrwx 1 root root 77 Nov  2 23:03 /var/spool/cron/crontabs/m -> ../../../../home/m/development/config/ubuntu/bandit/var/spool/cron/crontabs/m


Ensure bandit VM starts at boot; any order is fine.