Songbird is a tool that allows users to create smart playlists in Spotify. Smart playlists will automatically update themselves according to certain presets / configurations / listening habits, just continue adding new songs into your library and they'll be automatically synced to your playlists when Songbird runs.
Some examples of smart playlists:
- Top Tracks (based on what you have been listening recently)
- Tracks from the 90s
- Tracks from a certain artist
- Tracks belonging to a certain genre
Songbird was initially hosted at https://getsongbird.io, but I took it down because it required some maintenance and costed ~$10 monthly for hosting, but couldn't become self-sustaining.
Unfortunately for me, the constant stream of emails from users guilt tripped me enough to extract out the important parts into this standalone version.
Donate here
Donations are very welcome and will incentivize me to actually work on improving this project. Here are some milestones I temporarily set as goals for this project. Send an email to [email protected] with a proof of donation and I'll include your logo / name / whatever.
- $2 - Create standalone version of songbird and open source it
- $50 - Make me regain faith in humanity and working on side projects
- $100 - Guilt trip me enough to work on fixing bugs more frequently / adding some features (e.g. new filters)
- $500 - $500 is enough to cover the server costs for a few years. If we come to this I will polish the code enough and host it again
- $1000 - The servers will go online for at least 5 years! By then I probably already forgot about its existence and how it's eating into my bank account every month
Minimal programming experience is required to run this, just google around if you're having trouble with running this
- Clone this awesome repo
git clone [email protected]:zweicoder/songbird.git
-
Install Docker and docker-compose
-
Go to https://developer.spotify.com/dashboard/login, sign up and create a project
-
In Spotify's dashboard page, click on
Edit Settings
and addlocalhost:8888/callback
toRedirect URIs
-
Copy the client ID and client secret from the dashboard
- Paste the above into
/etc/songbird/secrets.env
, it should look like this:
CLIENT_ID=<copy this from the dashboard>
CLIENT_SECRET=<copy this from the dashboard>
- Pat yourself on the back, you're all set! (and if not, I suggest you complain loudly!)
./scripts/start_webserver.sh
Note: If you get some permission error trying to run this script, run chmod +x ./scripts/*
_
This creates:
- web server at localhost:3000
- api server at localhost:8888
- postgres db at localhost:5444
- binds postgres_volume as a Docker volume for postgres db
After starting these services, go to http://localhost:3000 and save your smart playlists.
Once you have smart playlists in the database, you can sync it manually any time with:
./scripts/sync.sh
Since we're all lazy people, we can create a cronjob that keeps running ./scripts/cron_entrypoint.sh
.
Edit crontab with:
crontab -e
For example, a crontab with:
# m h dom mon dow command
0 22 * * * (cd <path/to/songbird> && ./scripts/cron_entrypoint.sh)
will sync every day on 10:00pm. Make sure your computer is on at that time!
Contributions are very welcome and will make this tool more awesome for everyone!
This project contains of mainly these modules:
- Spotify Service
- Frontend
- Backend
- Playlist Manager / Syncer
Spotify service handles everything related to Spotify, as well as the creation of tracks, building of custom playlists.
Due to incompatibilities of ES6 modules with webpack uglify, we use Babel to to build the files for frontend consumption.
npm i
npm run watch
The backend runs as a docker-compose
service with a Postgres database and express
server with an API for OAuth and a few endpoints for managing user playlists.
Make sure .env
exists under server/
folder and
npm i
npm start
Migrations is currently done via migrate, with additional data migration logic in .js
files (e.g. inflate columns that need default values based on another column).
migrate create -ext sql -dir migrations/ <migration_name>
migrate -path ./migrations -database 'postgres://postgres:postgres@localhost?sslmode=disable' up 1
Frontend is pretty standard.
npm start
Email your feedback to [email protected] :)