通过Plex Media Center播放的拼凑音频曲目
plex-scrobble的Python项目详细描述
Plex Lastfm Scrobbler提供了一组脚本,允许您 从Plex媒体服务器将播放的音频项目搜索到last.fm 申请。Plex Lastfm Scrobbler是为跨平台运行而构建的, 不过只在Linux上测试过。
几点
- Plex Lastfm Scrobbler是一个进程外工具。意思是它不是 Plex媒体服务器插件。这个工具独立于你的丛运行 媒体服务器。
- 必须在PLEX媒体服务器上运行
- 分析Plex媒体服务器日志中的“已播放”字符串 文件。
- 不区分客户。意思是所有媒体播放, 将在脚本运行时进行搜索。
- 必须将plex媒体服务器日志设置为调试级别(而不是详细级别)
安装
linux,操作系统x
建议(但不是必需)将其安装到 虚拟环境。这样做是可以的。
virtualenv ~/.virtualenvs/plex-lastfm-scrobbler source ~/.virtualenvs/plex-lastfm-scrobbler/bin/activate
支持通过pip或easy_install安装。例如 :pip install plex-scrobble或easy_install plex-scrobble。
如果要运行开发生成,请从 Github回购协议。
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.
或者,您可以从github获取最新的zip文件
wget https://github.com/jesseward/plex-lastfm-scrobbler/archive/master.zip unzip master.zip cd plex-lastfm-scrobbler-master python setup.py install
你完了。
配置
运行向导以生成配置文件
plex-scrobble --wizard
plex lastfm scrobbler配置文件(.plex scrobble.toml)是 安装到~/。以下配置值可用。
如果您在基于Linux的操作系统上运行PLEX媒体服务器, 事情应该开箱即用。
[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"
运行
如果将plex lastfm scrobble安装到虚拟环境中,请启用 虚拟环境。
source ~/.virtualenvs/plex-lastfm-scrobber/bin/activate
运行应用程序
nohup plex-scrobble &
疑难解答和已知问题
- 如果您的plex客户机支持通用转码器(请参见“old and 通用转码器@ https://support.plex.tv/hc/en-us/articles/200250377-Transcoding-Media, 曲目将在比赛开始时搜寻。这是因为 通用转码器写入PLEX日志文件。见问题 11(https://github.com/jesseward/plex-lastfm-scrobbler/issues/11)用于 背景讨论。
- 我们已经看到PLEX媒体服务器不报告 音频文件的长度。这可能发生在完整库分析之前 已完成。当丛未报告磁道长度时 媒体服务器,歌曲将不会被搜刮。试着强迫 “分析”音频库功能。有争议的进一步讨论 #9https://github.com/jesseward/plex-lastfm-scrobbler/issues/9
或者浏览github问题列表以查看旧的bug或记录新的 问题。见 https://github.com/jesseward/plex-lastfm-scrobbler/issues?q=