When Apple designated iTunes as end-of-life in favor Music.app (centered around a subscription service), I had approximately 60 GB of music files in a variety of formats. I knew that I would need to find a new way to manage them, something similar to the old, non-cloud-based iTunes. This is that program.
-
Clone this repository with the following command: -
git clone https://github.com/thisisrobertr/webstereo -
Create a Python virtual environment with the following commands (this step is technically optional, but makes some things easier to troubleshoot and keeps the system Python environment spare and organized.
python3 -m venv venv/source venv/bin/activate -
Install Dependencies
-
The following python modules are required: flask and waitress (undergirding the web app), pbkdf2 (password hashing), and mutagen (for processing audio metadata).
-
WebStereo has one other main external dependency:
ffmpeg, withffplayincluded. To get theffplaycommand, I had to build ffmpeg from source - the Homebrew package did not include it. If you choose to install from source, be advised thatmakewill silently fail to compile theffplaycomponent of the package unless you have sdl2 installed.
-
-
Configure WebStereo.
- There are two main ways WebStereo can be configured: editing config.json directly, and using the command-line options of data.py. For the first method, run data.py with -c to generate a file with the default parameters, and open the new config.json in an editor. For the second, run
data.py -hto view the available commands. - NB that on recent versions of macOS, the directory shown in Finder as "Media" is actually called "Media.localized" in the file system. MacOS 10.14 Mojave doesn't do this, 14.4 Sonoma does. I'm not sure when exactly the change was made.
- There are two main ways WebStereo can be configured: editing config.json directly, and using the command-line options of data.py. For the first method, run data.py with -c to generate a file with the default parameters, and open the new config.json in an editor. For the second, run
-
Build the Music Database
-
Once you have specified the location of your music library in config.json, run
python3 data.py -b -ato add your albums to the WebStereo library. -
The first versions of WebStereo were used on an existing iTunes media library, and the code for building the library database was very much written for that environment: it expects that you have folders for each artist, inside of which there is a folder for each album containing the audio files for each song. Files outside of this directory structure will not be included.
-
-
Run WebStereo.
-
Run
python3 webstereo.pyor deploy it to your server configuration -
Open the application in a web browser. By default, its URL is localhost:8000. NB that by default, it listens only on localhost - to use it across a LAN, you will need to set the host in config.json to 0.0.0.0
-
-
Webstereo supports using a password for authentication but not a username; it is very much designed for a single-user environment.
-
At present, supported audio formats include the following: AAC/M4A, MP3, AIFF/AIFC, FLAC, WAVE, and OGG. If possible, metadata will be extracted from the files, otherwise file/folder names and such will be used to guess at title, artist, album, and track number.
-
Currently, there is no built-in mechanism for importing new audio; adding songs means modifying the filesystem and rebuilding the entire database.
-
Despite my best efforts to date, WebStereo has not moved beyond its origins as a tool I wrote to fulfill a personal need - there are still several missing features and imperfections in it. Please take it in that context. Eventually, I joined the herd on Spotify, and development on this program has by and large stopped.