beets.io based man-in-the-middle of your torrent client and music player
workflow
notifiers
betanin uses apprise for notifications. so anything supported there will work. but some include
- discord
- telegram
- emby
installation
$ pip install --user betanin
usage
$ # start server
$ betanin
$ # a config file will be created, add your credentials to it
$ # start again
$ betanin [--host=<host>] [--port=<port>]
$ # ui will be available at port
$ # you may also use env vars instead, eg
$ BETANIN_HOST=0.0.0.0 betanin
$ BETANIN_PORT=4030 betanin
$ # optionally start cli (for db operations, debugging)
$ betanin-shell
$ # or if docker
$ docker exec -it <container_id> betanin-shell
screenshots
docker
image
docker pull sentriz/betanin
volumes /b/.local/share/betanin/ for a persistent database
/b/.config/betanin/ for a persistent betanin config
/b/.config/beets/ for a persistent beets home (point this to your
current beets home if you have one)
/music/ so beets can access your music
/downloads/ so beets can access your downloads
compose
betanin:
image: sentriz/betanin
ports:
- 9393:9393
restart: unless-stopped
environment:
- UID=1000 # (optionally) set user id
- GID=1000 # (optionally) set group id
volumes:
- ${DATA}/betanin/data:/b/.local/share/betanin/
- ${DATA}/betanin/config:/b/.config/betanin/
- ${DATA}/betanin/beets:/b/.config/beets/
- ${MEDIA}/music:/music/
- ${MEDIA}/downloads:/downloads/
transmission
create a script named done.sh or anything you like, and make it
executable:
chmod +x done.sh
settings.json (example excerpt)
...
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/scripts/done.sh",
...
done script
#!/bin/sh
curl \
--request POST \
--data-urlencode "path=<path_to_transmission_downloads>" \
--data-urlencode "name=$TR_TORRENT_NAME" \
--header "X-API-Key: <your_api_key>" \
"https://betanin.example.com/api/torrents"
transmission docker compose (excerpt)
volumes:
- ${DATA}/transmission/config:/config
- ${DATA}/transmission/scripts:/scripts
- ${MEDIA}/download:/downloads
deluge
create a script named done.sh or anything you like, and make it
executable:
chmod +x done.sh
you must also be using the
Execute plugin,
set to the Torrent Complete event
done script
#!/bin/sh
curl \
--request POST \
--data-urlencode "path=<path_to_deluge_downloads>" \
--data-urlencode "name=$2" \
--header "X-API-Key: <your_api_key>" \
"https://betanin.example.com/api/torrents"
developing
working on the backend
there is not much else to do, write your code,
python -m betanin.entry.betanin, kill it, write your code, etc. the
webserver will be available at http://localhost:9393/. the static
frontend is served at /, and the api is served at /api. (there is a
swagger ui there too) also see python -m betanin.entry.shell.
if you need to do a manual migration do
env FLASK_APP='betanin.application:create' flask db migrate --directory betanin_migrations/
(then upgrades are automatically done on betanin start)
working on the frontend
start the backend with python -m betanin.entry.betanin, but don’t use
the static frontend served at http://localhost:9393/. Instead, in a
new shell, do npm --prefix betanin_client/ run serve and use the
frontend served at http://localhost:8081/. it will look for a backend
listening on port 9393 locally. after that you can edit anything in
betanin_client/src, it will be linted and automatically reflected in
your web browser.
Release files for betanin 0.3.27
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| betanin-0.3.27.tar.gz | 2.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| betanin-0.3.27-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:5.7 MB
Release files / betanin-0.3.27.tar.gz
| Download URL | betanin-0.3.27.tar.gz |
|---|---|
| Size | 2.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fd5359e5258708183cde9b1768986df81e870e527ee84317a9de2d579d5f08d
|
|
BLAKE2b-256 checksum How to use checksums |
7aa9f24a2fb9ddaec9ea6dd463a30cc5ddae63e4807bbf9d50ae5219acfbea6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|
Release files / betanin-0.3.27-py3-none-any.whl
| Download URL | betanin-0.3.27-py3-none-any.whl |
|---|---|
| Size | 2.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f35002741b026b958457815515931ae9da6348bf654a528bd71679a2b2c247a
|
|
BLAKE2b-256 checksum How to use checksums |
94c8d650dee2a19e28e6f7c82366609a12f658711875a5f52210049e5c0bdf1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|