scrobblez
User-customizable scrobbler for Last.fm and MPRIS 2.
This scrobbler cleans up metadata (e.g. artist, album, track titles) produced by services with non-standard tagging schemes (e.g. Spotify). The cleaning process is extensible and can be customized to a user's particular needs.
Install
Install from PyPI:
pip install scrobblez
Or install from source:
git clone https://github.com/YodaEmbedding/scrobblez
cd scrobblez
pip install .
Usage
Simply run the following command:
scrobblez
Configuration
Within ~/.config/scrobblez/config.py, you may specify a whitelist of valid
player names:
whitelist = ["spotify"]
Optionally, you can also customize the metadata cleaning process:
from scrobblez.metadata_filter import *
from scrobblez.types import Metadata
def fix_metadata(metadata: Metadata) -> Metadata:
m = dict(metadata)
# Keep first artist only in list of artists
m["artist"] = m["artist"][0]
m["album_artist"] = m["album_artist"][0]
# Specify which filter rules to use
rules = (
REMASTERED_FILTER_RULES
+ SUFFIX_FILTER_RULES
+ VERSION_FILTER_RULES
+ ORIGIN_FILTER_RULES
+ FEATURE_FILTER_RULES
+ CLEAN_EXPLICIT_FILTER_RULES
+ LIVE_FILTER_RULES
+ TRIM_WHITESPACE_FILTER_RULES
)
# Specify manual artist/album/title overrides
artist_overrides = {
"Yusuf": "Cat Stevens",
"Yusuf / Cat Stevens": "Cat Stevens",
}
album_overrides = {
"The Lord of the Rings - The Return of the King - "
"The Complete Recordings (Limited Edition)":
"The Lord of the Rings: Return of the King - the Complete Recordings",
}
title_overrides = {
"Better Get Hit In Your Soul - Instrumental":
"Better Git It in Your Soul",
}
def fix(k, overrides, f=lambda x: x):
m[k] = overrides.get(m[k], f(m[k]))
# Apply fixes
fix("artist", artist_overrides)
fix("album_artist", artist_overrides)
fix("album", album_overrides, lambda x: apply_filters(rules, x))
fix("title", title_overrides, lambda x: apply_filters(rules, x))
return m
Metadata
Release files for scrobblez 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scrobblez-0.1.1.tar.gz | 8.2 kB | Without provenance | Details for scrobblez-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scrobblez-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for scrobblez-0.1.1-py3-none-any.whl |
Total release size: 17.4 kB
Release files / scrobblez-0.1.1.tar.gz
| Download URL | scrobblez-0.1.1.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
681e3a48036a49bde92f5d63ed6b4b7085ed64241c58834ae08c6bb6169bd87d
|
|
BLAKE2b-256 checksum How to use checksums |
1e91b72873b29c8ae23113239b2f6201626c19d578b632bc11be683ac10ac7c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / scrobblez-0.1.1-py3-none-any.whl
| Download URL | scrobblez-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f789c4c78184bce813eb58d39246181dba3d4eba1b89d40038e033a55e1001b
|
|
BLAKE2b-256 checksum How to use checksums |
6c584cb80b344fa50e2fc3fd870f55699c7e1f295a2027a727872ae10337c238
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for scrobblez 0.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.