Skip to main content

beets-webm3u

A beets plugin to serve M3U playlists via HTTP.

Features

  • Allows to access M3U playlists (generated by the smartplaylist plugin) via HTTP.
  • Rewrites playlist item URIs to be accessible via HTTP, allowing to maintain a single set of playlists with local paths instead of having to generate each playlist with multiple URI formats (one per client/integration) upfront.

Installation

python3 -m pip install beets-webm3u

Configuration

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

plugins:
  - webm3u

webm3u:
  host: '127.0.0.1'
  port: 8339
  cors: ''
  cors_supports_credentials: false
  reverse_proxy: false
  include_paths: false
  # Can be omitted when smartplaylist plugin is configured:
  playlist_dir: /data/playlists

Usage

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

beet webm3u

You can browse the server at http://localhost:8339.

To serve multiple beets web APIs using a single process, you can use the webrouter plugin.

CLI

Usage: beet webm3u [options]

Options:
  -h, --help   show this help message and exit
  -d, --debug  debug mode

Web API

The following endpoints allow listing and downloading playlist as well as audio files:

  • GET /playlists/index.m3u[?uri-format=$url]: Returns the playlist of playlists.
  • GET /playlists/: List available playlists.
  • GET /playlists/*.m3u[?uri-format=$url]: Get/download a playlist.
  • GET /audio/: List available audio files.
  • GET /audio/*.opus: Download/stream an audio file.

The uri-format parameter allows specifying a playlist item URI template. Item field names prefixed with a $ can be used as placeholders, e.g. beets:library:track;$id or subidy:song:3$id. $url is a built-in placeholder and the default value.

The list endpoints return either a JSON or HTML response, supporting content type negotiation. A JSON response body looks as follows:

{
	"directories": [{"name":"some-dir"}],
	"files": [{"name":"afrobeat", "path":"afrobeat.m3u"}],
}

Development

The following assumes you have docker installed.

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-webm3u

Metadata

Release files for beets-webm3u 0.6.5

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

Built distribution (wheel)

Table of built distributions (wheels) for beets-webm3u 0.6.5
File Interpreter ABI Platform
beets_webm3u-0.6.5-py3-none-any.whl Python 3 none any Details

Release files / beets_webm3u-0.6.5-py3-none-any.whl

Download URL beets_webm3u-0.6.5-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c286aceed8f3495ef9faa3270feac46a994ecbe50d3b7aa381ae6c33ff697ebb
BLAKE2b-256 checksum
How to use checksums
157a7ab42d91668ebce9c391ab27805e1768b54f56678297a480bcfc132bce92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 17, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.5 This release

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

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