Skip to main content

beets based mitm of your torrent client and music player

Project description

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.

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.2.3.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: betanin-0.2.3.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for betanin-0.2.3.tar.gz
Algorithm Hash digest
SHA256 178df91767644be8a8bac4d02546a44e03f31e5c308e9f3d24fcd5b0035e9c05
MD5 546ca69d4f615be6c8dc4f8842e5d9f2
BLAKE2b-256 5ad5eeb3d8e5071991cfba024a33283892dc142dc74e78fed2e8e93c1b8107d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: betanin-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for betanin-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 56dbadba4da9ac27fcac2a699da7d9d9200c531f257b828fe324605effcec95d
MD5 be2487aed01c7f93b277f3f32eca475a
BLAKE2b-256 1b3d0888ad9afddd569215725ba865b6119bf632692766edd6662c6a513fd260

See more details on using hashes here.

Supported by

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