Serve M3U playlists via HTTP
Project description
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
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
.
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/
: List available playlists.GET /playlists/*.m3u8[?uri-format=$url]
: Get/download a playlist. Theuri-format
parameter value is used as URI template for items within a playlist. Item attribute names prefixed with a$
can be used as placeholders, e.g.subsonic:track:$id
.$url
is a built-in placeholder.GET /audio/
: List available audio files.GET /audio/*.opus
: Download/stream an audio file.
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", "url":"afrobeat.m3u8"}],
}
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-webm3u
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for beets_webm3u-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7448274e25f52a008cf9a00bca44b038908ca6abc3d0b3d4cb2635c8a944e5b |
|
MD5 | fa80e7a1315e0d8a069347320b146214 |
|
BLAKE2b-256 | 4dc122a55d210132018b95f9cae8f71db579c720703b6d88ea90fe29d07d276f |