Nova Boop is an application designed to crawl the Radio Nova history every 30 minutes and upload the found tracks to a specified Spotify playlist. It's based on Puppeteer. My spotify playlist is currently private because of Spotify policies.
Before installing Nova Boop, ensure you have the following prerequisites met:
- Node.js installed on your system
- pnpm package manager installed
- Access to a Redis instance
- A Spotify playlist where tracks will be uploaded
- A Spotify access token for the playlist (See the Spotify access token section below for details)
To install the required node modules for Nova Boop, run the following command:
pnpm install
Create a .env
file at the root directory of your project and include the following environment variables:
APP_STAGE=dev
SPOTIFY_ID=your_spotify_id
SPOTIFY_PLAYLIST=your_spotify_playlist
SPOTIFY_REFRESH_TOKEN=your_spotify_refresh_token
SPOTIFY_SECRET=your_spotify_secret
REDIS_HOST=localhost
REDIS_PORT=6379
To obtain a Spotify access token:
-
Register your application at Spotify for Developers.
-
Generate your Client ID and Client Secret from the dashboard settings.
-
Clone the Spotify web-api-examples repository:
git clone [email protected]:spotify/web-api-examples.git
-
Follow the documentation in the Spotify Authorization Code example.
-
Run the example app and navigate to
http://localhost:8888
to connect and obtain a token.
To run Nova Boop in watch mode (with the debugger listening on port 9999
), execute:
pnpm start:dev
If necessary, attach a debugger by using the Debug
configuration in .vscode/launch.json
.
- Radio Nova's "load more" functionality can sometimes skip tracks. To adjust, modify the
wait(milliseconds)
values inside the NovaJob. - Spotify enforces a rate limit policy. The application has successfully scraped up to 3000 tracks without exceeding the quotas, which is about 6000 requests. If you attempt to scrape more tracks, you may reach limitations. For more information, see Rate Limits.
- Spotify servers can sometimes be unreliable. To mitigate this, an in-memory playlist is used for its relatively small size and simplicity. Additionally, a basic retry mechanism on startup attempts to fetch the playlist. However, the application may fail on startup due to Spotify's server relative robustness.