Skip to content

MyAnimeList Attributes

Configuring MyAnimeList is optional but is required for MyAnimeList based collections and operations to function.

The mal attribute is found at the root of the config file. Some of these are filled in by you, others are filled in by MyAnimeList:

Kometa will keep these credentials up-to-date; they expire periodically and need to be renewed.

Warning

Your config file needs to be writable by Kometa, since the authentication attribute gets updated when the credentials are renewed.

If the config file is not writable, the MyAnimeList renewal will eventually fail.

config.yml MyAnimeList sample
mal:
  client_id: abc123def456ghi789
  client_secret: zyx987wvu564tsr321
  localhost_url: https://localhost:5000/somestuff
  authorization:
    access_token: k0met4t0k3nh3r3
    token_type: Bearer
    expires_in: 192837465
    refresh_token: r3fr3sht0k3ng0e5h3r3
Attribute Description Allowed Values (default in bold) Required
client_id MyAnimeList application client ID. Any valid ID or leave blank
client_secret MyAnimeList application client secret. Any valid secret or leave blank
localhost_url Redirect URL used for authorization flow. Valid localhost URL or leave blank

All other attributes will be filled in by Kometa as part of the authentication process

Authenticating outside Kometa

The simplest and preferred way to authenticate against MyAnimeList is the Kometa Utilities.

If you want to do this manually, read on.

Important Note on "Authentication Process":

The MyAnimeList authentication process is interactive; Kometa will display a URL in the console output and then wait for you to visit that URL in order to grant access and then paste in some additional information. In order for this to happen you need to run Kometa in an interactive mode, which can be fussy in some contexts (e.g., running Kometa in a Docker container on a NAS). For this reason, it is far simpler to use the form down below to perform these steps; it does all the same steps, but takes them out of the Kometa script execution. The form will produce a complete authentication block as shown above ready for you to copy-paste into your config.yml.

MyAnimeList Authentication

You can complete the MyAnimeList authentication interactively during the config run, or you can complete it outside of Kometa and paste in the resulting mal attribute.

To connect to MyAnimeList.net you must create a MyAnimeList application and supply Kometa the client id and client secret provided, please do the following:

Tip

MyAnimeList may have specific requirements for any value shown below, which may change over time, so refer to the form at MyAnimeList in the event that any of these example values do not work.

  1. Click here to create a MyAnimeList API application.
  2. Enter an App Name for the application; for example, Kometa. This name is arbitrary and can be whatever you wish as long as it meets MyAnimeList requirements.
  3. Select web for App Type.
  4. Enter an App Description for the application; for example, Kometa manages metadata and collections on Plex servers. This description is arbitrary and can be whatever you wish as long as it meets MyAnimeList requirements.
  5. Enter http://localhost/ for App Redirect URL.
  6. Enter https://github.com/Kometa-Team/Kometa for Homepage URL.
  7. Select non-commercial for Commercial / Non-Commercial.
  8. Enter any name under Name / Company Name.
  9. Select hobbyist for Purpose of Use.
  10. Agree to the API License and Developer Agreement and hit the Submit button.
  11. You should see Successfully registered. followed by a link that says Return to list click this link.
  12. On this page Click the Edit button next to the application you just created.
  13. Record the Client ID and Client Secret found on the application page.
  14. Go to this URL but replace CLIENT_ID with your Client ID.

    https://myanimelist.net/v1/oauth2/authorize?response_type=code&client_id=CLIENT_ID&code_challenge=k_UHwN_eHAPQVXiceC-rYGkozKqrJmKxPUIUOBIKo1noq_4XGRVCViP_dGcwB-fkPql8f56mmWj5aWCa2HDeugf6sRvnc9Rjhbb1vKGYLY0IwWsDNXRqXdksaVGJthux
    
  15. You should see a page that looks like this:

    MAL Details

  16. Click "Allow".

  17. You will be taken to a page that will not load. That's fine and expected.

    Localhost Failure

  18. Copy the URL, which will be localhost/?code=BLAH and paste in your config file next to localhost_url.

    If you do not see an error as above but instead get taken to some seemingly random website, you probably have a webserver running on your local computer, probably from some sort of tutorial if you don't recall having set one up. For example, some Docker tutorials have you start up local web servers.

    You will need to stop that web server while you're doing this in order to grab that localhost URL.

  19. Run Kometa and the authentication will be completed.

