This is an old revision of the document!
Prev to: LazyLibrarian: another books and audiobooks organizer
Next to: Torrenting
Bazarr: subtitles downloader & finder
Bazarr is a tool which can search for, download and organize subtitles for all your media. By interfacing with one or more subtitles providers, Bazarr will scan your media libraries and update the subtitles for the languages you want.
Installation
Bazarr must be installed manually since there is no Gentoo ebuild for it, but it's pretty easy with pip.
As usual, you need to create a specific user and set it's home folder to /data/daemons/bazarr and set media as it's main group:
> useradd -d /data/daemons/bazarr -g media -m bazarr
Using pip directly is discouraged on Gentoo because it can severely break your system. To use pip on Gentoo you need to explicitly enable it for the bazarr user by creating the file /data/daemons/bazarr/.config/pip/pip.conf with this content:
- pip.conf
[global] break-system-packages = true user = true
Now adapt the bazarr umnask so that any files moved by it will be accessible by the other tools (where needed). Add the following line at the end of /data/daemons/bazarr/.bashrc:
umask 0002
You can now become the bazarr user and proceed with the installation:
> su - bazar > wget https://github.com/morpheus65535/bazarr/releases/latest/download/bazarr.zip > unzip bazarr.zip > rm bazarr.zip > python -m pip install -r requirements.txt
As last step, you need a startup script called /data/daemons/bazarr/bazarr.sh, so create it with the following content:
- lazylibrarian.sh
#!/bin/bash cd /data/daemons/bazarr python bazarr.py
You also want a script to automatically start it at boot, so create the file /etc/local.d/80-bazarr.start with the following content:
- bazarr.start
#!/bin/bash start-stop-daemon -b -m -p /var/run/bazarr.pid -n bazarr -u bazarr /data/daemons/bazarr/bazarr.sh
and make them both executable:
> chmod +x /data/daemons/bazarr/bazarr.sh > chmod +x /etc/local.d/80-bazarr.start
That's it, Bazarr is installed, but you will need to configure it before starting.
Reverse-Proxy configuration
Before you proceed, you should make Bazarr accessible via the reverse-proxy, so that access, configuration and usage will be simplified from the beginning. Add this file to /etc/nginx/folders:
- bazarr.conf
location /bazarr/ { proxy_pass http://127.0.0.1:6767/bazarr/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_redirect off; # Allow the Bazarr API through if you enable Auth on the block above location /bazarr/api { auth_pam off; proxy_pass http://127.0.0.1:6767/bazarr/api; } }
Add it to your /etc/nginx/folders/main.conf:
include "folders/bazarr.conf";
and restart nginx:
> /etc/init.d/nginx restart
Startup
Before starting Bazarr you need to fine-tune the default /data/daemons/bazarr/data/config/config.yaml, set the following lines:
... base_url: /bazarr chmod: '0664' ip: 127.0.0.1 ...
You need to set the base_url to match the reverse proxy setting and you want to ensure new files by Bazarr are created as readable and writable by the media group (so, 0664) for them to be accessible in your media collection. You also want to bind to IP 127.0.0.1 for security reasons.
Now you can head to the Bazarr URL (http://192.168.0.1/bazarr) with your browser and access the Bazarr web GUI, from you which you need to fill up the Sonarr and Radarr sections. Put in your Sonarr and Radarr base URL's (/sonarr and /radarr if you configured everything correctly before) and put also in the respective API keys, that you will find in the Sonarr and Radarr web GUI configuration pages. You will also need to go to the languages section and setup at least one language you want your subtitles.
Then it's time to setup some providers: you can do so from the Providers configuration page. You will need at least one.
Go ahead and continue configuring anything else you might want to setup.
All set! Bazarr is running.
Now, head on to figuring out how to find something to download in your media collection…
Next to: Torrenting
Prev to: LazyLibrarian: another books and audiobooks organizer