QBitTorrent

From Bitpost wiki
Revision as of 22:41, 2 November 2022 by M (talk | contribs) (→‎Installation)

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:

ssh bandit
cdtv
mkdir "My Show"
# add watched folder to qB web ui
# 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: smtp.bitpost@gmail.com
To: m@bitpost.com
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 > thedigitalmachine@gmail.com > 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.

I set up all these so they are stowed. Yes, even the god damned .local folder, which has logs and all kind of shit, because it ALSO has all the currently active torrents. Moh rons. On occasion, I suppose i should go to bandit and push all this shit...

/.config/qBittorrent/qBittorrent.conf          preferences and settings
/.config/qBittorrent/watched_folders.json      all our watched folders, one for movies, one for EVERY TV SHOW
/.local/share/qBittorrent/logs/qbittorrent.log the log, not very verbose
/.local/share/qBittorrent/BT_backup            cache of torrent files
/.local/share/qBittorrent/MDM_backup           I created this and set qB to copy finished torrentfiles here
/.local/share/qBittorrent/logs/move.log        I created this and append each torrent move to it
/.config/qBittorrent/qBittorrent-data.conf     apparently just some stats
/.config/qBittorrent/rss/feeds.json
/.config/qBittorrent/rss/storage.lock
/.local/share/qBittorrent/GeoDB
/.local/share/qBittorrent/nova3
/.local/share/qBittorrent/rss/articles

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

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