Trakt Attributes¶
Configuring Trakt.tv is optional but is required for Trakt based collections to function.
A trakt
mapping is in the root of the config file, sampled below.
trakt:
client_id: 1a2b3c4d5e6f7g8h9i
client_secret: 1a12b23c34d45e56f6
pin:
authorization:
access_token: 4cc355t0k3nh3r3
token_type: Bearer
expires_in: 1928374655
refresh_token: r3fr35ht0k3nh3r3
scope: public
created_at: 137946258
Attribute | Description | Allowed Values (default in bold) | Required |
---|---|---|---|
client_id |
Trakt application client ID. | Any valid ID or leave blank | |
client_secret |
Trakt application client secret. | Any valid secret or leave blank | |
pin |
Trakt PIN. | PIN string or leave blank |
All other attributes will be filled in by Kometa as part of the authentication process*
Trakt Authentication¶
To connect to Trakt.tv you must create a Trakt application and supply Kometa the client_id
,client_secret
, and pin
provided, please do the following:
- Click here to create a Trakt API application.
- Enter a
Name
for the application. - Enter
urn:ietf:wg:oauth:2.0:oob
forRedirect uri
. - Click the
SAVE APP
button. - Record the
Client ID
andClient Secret
asclient_id
andclient_secret
in your Configuration File. -
Click the Green Authorize Button next to the Redirect URI.
-
Record the
PIN
aspin
in your Configuration File.
Warning
Run Kometa shortly after obtaining your PIN; the PIN may expire at some point.
Online Authorization¶
When trying to authorize Trakt or MyAnimeList, Kometa needs to run in interactive mode so that you can enter details. This is problematic on some setups [namely docker] where entering interactive mode is not always simple.
These scripts allow you to authorize Trakt and MyAnimeList here on the wiki. Once authorized, the script will
give you a YAML block that you will copy into the config.yml, replacing the existing trakt
and/or myanimelist
sections.
The source code for these scripts can be found on the Trakt-MAL-OAuth Repository.
Usage¶
- Enter client ID and secret.
- For Trakt, if you didn't retrieve a PIN yourself less than ten minutes ago, click the button, and enter the PIN in the field.
- For MyAnimeList, click the button to authenticate and get the required "localhost URL".
- Click "Submit".
- Copy and paste the result into your Kometa config.
Running the Authentication Scripts Locally¶
For users who want full control over the scripts and would prefer the run them locally, you can run the script in docker or python by following the instructions in the Trakt-MAL-OAuth Repository.
Click for instructions on how to run the scripts locally
Ensure you have downloaded a copy of the Trakt-MAL-OAuth Repository. If you have downloaded the ZIP file, extract it to your desired location.
python3 -m venv kometa-auth-venv
. kometa-auth-venv/bin/activate
python -m pip install -r requirements.txt
Running in Docker¶
- build the image with
docker build -t kometa-auth-image .
- run the container with
docker run --rm kometa-auth-image
- If you get a message complaining that something else is already running on port 5000, run the container with
docker run --rm -p 5001:5000 kometa-auth-image
- go to
http://127.0.0.1:5000
ORhttp://127.0.0.1:5001
. - see instructions above
Running in Python¶
- Make sure you are running a recent Python [this was developed on Python 3.11]
- Run these commands to create a virtual environment and install requirements.
- run the script with
python app.py
- If you get a message complaining that something else is already running on port 5000, open
app.py
and change the 5000 on the last line to 5001; repeat step 3. - go to
http://127.0.0.1:5000
ORhttp://127.0.0.1:5001
. - see instructions above
Docker or the already deployed version are recommended.