This is the source code for the ultrasonics-api proxy server. It's purpose is to store private api keys for services such as Spotify, Deezer, and Last.fm, while providing an endpoint for ultrasonics to access those apis.
ultrasonics-api.There is an official hosted version at https://ultrasonics-api.herokuapp.com/api/ā . Feel free to use that instead of hosting your own version. Therefore, no setup is required, and you can get started on curating your perfect playlists. Or you can run it yourself, it's up to you š.
Just click the button below! Make sure you refer to environment variablesā .
Or do it manually š:
Follow the official instructionsā after cloning this repo. You will need to use the environment variable USE_REDIS=True and also set up a Heroku Redis instanceā .
š¤ļø This is actually a lot easier than those tutorials appear on first glance, you just need to create them both and get the correct URLs.
You can set up environment variables according to the official documentationā . See environment variablesā .
Either make the image using the Dockerfile, or pull from the official repo: XDGFX/ultrasonics-api.
Recommended usage: docker-compose
version: "3.7"
services:
ultrasonics-api:
image: xdgfx/ultrasonics-api
container_name: ultrasonics-api
restart: unless-stopped
ports:
- 8003:8003
environment:
- PUID=${PUID}
- PGID=${PGID}
- SPOTIFY_CLIENT_ID=abc
- SPOTIFY_CLIENT_SECRET=xyz
- LASTFM_API_KEY=xyz
- DEEZER_APP_ID=abc
- DEEZER_APP_SECRET=xyz
Disclaimer: I have only tested this on Linux š§. It should work fine on macOS or Windows, but some steps might be different.
python3 -m venv .venv to create an environment in the folder .venv, then activate it with source .venv/bin/activate).pip3 install -r requirements.txt.USE_REDIS = False for a cleaner install.app.sh. You may prefer to run it as a service insteadā .These environment variables can be applied to your Heroku instance, or saved in a .env file in this directory.
If you don't use a service, you can remove it's environment variables.
Most services require you to get an api key / secret by creating an account and setting up an application. Documentation for each service can be found below.
| App | Link | Notes |
|---|---|---|
| Spotify | https://developer.spotify.comā | Refer to "Set Up Your Account" and "Register Your Application". |
| Last.fm | https://www.last.fm/apiā | |
| Deezer | https://developers.deezer.com/myapps/ā |
.env fileFLASK_APP=ultrasonics_api
USE_REDIS=False
REDIS_URL=[Only if USE_REDIS=True]
SPOTIFY_CLIENT_ID=abc
SPOTIFY_CLIENT_SECRET=xyz
LASTFM_API_KEY=abc
DEEZER_APP_ID=abc
DEEZER_APP_SECRET=xyz
Content type
Image
Digest
Size
22.1 MB
Last updated
about 6 years ago
docker pull xdgfx/ultrasonics-api