Scrobbler for MPRIS 2兼容客户端
scrobblez的Python项目详细描述
斯克鲁布尔兹
用户可自定义scrobbler姓氏.fmMPRIS和MPRIS。在
这个scrobbler清理产生的元数据(例如艺术家、专辑、曲目标题) 通过具有非标准标记方案的服务(如Spotify)。清洁 过程是可扩展的,并且可以根据用户的特殊需要进行定制。在
安装
从PyPI安装:
pip install scrobblez
或从源安装:
^{pr2}$使用
只需运行以下命令:
scrobblez
配置
在~/.config/scrobblez/config.py
中,您可以指定一个有效的白名单
玩家名称:
whitelist=["spotify"]
也可以自定义元数据清理过程:
fromscrobblez.metadata_filterimport*fromscrobblez.typesimportMetadatadeffix_metadata(metadata:Metadata)->Metadata:m=dict(metadata)# Keep first artist only in list of artistsm["artist"]=m["artist"][0]m["album_artist"]=m["album_artist"][0]# Specify which filter rules to userules=(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 overridesartist_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",}deffix(k,overrides,f=lambdax:x):m[k]=overrides.get(m[k],f(m[k]))# Apply fixesfix("artist",artist_overrides)fix("album_artist",artist_overrides)fix("album",album_overrides,lambdax:apply_filters(rules,x))fix("title",title_overrides,lambdax:apply_filters(rules,x))returnm
- 项目
标签: