Simple python project to automatically scrobble media information to Trakt.tv. Fully pluggable, which enables taking data from multiple players.
- Uses guessit to extract media information from its file path. For cases when it misidentifies the files, you can specify a regex to manually extract the necessary details.
- Scrobbling is independent of the player(s) where the media is played. Support for new players can thus be easily added.
- Currently has support for:
-
VLC: Enable the Lua Web Interface from advanced options. Don't forget to specify the password in Lua options.
-
MPV: Enable the JSON IPC, either via the mpv.conf file, or by passing it as a command line option.
-
MPC-BE/MPC-HC: Enable the web interface from Options.
All you have to do now is create a config.toml
file with the required parameters. See sample_config.toml
under trakt_scrobbler/data
directory.
Parameter | Explanation |
---|---|
fileinfo.whitelist |
List of strings | Default: [] List of directories you want to be scanned for shows or movies. If empty, all files played in the player are scanned. You can prevent the program from scanning all played files if your shows and movies are located in fixed directories. If possible you should use this option to minimize traffic on the Trakt API. |
fileinfo.include_regexes |
Dict of list of strings | Default: {} If you find that the default module for identifying media info (guessit) is misidentifying some titles, you can specify the regex for that file path. The regex should have posix-like path, and not Windows' \ to separate directories. The minimum required information is the title of the file, and episode number in the case of TV Shows. If season is not found, it defaults to 1. |
players.monitored |
List of strings Specify players which are to be monitored for scrobbling. (Ensure that if both MPCHC and MPCBE are to be monitored, then their ports should be different.) |
Other player specific parameters | See sample config for the required attributes. |
-
Clone the repo to a directory of your choice/click "Download as zip" and extract it.
-
Ensure you have Python 3.6 or higher installed, and in your system
PATH
. -
Run
pip install pipenv
to install pipenv in your system. -
Depending on your OS, proceed as follows:
-
Linux
At the root of cloned project directory, runscripts/linux-install-service.sh
. This will copy the files to~/.local/trakt-scrobbler
, create the virtualenv, enable the startup service and finish device authentication with trakt. -
Windows
At the root of cloned project directory, runscripts\windows-install.bat
. This will copy the files to%LOCALAPPDATA%\trakt-scrobbler
directory, create the virtualenv, enable the startup service and finish device authentication with trakt. -
MacOS
I will try to make a install script for Mac soon. Till then, here are the manual steps you can follow:- Inside the project directory root, run
pipenv install
. This will create a virtualenv, and install the necessary requirements. - Run
pipenv --py
to find the location of python interpreter of virtualenv. - Edit the
scripts/trakt_scrobbler.plist
file to add the correct folder path of the project. cp scripts/trakt_scrobbler.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/trakt_scrobbler.plist
- Type
pipenv run python main.py
to start the program. You will be prompted to authorize the program to access the Trakt.tv API. Follow the steps on screen to finish the process. In the future, the script will run on computer boot, without any need for human intervention.
- Inside the project directory root, run
-
-
To enable notification support on Linux/MacOS, the dbus libraries need to be installed (Reboot after installation).
- Ubuntu:
apt install python3-dbus
- MacOS:
brew install dbus
- Ubuntu:
Substitute the values according to your OS in the following steps
- Linux:
Dir2
:~/.local/trakt-scrobbler
- Kill app:
systemctl --user stop trakt-srobbler
- Mac:
Dir2
: Depends on where you installed.- Kill app:
launchctl unload ~/Library/LaunchAgents/trakt_scrobbler.plist
- Windows:
Dir2
:%LOCALAPPDATA%\trakt-scrobbler
- Kill app: Kill
pythonw.exe
from task manager
Steps:
- Clone/download this repo at some place (let's call this
Dir1
) - Open the current install location (
Dir2
) - Copy the
data
folder fromDir2
toDir1\trakt_scrobbler
(Notice the_
). You'll be asked to replace/skip thesample_config.toml
, you can do either. - Kill app (method depends on OS). Delete the folder at
Dir2
. - Run the install script from
Dir1\scripts
.
Feel free to create a new issue in case you find a bug/want to have a feature added. Proper PRs are welcome.
- Inspired from TraktForVLC
- mpv-trakt-sync-daemon was a huge help in making the mpv monitor