https://github.com/coolcodersj/sync-liked
https://github.com/coolcodersj/sync-liked
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/coolcodersj/sync-liked
- Owner: CoolCoderSJ
- Created: 2024-11-09T22:21:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-10T04:46:32.000Z (over 1 year ago)
- Last Synced: 2025-01-16T00:57:40.098Z (over 1 year ago)
- Language: Ruby
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sync Liked Songs
This project synchronizes your liked songs on Spotify to a playlist. It uses Sinatra for the web server, MongoDB for storing access tokens, and Rufus-Scheduler for periodic synchronization.
## Prerequisites
- Docker
- Docker Compose
## Setup
1. Clone the repository:
```sh
git clone https://github.com/CoolCoderSJ/sync-liked.git
cd sync-liked
```
2. Update the `docker-compose.yml` file to include your Spotify credentials:
```yaml
version: '3'
services:
app:
environment:
- SPOTIFY_CLIENT_ID=your_spotify_client_id
- SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
- BASE_URL=your_base_url
- MONGODB_URI=mongodb://root@example:db:27017/sync-liked?authSource=admin
```
3. Start the services using Docker Compose:
```sh
docker-compose up -d
```
## Usage
1. Open your browser and navigate to `http://localhost:9373`. You will be redirected to Spotify for authorization.
2. After authorizing, your liked songs will be synchronized to a playlist every hour.
If you wish to stop syncing for just your user, visit `http://localhost:9373/stop` to remove your information from the database. NOTE: Deleting a playlist will not stop the service. However, if you do accidentally delete the playlist, there is latency in the service, so it will take a few hours to recreate the playlist. It is best to visit `/stop` then `/` to reset.
## Stopping the Service
To stop the service, run:
```sh
docker-compose down
```