https://github.com/giof71/upnp-scrobbler
Scrobble to last.fm from your WiiM device
https://github.com/giof71/upnp-scrobbler
lastfm scrobbler upnp wiim
Last synced: 6 months ago
JSON representation
Scrobble to last.fm from your WiiM device
- Host: GitHub
- URL: https://github.com/giof71/upnp-scrobbler
- Owner: GioF71
- Created: 2024-03-26T14:59:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-28T21:59:56.000Z (6 months ago)
- Last Synced: 2024-11-28T22:32:12.971Z (6 months ago)
- Topics: lastfm, scrobbler, upnp, wiim
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UPnP Scrobbler
A simple LAST.fm scrobbler for WiiM devices.
## References
I started taking the code published in [this post](https://forum.wiimhome.com/threads/last-fm.3144/post-44653) as the starting point.
It seems that I cannot get a valid link to the user profile on that board, but anyway the nickname is `cc_rider`.
A big thank you goes to him/her for the code he/she shared.
I then used [pylast](https://github.com/pylast/pylast), as suggested in that thread, for the actual operations on [last.fm](https://www.last.fm/).## Links
REPOSITORY TYPE|LINK
:---|:---
Git Repository|[GitHub](https://github.com/GioF71/upnp-scrobbler)
Docker Images|[Docker Hub](https://hub.docker.com/repository/docker/giof71/upnp-scrobbler)## Task List
- [x] Scrobbling to last.fm from a WiiM device, using Tidal Connect
- [x] Scrobbling to last.fm from a WiiM device, using it as a generic UPnP Renderer
- [ ] Scrobbling to last.fm from gmrenderer-resurrect ([Source](https://github.com/hzeller/gmrender-resurrect) and [Docker image](https://github.com/gioF71/gmrender-resurrect-docker)), using it as a generic UPnP Renderer
- [ ] Scrobbling to libre.fm## Build
You can build the docker image by typing:
```text
docker build . -t giof71/upnp-scrobbler
```## Configuration
### Create your API key and secret
Open your browser at [this](https://www.last.fm/api/account/create), follow the instruction and accurately store the generated values.
Those will be needed for the configuration.### Environment Variables
NAME|DESCRIPTION
:---|:---
DEVICE_URL|Device URL of your UPnP Device (example: `http://192.168.1.7:49152/description.xml`)
LAST_FM_API_KEY|Your LAST.fm api key
LAST_FM_SHARED_SECRET|Your LAST.fm api key
LAST_FM_USERNAME|Your LAST.fm account username
LAST_FM_PASSWORD_HASH|Your LAST.fm account password encoded using md5
LAST_FM_PASSWORD|Your LAST.fm account password in clear text, used when LAST_FM_PASSWORD_HASH is not provided
ENABLE_NOW_PLAYING|Update `now playing` information if set to `yes` (default)
DURATION_THRESHOLD|Minimum duration required from scrobbling (unless at least half of the duration has elapsed), defaults to `240`## Running
The preferred way of running this application is through Docker.
### Sample compose file
Here is a simple compose file, valid for a WiiM device:
```text
---
version: "3"services:
scrobbler:
image: giof71/upnp-scrobbler:latest
container_name: wiim-scrobbler
network_mode: host
environment:
- DEVICE_URL=http://192.168.1.7:49152/description.xml
- LAST_FM_API_KEY=your-lastfm-api-key
- LAST_FM_SHARED_SECRET=your-lastfm-api-secret
- LAST_FM_USERNAME=your-lastfm-username
- LAST_FM_PASSWORD_HASH=your-lastfm-md5-hashed-password
restart: unless-stopped
```It is advisable to put the variable values in a .env file in the same directory with this `docker-compose.yaml` file.
Start the container with the following:`docker-compose up -d`
## Change history
DATE|DESCRIPTION
:---|:---
2024-11-29|Improved general reliability and management of duration
2024-11-28|Fixed parsing of duration
2024-03-26|Initial release