Skip to main content

beets based mitm of your torrent client and music player

Project description

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

  • email
  • 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 [--port=<port>]
$ # ui will be available at port

$ # 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

/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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

betanin-0.3.16.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

betanin-0.3.16-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

Details for the file betanin-0.3.16.tar.gz.

File metadata

  • Download URL: betanin-0.3.16.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.1

File hashes

Hashes for betanin-0.3.16.tar.gz
Algorithm Hash digest
SHA256 c07c6dee7a856435b8c0f859ec2ffcbb1a3a0e13384ff8663bafd80a9849b417
MD5 68c25a9cce32c550d010e7bb3b36bd89
BLAKE2b-256 7742869463282b0cdd257b9d6a66a571129c9acd88f9aadd2986a40e574f4645

See more details on using hashes here.

File details

Details for the file betanin-0.3.16-py3-none-any.whl.

File metadata

  • Download URL: betanin-0.3.16-py3-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.1

File hashes

Hashes for betanin-0.3.16-py3-none-any.whl
Algorithm Hash digest
SHA256 d7badfb346d8fbe840b25c58775988b1e6fdbed4fcffc2de4a34652645201648
MD5 db1706010f9092b4d01ffc03d2ca7f50
BLAKE2b-256 6bd515f2506784aa754496a49d8ff1a625c47595624c8d7887221e7a3485d0ed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page