Skip to main content

beets based man-in-the-middle of your torrent client and music player


installation

$ pip install --user betanin

usage

$ betanin [--port=<port>]

docker

image

docker pull sentriz/betanin

volumes

/root/.local/share/betanin/ for a persistent database
/root/.config/betanin/ for a persistent betanin config
/root/.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
    volumes:
    - ${DATA}/betanin/data:/root/.local/share/betanin/
    - ${DATA}/betanin/config:/root/.config/betanin/
    - ${DATA}/betanin/beets:/root/.config/beets/
    - ${MEDIA}/music:/music/
    - ${MEDIA}/downloads:/downloads/

transmission

settings.json (example excerpt)
...
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/scripts/done",
...
done script
#!/bin/sh


curl \
    --request POST \
    --data-urlencode "path=/downloads/complete/beets" \
    --data-urlencode "name=$TR_TORRENT_NAME" \
    --user 'user:password' \
    "http://betanin:9393/api/torrents"
docker compose (excerpt)
volumes:
- ${DATA}/transmission/config:/config
- ${DATA}/transmission/scripts:/scripts
- ${MEDIA}/download:/downloads

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.

Metadata

Release files for betanin 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for betanin 0.2.0
File Size Uploaded
betanin-0.2.0.tar.gz 2.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for betanin 0.2.0
File Interpreter ABI Platform
betanin-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 MB

Release files / betanin-0.2.0.tar.gz

Download URL betanin-0.2.0.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
de6fa47f387ae0d60bfbf79f7f614289f5ebc87269dcf0f203a96e215c3e20a8
BLAKE2b-256 checksum
How to use checksums
f58049e8ebe09c8f35fd52012bbf1fcd1124adf9a1f8886476391d47b2a436d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.3

Release files / betanin-0.2.0-py3-none-any.whl

Download URL betanin-0.2.0-py3-none-any.whl
Size 6.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1b3142487cbbcc537408aaac32167051ad5d526470f5b9e492c6d135eedde4a5
BLAKE2b-256 checksum
How to use checksums
0e24ea756b41107905a0aaa05c067861b8d3a34f184e82a0b316761b5cf2face
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page