This script allows you to remove all the duplicate or additionnal plays for your trakt.tv movies or episodes, and just keep plays with different dates.
For instance if you have 3 plays for the movie Guardians of the Galaxy at these dates:
- 2014-08-01T20:00:00.000Z
- 2017-05-05T22:00:00.000Z
- 2017-05-05T22:00:00.000Z
The script will keep two : the first and the second. The third will be removed. If there are no duplicates the script do nothing. The script backup your data in local json files (movies.json and episodes.json) before doing anything.
Go register a new api app. And fill the form with theses informations:
Name: trakt-duplicates-removal
Redirect uri: urn:ietf:wg:oauth:2.0:oob
You don't really care about the others fields.
Next, go to your api applications and click on the one named trakt-duplicates-removal
You will need the Client ID
and the Client Secret
from that page.
You will need python3 and pip installed and in your path
- Start by doing a
pip3 install -r requirements.txt
at the root of the project - Edit the script to set the
client_id
andclient_secret
variables with the ones you obtained on your trakt.tv api application - Edit the script to set the
username
variable with your trakt.tv username (you can find it in your settings: https://trakt.tv/settings) - Optionally you can modify the
types
variable to run the script only for movies or episodes - Launch the script :
python3 trakt-duplicates-removal.py
Follow the script instructions
Based on https://gist.github.com/blaulan/50d462696bce5da9225b8d596a8c6fb4