This project is a Python script that integrates Plex Media Server with Last.fm, allowing you to scrobble your music plays from Plex to your Last.fm account using the "Scrobbling now" feature that is missing from official Plex LastFm integration.
- Connects to Plex Media Server
- Authenticates with Last.fm
- Updates "Now Playing" status on Last.fm when a track starts playing on Plex
- Handles play, pause, and resume events from Plex
- Python 3.6+
- Plex Media Server
- Last.fm account
- Plex Webhook configured to send events to this script
- Clone this repository:
git clone https://github.com/ozyz/plex-lastfm-scrobbler.git
cd plex-lastfm-scrobbler
- Install the required packages:
pip install -r requirements.txt
- Create a
.env
file in the project root and add your configuration:
PLEX_URL=http://your-plex-server:32400
PLEX_TOKEN=your-plex-x-token
LASTFM_API_KEY=your-lastfm-api-key
LASTFM_API_SECRET=your-lastfm-api-secret
-
Run the script:
python plex_lastfm_scrobbler.py
-
The script will prompt you to authorize the application with Last.fm if it's the first time running.
-
Configure your Plex Media Server to send webhooks to
http://your-ip:5000/webhook
-
Play music on Plex, and it should now scrobble to Last.fm
This project is licensed under the MIT License.