Giter Site home page Giter Site logo

butlarr's Introduction

Butlarr

Your personal butler for all your arr needs

Why use Butlarr

Butlarr is a telegram bot that allows the interaction of multiple people with arr instances. It allows the addition and managment of movies, series, and more to come.

Butlarr has been created with hackability and base-compatibility in mind. If you have a service that behaves logically the same as Sonarr or Radarr it will be compatible with Butlarr. Even if it is not compatible, it is relatively simple to extend the exesting code base for various other services.

Usage

After following the Setup and Configuration, ensure that the bot is running. If not you can start it using: python -m butlarr from the repository directory. Open the telegram chat to the bot and authorize yourself using your previously set AUTH_PASSWORD:

/auth <A_SECURE_PASSWORD>

Show a basic help page using /help To add a movie for example, you could send /movie Alvin

image image

Installation

Setup

Quick Setup

  1. First clone the repository and cd into it

    git clone [email protected]:TrimVis/butlarr.git && cd butlarr
  2. Run start script

    ./scripts/start_linux.sh

This will do steps 2, 3 and 5 of the Manual Setup.

Manual Setup

  1. First clone the repository and cd into it

    git clone [email protected]:TrimVis/butlarr.git && cd butlarr
  2. (Optional) Create a new venv & source it

    python -m venv venv && source venv/bin/activate
  3. Install dependencies

    python -m venv venv && source venv/bin/activate
  4. Configure butlarr (see Configuration)

  5. Start the service

python -m butlarr

Configuration

Automatic Configuration

There is an automatic setup helper available. You can run it by executing the ./scripts/autosetup_linux.sh file from the repository directory.

Manual Configuration

After cloning the repository and cding into the repository, create a new file at butlarr/config/secrets.py. Paste and adapt the following template secrets.py:

TELEGRAM_TOKEN = "<YOUR_TELEGRAM_TOKEN>"
AUTH_PASSWORD = "<A_SECURE_PASSWORD>"

APIS = {
    "movie": ("http://localhost:7878/", "<RADARR_API_KEY>"),
    "series": ("http://localhost:8989/", "<SONARR_API_KEY>"),
}

You will also have to add service instances, create a new file at butlarr/config/services.py. Paste and adapt the following template services.py:

from .secrets import APIS

from ..services.radarr import Radarr 
from ..services.sonarr import Sonarr

SERVICES = [
    Radarr(
        commands=["movie"],
        api_host=APIS.get("movie")[0],
        api_key=APIS.get("movie")[1],
    ),
    Sonarr(
        commands=["series"],
        api_host=APIS.get("series")[0],
        api_key=APIS.get("series")[1],
    ),
]

Systemd service

Create a new file under /etc/systemd/user (recommended: /etc/systemd/user/butlarr.service) The new file should have following content (you have to adapt the REPO_PATH):

[Unit]
Description      = Butlarr Telegram Bot for Arr Service Managment
After            = network.target
After            = systemd-user-sessions.service
After            = network-online.target

[Service]
Type              = simple
WorkingDirectory  = <REPO_PATH>
ExecStart         = /bin/bash -c 'source venv/bin/activate; python -m butlarr'
ExecReload        = /bin/kill -s HUP $MAINPID
KillMode          = mixed
TimeoutStopSec    = 300
Restart           = always
RestartSec        = 60
SyslogIdentifier  = butlar

[Install]
WantedBy         = multi-user.target

You can find a template at: templates/butlarr.service

Start it using: systemctl --user start butlarr Enable it to start on reboots using: systemctl --user enable butlarr

Open TODOs

  • Create docker instructions
  • Create a pip package

butlarr's People

Contributors

trimvis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.