/trakt-episode-history-remover

Primary LanguagePythonApache License 2.0Apache-2.0

Trakt Episode History Remover

There is an error in Jellyfin Trakt plugin (issue). First I tried to fix with JS but its relly slow so I create a python script.

Prerequisites

Install Python Packages

Install pacakges via pip.

pip install python-dotenv

Set .env file

First we need .env file for store Trakt App client ID and Secret. You can copy sample file for create .env.

cp .env.sample .env

Create Trakt App

Now we need to create Trakt App to get history and remove history. Create Trakt App Enter any name to app, enter urn:ietf:wg:oauth:2.0:oob to Redirect uri box and click Save App button at bottom of page. After create the app you can see Client ID and Secret at webpage, copy these and paste to .env which is created earlier.

Extract IDs

We need extract episode ID and first added episode history id

Here is an example of my problem: example

Get Serie ID

First need to get episodes ID. Go to episode page and click to "VIEW ALL" link: text In my example this is the link of history of episode. So latest number is episode number: 430785 text

Get History ID of first added play

Now go to last page on history, scroll to bottom of page. Click CTRL + SHIFT + C and select last item of history. Click the exact spot.

text

Now you can see the HTML element in this element we need to store this data-history-id tag's value.

text

Edit JSON File

Go to episodes_to_delete.json and edit according to your information. "name", "season", "episode" is unnecessary I just added to remember which episode is which ID.

{ "episodes": [
    {
        "name": "Archer",
        "season": 3,
        "episode": 8,
        "blacklist_id": 5346779973,
        "id": 430785
    },
]}

If you need delete more episode just add new episodes to JSON (example in the file you can look it).

Run

Just run python file.

python main.py

Notes

If you have any problem with script you can open issue or contact me via Issues tab.