This scrobbler sends episodes you watch on your Plex Media Center to TVShow Time
Python
Latest commit 56b00b3 May 7, 2015 Antonio Pinto Added reference to the base project
Permalink
Failed to load latest commit information.
conf first commit Mar 31, 2015
etc first commit Mar 31, 2015
plex_tvst_scrobbler first commit Mar 31, 2015
scripts first commit Mar 31, 2015
.gitignore first commit Mar 31, 2015
LICENSE first commit Mar 31, 2015
README.md Added reference to the base project May 7, 2015
setup.py first commit Mar 31, 2015

README.md

plex-tvst-scrobbler

plex-tvst-scrobbler provides a set of scripts that allow you to scrobble played episodes items to TVShow Time from the Plex Media Server application. plex-tvst-scrobbler was built to run across platforms, while it has not yet been tested on Windows, it should work.

A few points

  • plex-tvst-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
  • Uses python standard library. Python is the only requirement to run this application
  • 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.

virtualenv ~/.virtualenvs/plex-tvst-scrobber
source ~/.virtualenvs/plex-tvst-scrobber/bin/activate

Fetch and install the source from the github repo.

git clone https://github.com/jesseward/plex-tvst-scrobbler.git
cd plex-tvst-scrobbler
python setup.py install

Alternatively, you can fetch the latest zip from github

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

You're done.

Windows Note: any feedback regarding MS Windows functionality is appreciated.

cd c:\temp\plex-tvst-scrobbler\
  • in the c:\temp\plex-tvst-scrobbler\ directory, run the installer from the dos prompt
python setup.py install

The above command installs the python scripts to various locations. Directories of interest are :

To run the application, do the following from a DOS prompt

cd c:\Python27\scripts
python plex-tvst-scrobbler.py

Configuration

The plex-tvst-scrobbler configuration file (plex_tvst_scrobbler.conf) is installed to ~/.config/plex-tvst-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: a python data struture that stores failed scrobbles. plex-tvst-scrobbler
# will retry on a 60 minute interval, maximum of 10 attempts if tvshowtime.com is
# experiencing issues.
cache_location = tmp/plex_tvst_scrobbler.cache

# 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-tvst-scrobbler log file.
log_file = /tmp/plex_tvst_scrobbler.log

Running

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

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

run the application

$ plex-tvst-scrobbler.py

On first run you will be prompted to authenticate and grant access to your TVShow Time account. Visit the URL generated by plex-tvst-scrobbler and follow the prompts to grant access to the application.

Example.

$ plex-tvst-scrobbler.py

== Requesting tvshowtime.com auth ==

Please do the following to authorize the scrobbler:

1/ Connect on https://www.tvshowtime.com/activate
2/ Enter the code: xxxx-xxxx

Have you authorized me [y/N] :

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-tvst-scrobbler.py &

Troubleshooting & Known Issues

  • If you're experiencing authentication issues (appearing in plex_tvst_scrobbler.log), remove the ~/.config/plex-tvst-scrobbler/session file. This stores your TVShow Time authentication token. There is no harm in removing/recreating this as many times as needed.
  • If your Plex client supports the universal transcoder (see "Old and Universal transcoder @ https://support.plex.tv/hc/en-us/articles/200250377-Transcoding-Media), tracks will be scrobbled at the start of play. This is due to the way that the universal transcoder writes to the Plex log file. See issue 11 (https://github.com/jesseward/plex-tvst-scrobbler/issues/11) for background discussion.
  • We've seen instances when Plex Media Server does not report the length of an audio file. This may occur before a full library analyze has completed. When the track length is not reported by the Plex Media Server, the song will not be scrobble. Try forcing the "Analyze" audio library function. Further discussion found in issue #9 https://github.com/jesseward/plex-tvst-scrobbler/issues/9

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

Contributing

Any feedback on the performance on a MS Windows installation would be appreciated. I do not have ability to test plex-tvst-scrobbler on this platform. Please log an issue or a pull request with any fixes.

Thanks

The project https://github.com/jesseward/plex-lastfm-scrobbler was used as the base of the code.