A beets plugin to search tracks and save the result as playlists via HTTP.
- Provides a JSON REST API to search tracks.
- Allows to save searches as playlists.
python3 -m pip install beets-websearchEnable the plugin and add a websearch section to your beets config.yaml as follows:
plugins:
- websearch
websearch
host: '127.0.0.1'
port: 5000Once the websearch plugin is enabled within your beets configuration, you can run it as follows:
beet websearchYou can browse the server at http://127.0.0.1:5000.
To serve multiple beets web APIs using a single process, you can use the webrouter plugin.
Usage: beet websearch [options]
Options:
-h, --help show this help message and exit
-d, --debug debug mode
See OpenAPI definition.
The following assumes you have docker installed.
In case you make changes to the openapi.yaml, you can validate them as follows:
make validate-openapiGenerate the server stub from the openapi.yaml (containerized):
make generateRun the unit tests (containerized):
make testRun the e2e tests (containerized):
make test-e2eTo test your plugin changes manually, you can run a shell within a beets docker container as follows:
make beets-shA temporary beets library is written to ./data.
It can be removed by calling make clean-data.
To download example data, run:
make example-dataTo just start the server, run:
make beets-websearchNow you can browse the executable API documentation at http://127.0.0.1:5000/docs.
Example API call to search tracks: http://127.0.0.1:5000/tracks?query={%22artist%22:{%22contains%22:%20%22dengue%22},%22title%22:{%22contains%22:%22serpiente%22}}.