So it seems that I still downloaded the wrong/old version last time.
After doing the whole procedure again, it's working like a charm now ^_^
DS1813> plex-scrobble.py -p
----------------------------------------------------------------------
| Running a few tests against your installation to ensure that
| required Plex Media Server files are in place.
----------------------------------------------------------------------
| * verify_plex_log_file_exists => [PASS]
| * detect_played_audio_in_PMS_log => [PASS]
| * was_lastfm_authorization_granted => [PASS]
----------------------------------------------------------------------
This works really well for me, thank you! I am running this on a headless Ubuntu server, so I'm running into difficulty with sessions. When I ssh into my server and run the script all is well. When I kill that session of course, the script stops and scrobbling ceases. I've tried setting this as a service through Upstart but haven't had any luck.
Any suggestions on getting this to run on startup and all the time?
edit: Nevermind, I got it working. Was missing some details but this covered it.
But I'm still stuck. Upstart just doesn't seem to run my .conf-file. Any hints?
start on (filesystem and stopped udevtrigger)
stop on runlevel [016]
# tell upstart to respawn the process if abnormal exit
respawn
script
/home/ubuntu/.virtualenvs/plex-lastfm-scrobber/bin/python /home/ubuntu/plex-lastfm-scrobber/scripts/plex-scrobble.py
end sc/ript
i don't see an exec command in your script to kick off python.
here is my /etc/init/PlexPythonScrobbler.conf file contents. you probably want to run the script as your "ubuntu" user using the setuid and setgid commands
i don't see an exec command in your script to kick off python.
here is my /etc/init/PlexPythonScrobbler.conf file contents. you probably want to run the script as your "ubuntu" user using the setuid and setgid commands
The service seems to be running, but it gives an error on a 'possible log file rotation' and refuses to scrobble. However when I start the service manually it works like a charm. Any hints?
The service seems to be running, but it gives an error on a 'possible log file rotation' and refuses to scrobble. However when I start the service manually it works like a charm. Any hints?
I'm not sure, but maybe it's the way you're executing the script. I'm not clear on what the execution context is with the mechanism. I just use
I've done everything up to the point of "plex-scrobble.py" in ubuntu, but then the terminal just hangs until I have to force stop the action. Any fix for this?
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, while it has not yet been tested on Windows, it should work.
A few points
Uses python standard library. Python is the only requirement to run this application
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
Version 0.0.1
It is recommended (but not required) that you install this into a virtualenvironment.
Fetch and install the source from the github repo.
git clone git@github.com:jesseward/plex-lastfm-scrobbler.git
cd plex-lastfm-scrobbler
python setup.py install
You're done.
Configuration
The plex-lastfm-scrobbler configuration file (plex_scrobble.conf) is installed to ~/.config/plex-lastfm-scrobbler/ . 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.
# 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: 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.
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
Running
If you installed plex-lastfm-scrobble to a virtual environment, enable the virtual env.
On first run you will be prompted to authenticate and grant access to your Last.fm account. Visit the URL generated by plex-scrobble and follow the prompts to grant access to the application.
Have you authorized me [y/N] : y
Please relaunch plex-scrobble service.
Once this is complete, please re-start the service, listen to audio via Plex and watch as your music is scrobbled. You may wish to leave the service running in the background. On a POSIX system, wrap the script in the no-hangup utility.
$ nohup plex-scrobble.py &
Troubleshooting
If you're experiencing authentication issues (appearing in plex_scrobble.log), remove the ~/.config/plex-lastfm-scrobbler/session file. This stores your Last.FM authentication token. There is no harm in removing/recreating this as many times as needed.
Any feedback on the performance on a MS Windows installation would be appreciated. I do not have ability to test plex-lastfm-scrobbler on this platform. Please log an issue or a pull request with any fixes.
Does it have to be complied on your own machine? Would it be possible to publish a compiled version that just has the bundle folder and all the necessary files so it could just be unzipped to the correct folder in Plex? Similar to how the Trakt Scrobbler works: https://github.com/trakt/Plex-Trakt-Scrobbler
Just a quick note to say I installed this on my OSX Plex machine and it's working great. Thank you for putting this together! OS X 10.7.5, PMS 0.9.11.7
Does it have to be complied on your own machine? Would it be possible to publish a compiled version that just has the bundle folder and all the necessary files so it could just be unzipped to the correct folder in Plex? Similar to how the Trakt Scrobbler works: https://github.com/trakt/Plex-Trakt-Scrobbler
Would like this too, if it could be added as a channel.
DS213> plex-scrobble.py -p
----------------------------------------------------------------------
| Running a few tests against your installation to ensure that
| required Plex Media Server files are in place.
----------------------------------------------------------------------
| * verify_plex_log_file_exists => [FAIL]
| Check: Log file does not exist, please ensure you have
| correctly set mediaserver_log location in your Plex Scrobbler
| configuration.
| * detect_played_audio_in_PMS_log => [FAIL]
| Check: Log file does not exist, please ensure you
| havecorrectly set mediaserver_log location in your Plex
| Scrobblerconfiguration.
| * was_lastfm_authorization_granted => [FAIL]
| Check: Your last.fm authtoken does not exist. Please
| run"python plex-scrobbler.py -a" and follow instructions to
| grantauthorization to your last.fm account.
PS.
OK, fixed, was a problem of last.fm authorization.
now
DS213> plex-scrobble.py -p
----------------------------------------------------------------------
| Running a few tests against your installation to ensure that
| required Plex Media Server files are in place.
----------------------------------------------------------------------
| * verify_plex_log_file_exists => [PASS]
| * detect_played_audio_in_PMS_log => [PASS]
| * was_lastfm_authorization_granted => [PASS]
----------------------------------------------------------------------
Tried this out with Premium Music while waiting for last.fm functionality to be added (as per comment thread on blog, it's on the to-do list)...not able to make this work. Does this only work with "regular" music libraries?