Skip to content

cristianmiranda/plex-trakt-scrobbler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Plex Trakt TV Scrobbler

plex-trakt-scrobbler provides a set of scripts that allow you to scrobble played episodes items to Trakt TV from the Plex Media Server application. plex-trakt-scrobbler was built to run across platforms.

A few points:

  • plex-trakt-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 to know what's going on with your media files.

Installation

###Linux, OSX

Fetch and install the source from the github repo.

git clone https://github.com/cristianmiranda/plex-trakt-scrobbler.git

Alternatively, you can fetch the latest zip from github.

wget https://github.com/cristianmiranda/plex-trakt-scrobbler/archive/master.zip
unzip master.zip

IMPORTANT!: Make sure that Plex Media Server logging is in DEBUG level (not VERBOSE).

You're done 😄

Configuration

The plex-trakt-scrobbler configuration file (plex_trakt_scrobbler.conf) is installed to ~/.config/plex-trakt-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.

[plex-trakt-scrobbler]
# 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: Where do you wish to write the plex-tvst-scrobbler log file.
log_file = /tmp/plex_trakt_scrobbler.log

# OPTIONAL: Where do you wish to write the token used for authorizing access to
# you Trakt TV account
session = /tmp/plex_trakt_scrobbler_session_key

# OPTIONAL: 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 = /home/user/Plex/Application Support/Plex Media Server/Logs/Plex Media Server.log

# OPTIONAL: required only when using authentication even in local networks
# See how to get your token @ https://support.plex.tv/hc/en-us/articles/204059436-Finding-your-account-token-X-Plex-Token
plex_token=PFyDEit1s2ZmBdupLCNn

Running

$ python src/plex-trakt-scrobbler.py

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

Example:

$ python src/plex-trakt-scrobbler.py

== Requesting Trakt auth ==

Please do the following to authorize the scrobbler:

1/ Connect on https://www.trakt.tv/activate
2/ Enter the code: xxxx-xxxx

Have you authorized me? [y/N] :

Once this is complete, please re-start the service. You may wish to leave the service running in the background. On a POSIX system, wrap the script in the no-hangup utility.

$ nohup src/python plex-trakt-scrobbler.py &

Testing

Just for testing purposes, in order to ensure that everything is working properly, go ahead an play some TV Show episode for a few seconds (you can also tail the logs to see what's going on):

tail -f /tmp/plex_trakt_scrobbler.log

Then stop the episode around 85% (it has to bee more than 80%) and check in your account to see if the episode has been scrobbled.

Troubleshooting & Known Issues

  • If you're experiencing authentication issues (appearing in plex_trakt_scrobbler.log), remove the /tmp/plex_trakt_scrobbler_session_key file. This stores your Trakt TV authentication token. There is no harm in removing/recreating this as many times as needed.

Browse the github issues list to review old bugs or log a new problem. See https://github.com/cristianmiranda/plex-trakt-scrobbler/issues?q=

Contributing

Please log an issue or a pull request with any fixes.

Thanks

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