Skip to main content

plex-lastfm-scrobbler

Build Status

plex-lastfm-scrobbler provides a set of scripts that allow you to scrobble played audio items to Last.FM from the Plex Media Server application. plex-lastfm-scrobbler was built to run across platforms, though only tested on Linux.

A few points

  • plex-lastfm-scrobbler is an out of process tool. Meaning it is not a Plex Media Server plug-in. This tool runs separately of your Plex Media Server.

  • Must be run on the Plex Media Server

  • Parses Plex Media Server logs for the ‘got played’ string in the log file.

  • Does not differentiate between clients. Meaning all media played, will be scrobbled while the script is running.

  • Your plex-media-server logs must be set at DEBUG level (not VERBOSE)

Installation

Linux, OSX

It is recommended (but not required) that you install this into a virtualenvironment. This can be done as such.

virtualenv ~/.virtualenvs/plex-lastfm-scrobbler
source ~/.virtualenvs/plex-lastfm-scrobbler/bin/activate

Installing via pip or easy_install is supported. For example :pip install plex-scrobble or easy_install plex-scrobble.

If you wish to run development builds, fetch and install the source from the github repo.

git clone https://github.com/jesseward/plex-lastfm-scrobbler.git
cd plex-lastfm-scrobbler
python setup.py install
pip install -r dev_requirements.txt # for mock/testing packages.

Alternatively, you can fetch the latest zip from github

wget https://github.com/jesseward/plex-lastfm-scrobbler/archive/master.zip
unzip master.zip
cd plex-lastfm-scrobbler-master
python setup.py install

You’re done.

Configuration

Run the wizard to generate config file

plex-scrobble --wizard

The plex-lastfm-scrobbler configuration file (.plex-scrobble.toml) is installed to ~/ . The following configuration values are available.

If you’re running Plex Media Server on a Linux based operating system, things should work out of the box.

[lastfm]
# REQUIRED: You'll need to create a last.fm API application first. Do so here:
# http://www.last.fm/api/account/create
api_key = "YOUR_API_KEY"
api_secret = "YOUR_API_SECRET"
user_name = "LAST_FM_USERNAME"
password = "LAST_FM_PASSWORD"

[plex-scrobble]
# mediaserver_log_location references the log file location of the plex media server
# the default under /var/lib/... is the default install of plex media server on
# a Linux system. You may wish to change this value to reference your OS install.
# https://support.plex.tv/hc/en-us/articles/200250417-Plex-Media-Server-Log-Files
mediaserver_log_location = "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log"

# REQUIRED: Where do you wish to write the plex-scrobble log file.
log_file = "/tmp/plex-scrobble.log"

# REQUIRED: mediaserver_url is the location of the http service exposed by Plex Media Server
# the default values should be 'ok', assuming you're running the plex scrobble
# script from the same server as your plex media server
mediaserver_url = "http://localhost:32400"

# REQUIRED: a python data struture that stores failed scrobbles. plex-scrobble
# will retry on a 60 minute interval, maximum of 10 attempts if last.fm is
# experiencing issues.
cache_location = "/tmp/plex_scrobble.cache"

# OPTIONAL: plex_token defines the plex token used to get metadata
# Note: This is required if you use localhost or 127.0.0.1 and Plex Media Server >= 1.1.0
# You will know if you see a line like this your log_file:
# [plex_scrobble.plex_monitor fetch_metadata] [ERROR] urllib2 error reading from http://localhost:32400/library/metadata/48080 'HTTP Error 401: Unauthorized'
# Here is how you can obtain your token https://support.plex.tv/hc/en-us/articles/204059436-Finding-your-account-token-X-Plex-Token
plex_token = "YOUR_PLEX_TOKEN"

Running

If you installed plex-lastfm-scrobble to a virtual environment, enable the virtual env.

source ~/.virtualenvs/plex-lastfm-scrobber/bin/activate

run the application

nohup plex-scrobble &

Troubleshooting & Known Issues

Or browse the github issues list to review old bugs or log a new problem. See https://github.com/jesseward/plex-lastfm-scrobbler/issues?q=

Metadata

Release files for plex-scrobble 4.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plex-scrobble 4.1.1
File Size Uploaded Provenance Actions
plex-scrobble-4.1.1.tar.gz 10.1 kB Without provenance Details for plex-scrobble-4.1.1.tar.gz

Release files / plex-scrobble-4.1.1.tar.gz

Download URL plex-scrobble-4.1.1.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3eb1d35b5767d98f9f1e001b49fa630a9da3238e61c16df65fa41b3ae3e43635
BLAKE2b-256 checksum
How to use checksums
1b2a688766ffafc4a82cf9bf8431cd082577ce0bb9332e51551ee931055f60cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for plex-scrobble 4.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page