This is a program that uses the Spinitron and Last.fm APIs to take live songs from a radio station on Spinitron and "scrobble" it to a Last.fm account. I wrote this primarily to scrobble songs played on WKNC to the station's Last.fm account. However, by using your own .env variables, the script can be used for other Spinitron stations and Last.fm accounts.
You will need a Last.fm account and API application. If you have an account, you can create an API app here. For more information on authentication with the Last.fm API, look here.
You will also need admin access to the Spinitron web app for your station. If you do not have admin access yourself, you will need to contact an admin for your station and get their permission to use the API key for your app.
Python >=3.11: https://www.python.org/
.env file with the following values:
- LASTFM_API_KEY: Found on your Last.fm API accounts page under "API Key"
- LASTFM_API_SECRET: Found on your Last.fm API accounts page under "Shared Secret"
- SPINITRON_API_KEY: Found on the Spinitron automation and API page under "API Key"
- Clone the project from the repository
- Navigate to cloned folder in a terminal
- Execute 'pip install -r requirements.txt' to install packages
- Execute 'python scrobbler.py --setup'
- When prompted, authorize the application while logged into your Last.fm account, using the link provided
These steps are for after you have gone through the installation process and established a session key (using the --setup flag).
Any time you are listening to the radio station associated with your Spinitron account and want to scrobble what you are listening to, simply:
- Navigate to the project folder in a terminal
- Execute 'python scrobbler.py'
- Once you have finished listening, terminate the program