Alternative Way of Letting Kometa make the URL

You can record just your client_id and client_secret and Kometa will create the url for you described below.

On the first run, Kometa will walk the user through the OAuth flow by producing a MyAnimeList URL for the user to follow.

After following the URL login to MyAnimeList.net and authorize the application by clicking the Allow button which will redirect the user to http://localhost/.

Copy the entire URL and paste it into Kometa and if the URL is correct then Kometa will populate the authorization sub-attributes to use in subsequent runs.

On first run:

|====================================================================================================|
| Connecting to My Anime List...                                                                     |
|                                                                                                    |
| Navigate to: https://myanimelist.net/v1/oauth2/authorize?response_type=code&client_id=BING&code_challenge=BANG |
|                                                                                                    |
| Login and click the Allow option. You will then be redirected to a localhost                       |
| url that most likely won't load, which is fine. Copy the URL and paste it below                    |
| URL:

Click on that URL to open your browser to MyAnimeList; you'll be looking at a page like this:

MAL Details

Click "Allow", and you will be taken to a page that will not load. That's fine and expected.

Localhost Failure

Copy the URL, which will be localhost/?code=BLAH and paste it at the prompt.

If you do not see an error as above but instead get taken to some seemingly random website, you probably have a webserver running on your local computer, probably from some sort of tutorial if you don't recall having set one up. For example, some Docker tutorials have you start up local web servers.

You will need to stop that web server while you're doing this in order to grab that localhost URL.

| URL: http://localhost/?code=BOING
| Saving authorization information to /path/to/kometa/config/config.yml |
| My Anime List Connection Successful                                                                |
|====================================================================================================|

OAuth Flow using Docker

To authenticate MyAnimeList the first time, you need run the container with the -it flags in order to walk through the OAuth flow mentioned above. Once you have the MyAnimeList authentication data saved into the YAML, you'll be able to run the container normally.

Online Authorization

This page covers the online utilities for Plex, MyAnimeList, SIMKL, and Trakt authentication. See Trakt Attributes for Trakt-specific behavior.

This is useful on setups, primarily Docker, where completing a browser-based flow locally is inconvenient.

For this reason, Kometa provides a utilities webapp which will take you through the authentication process and will provide the service's authentication block ready to paste into your config.

This webapp is available at https://utilities.kometa.wiki.

There is no logging, but if you feel more comfortable running these things locally you can find the source code here.

alt text

  1. Click the top-level button.

    Step 1

  2. Click "Start Authentication". This will display a PIN and a link to start authentication. Click that link [which will open a new tab/window to Plex] and follow any instructions given by Plex:

    Step 2

    Close that window when Plex indicates it is safe to do so.

  3. The utilities app will now display a Plex token and user details:

    Step 2

  4. Copy that token to your Kometa config.yml

  1. Click the top-level button, enter your Trakt client ID and Secret.

    Step 1

  2. Click "Continue to Trakt".

    Follow any instructions you see on the Trakt site.

    You will be returned to the Kometa Utilities site.

  3. A Kometa Trakt authentication block will be displayed.

    Step 4

    Copy that block to your Kometa config.yml

  1. Click the top-level button, enter your MyAnimeList client ID and Secret.

    Step 1

  2. Click "Get Authentication URL". This will fill in the auth URL:

    Step 2

    Click "Open URL" and follow any instructions given. This will take you to a localhost URL that will fail to load.

  3. Paste that URL into the field and click "Submit":

    Step 3

  4. A Kometa MyAnimeList authentication block will be displayed.

    Step 4

    Copy that block to your Kometa config.yml

  1. Click the top-level button.

    Step 1

  2. Click "Connect with SIMKL". Log into your SIMKL account:

    Step 2

  3. Click "Yes" to grant Kometa access:

    Step 3

  4. Wait a moment:

    Step 4

  5. A Kometa SIMKL config block will be displayed.

    Step 5

    Copy that block to your Kometa config.yml