Skip to main content

Serve multiple beets APIs on the same IP/port using a single command

Project description

beets-webrouter

A beets plugin to serve multiple Flask or FastAPI based beets web apps on the same server/host/port using a single command.

By running beet webrouter you can serve e.g. the beets web UI, a Subsonic API as well as the generated M3U playlists on the same host/port, each under a different path.

Installation

python3 -m pip install beets-webrouter fastapi flask uvicorn

To install the plugins that are used by the example configuration below, run:

python3 -m pip install beetstream beets-webm3u

Configuration

Enable the plugin and add a webrouter section to your beets config.yaml as follows:

plugins:
  - webrouter
  - web
  - webm3u
  - beetstream
  - aura
  - smartplaylist

webrouter:
  host: 0.0.0.0
  port: 8337
  routes:
    /:
      plugin: web
    /favicon.ico:
      plugin: webrouter.favicon
    /subsonic:
      plugin: beetstream
      config:
        never_transcode: true
    /aura:
      plugin: aura
      blueprint: aura_bp
    /m3u:
      plugin: webm3u

aura:
  page_limit: 100

webm3u:
  host: 0.0.0.0
  port: 8339
  playlist_dir: /data/playlists

Usage

Once the webrouter plugin is enabled within your beets configuration, you can run it as follows:

beet webrouter

You browse the server at http://localhost:8337.

CLI

Usage: beet webrouter [options]

Development

Run the unit tests (containerized):

make test

Run the e2e tests (containerized):

make test-e2e

To test your plugin changes manually, you can run a shell within a beets docker container as follows:

make beets-sh

A temporary beets library is written to ./data. It can be removed by calling make clean-data.

To just start the server, run:

make beets-webrouter

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

beets_webrouter-0.5.0-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

Details for the file beets_webrouter-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for beets_webrouter-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b0e802d3c3945511c043cb05b5012f3ade0664067cf1b83eba33b1b5b8e38bb
MD5 4d257f0a56efd0e85bc6141900b7928d
BLAKE2b-256 16d82789096617aa929230d379186cdb1f0a82f689c3db6b83bdc72b151ddd51

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page