Program to synchronize your AniList and MyAnimeList accounts.
- Sync AniList to MyAnimeList (anime and manga)
- Sync MyAnimeList to AniList (anime and manga) using
-reverse-direction
flag - OAuth2 authentication with AniList and MyAnimeList
- CLI interface
- Configurable by environment variables and config file
First configurate your accounts in the site. Then run the program and follow the instructions to authenticate. It prints the URL to visit in the browser. Then you will be redirected to the callback URL and save the token. After that you will go same steps for MyAnimeList.
Token will be saved in the ~/.config/anilist-mal-sync/token.json
file and reused then.
You can change the path in the config file.
If you want to reauthenticate, just delete the file.
- Go to AniList settings (Settings -> Apps -> Developer)
- Create a new client
- Set the redirect URL to
http://localhost:18080/callback
- Set the client ID and client secret in the config file or as environment variables
- Go to MyAnimeList API Settings (Profile -> Account Settings -> API)
- Create a new application
- Set the redirect URL to
http://localhost:18080/callback
- Set the client ID and client secret in the config file or as environment variables
oauth:
port: "18080" # Port for OAuth server to listen on (default: 18080).
redirect_uri: "http://localhost:18080/callback" # Redirect URI for OAuth server (default: http://localhost:18080/callback).
anilist:
client_id: "1" # AniList client ID.
client_secret: "secret" # AniList client secret.
auth_url: "https://anilist.co/api/v2/oauth/authorize"
token_url: "https://anilist.co/api/v2/oauth/token"
username: "username" # Your AniList username.
myanimelist:
client_id: "1" # MyAnimeList client ID.
client_secret: "secret" # MyAnimeList client secret.
auth_url: "https://myanimelist.net/v1/oauth2/authorize"
token_url: "https://myanimelist.net/v1/oauth2/token"
username: "username" # Your MyAnimeList username.
token_file_path: "" # Absolute path to token file, empty string use default path `$HOME/.config/anilist-mal-sync/token.json`
PORT
- Port for OAuth server to listen on (default: 18080).CLIENT_SECRET_ANILIST
- AniList client secret.CLIENT_SECRET_MYANIMELIST
- MyAnimeList client secret.
Program supports the following command-line options:
-c
- Path to the config file. Default isconfig.yaml
.-f
- Force sync (sync all entries, not just the ones that have changed). Default is false.-d
- Dry run (do not make any changes). Default is false.-manga
- Sync manga instead of anime. Default is anime.-all
- Sync both anime and manga. Default is anime.-verbose
- Print debug messages. Default is false.-reverse-direction
- Sync from MyAnimeList to AniList (default is AniList to MyAnimeList). Default is false.-h
- Print help message.
Requirements:
- Go 1.22 or later
Build and run the program from source:
- Clone the repository:
git clone https://github.com/bigspawn/anilist-mal-sync.git
- Change directory:
cd anilist-mal-sync
- Configure the program:
cp config.example.yaml config.yaml
and fill in the necessary fields - Run the program:
go run .
Or install the program:
go install github.com/bigspawn/anilist-mal-sync@latest
anilist-mal-sync
You can also run the application using Docker.
The image is available on GitHub Container Registry:
docker pull ghcr.io/bigspawn/anilist-mal-sync:latest
Run the container:
docker run \
-p 18080:18080 \
-v /path/to/your/config.yaml:/etc/anilist-mal-sync/config.yaml \
-v /path/to/token/directory:/home/appuser/.config/anilist-mal-sync \
ghcr.io/bigspawn/anilist-mal-sync:latest
- Clone the repository:
git clone https://github.com/bigspawn/anilist-mal-sync.git
- Change directory:
cd anilist-mal-sync
- Build the Docker image:
docker build -t anilist-mal-sync .
- Run the container
Create a docker-compose.yml
file:
version: '3'
services:
anilist-mal-sync:
image: ghcr.io/bigspawn/anilist-mal-sync:latest
ports:
- "18080:18080"
volumes:
- ./config.yaml:/etc/anilist-mal-sync/config.yaml
- ./tokens:/root/.config/anilist-mal-sync # it must be a directory
environment:
- CLIENT_SECRET_ANILIST=your_secret_here # Optional
- CLIENT_SECRET_MYANIMELIST=your_secret_here # Optional
- PORT=18080 # Optional
Run with Docker Compose:
docker-compose up
Note: When running in Docker, the browser authentication flow requires that port 18080 is exposed and accessible from your host machine. Also ensure that your token storage directory is mounted as a volume to preserve authentication between runs.
This project is not affiliated with AniList or MyAnimeList. Use at your own risk. Both services have rate limits and the program can look like it's frozen or stop by timeout. Just stop it and wait for a while and run again.
- Sync favorites
- Sync MAL to AniList
- Sync rewatching and rereading