{"id":13624302,"url":"https://github.com/RickDB/PlexAniSync","last_synced_at":"2025-04-15T21:30:34.952Z","repository":{"id":34507026,"uuid":"166839057","full_name":"RickDB/PlexAniSync","owner":"RickDB","description":"Sync Plex anime library to AniList","archived":false,"fork":false,"pushed_at":"2024-10-26T21:32:17.000Z","size":13954,"stargazers_count":287,"open_issues_count":22,"forks_count":44,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-26T23:18:29.331Z","etag":null,"topics":["anilist","anilist-api","anime","plex","plexmediaserver","sync","synchronization"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RickDB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-21T15:44:43.000Z","updated_at":"2024-10-26T21:32:21.000Z","dependencies_parsed_at":"2023-10-03T10:15:28.981Z","dependency_job_id":"b38766e9-09ca-4139-8520-e0a2e3a7436d","html_url":"https://github.com/RickDB/PlexAniSync","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RickDB%2FPlexAniSync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RickDB%2FPlexAniSync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RickDB%2FPlexAniSync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RickDB%2FPlexAniSync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RickDB","download_url":"https://codeload.github.com/RickDB/PlexAniSync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223685162,"owners_count":17185790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anilist","anilist-api","anime","plex","plexmediaserver","sync","synchronization"],"created_at":"2024-08-01T21:01:41.184Z","updated_at":"2025-04-15T21:30:34.943Z","avatar_url":"https://github.com/RickDB.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Plex to AniList Sync\r\n[![Build Status](https://travis-ci.com/RickDB/PlexAniSync.svg?branch=master)](https://travis-ci.com/RickDB/PlexAniSync) ![Docker](https://github.com/rickdb/Docker-PlexAniSync/actions/workflows/docker-publish.yml/badge.svg)\r\n\r\n[![Discord Shield](https://discordapp.com/api/guilds/903407293541023754/widget.png?style=banner2)](https://discord.gg/a9cu5t5fKc)\r\n\r\n![Logo](logo.png)\r\n\r\n\r\nIf you manage your Anime with Plex this will allow you to sync your libraries to [AniList](https://anilist.co)  , recommend using Plex with the [HAMA agent](https://github.com/ZeroQI/Hama.bundle) for best Anime name matches.\r\n\r\nUnwatched Anime in Plex will not be synced so only those that have at least one watched episode, updates to AniList are only send with changes so need to worry about messing up watch history.\r\n\r\n\r\nThis version is based on my previous project  [PlexMalSync](https://github.com/RickDB/PlexMALSync) which due to MAL closing their API is no longer working, this might change in the future and if it does will resume working on that again as as well.\r\n\r\n\r\n**If you want test it out first without updating your actual AniList entries check out ``Skip list updating for testing `` from the ``Optional features`` section of this readme**\r\n\r\n## Setup\r\n\r\n### Step 1 - install Python\r\n\r\nMake sure you have Python 3.9 or higher installed:\r\n\r\n[Python homepage](https://www.python.org/)\r\n\r\n\r\n### Step 2 - Download project files\r\n\r\nGet the latest version using your favorite git client or by downloading the latest release from here:\r\n\r\nhttps://github.com/RickDB/PlexAniSync/archive/master.zip\r\n\r\n\r\n### Step 3 - Configuration\r\n\r\nFrom the project directory rename `settings.ini.example` to `settings.ini`, open `settings.ini` with your favorite text editor and edit where needed.\r\n\r\n\r\n#### Plex\r\n\r\nOnly choose one of the authentication methods, MyPlex is the easiest.\r\n\r\n##### MyPlex authentication (prefered)\r\n\r\nFor MyPlex authentication you will need your Plex server name, user name and a Plex token.\r\n\r\nThe method for obtaining a Plex token is described here: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/\r\n\r\nHere is an example for synchronizing the admin account:\r\n\r\n```\r\n[PLEX]\r\nanime_section = Anime\r\nauthentication_method = myplex\r\n\r\nserver = Sadala\r\nmyplex_user = Goku\r\nmyplex_token = abcdef123456789\r\n```\r\n\r\nThis completes the MyPlex authentication and **only** if you want to sync against a specific Plex Home user which isn't the admin user follow the below instructions:\r\n\r\nFor this to work lookup the home username on your Plex server and also fill in your full Plex server URL, for example:\r\n\r\n```\r\n[PLEX]\r\nanime_section = Anime\r\nauthentication_method = myplex\r\n\r\n# MyPlex\r\nserver = Sadala\r\nmyplex_user = John # has to be the Plex admin user acount\r\nmyplex_token = abcdef123456789\r\n\r\n# if you enable home_user_sync it will only sync against that specific Plex home user, it requires the full url of your Plex server just like with the Direct IP method\r\n# home_username is the actual Plex home username and not their e-mail address, this is also case sensitive\r\n\r\nhome_user_sync = True\r\nhome_username = Megumin # the home user account you want to sync with and can not be the admin user\r\nhome_server_base_url = http://127.0.0.1:32400\r\n```\r\n\r\n##### Direct Plex authentication (advanced users)\r\n\r\nThe direct authentication method is for users that don't want to use Plex its online authentication system however is more complex to setup, for this you need to find your token manually:\r\n\r\nhttps://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/\r\n\r\nAfterwards can enter your full Plex site url and above authentication token, for example:\r\n\r\n```\r\n[PLEX]\r\nanime_section = Anime\r\nauthentication_method = direct\r\n\r\nbase_url = http://192.168.1.234:32400\r\ntoken = abcdef123456789\r\n```\r\n\r\n##### Section configuration\r\n\r\nIn the settings file enter your Plex library / section name containing your Anime, for example:\r\n\r\n```\r\n[PLEX]\r\nanime_section = Anime\r\n```\r\n\r\nMultiple libraries are now supported and you separate them by using the pipeline (\"|\") character like so:\r\n\r\n```\r\n[PLEX]\r\nanime_section = Anime|Anime2\r\n```\r\n\r\n#### AniList\r\n\r\nFor AniList you need get a so called `access_token` which you can retrieve via this link and if not logged in will ask you to do so:\r\n\r\nhttps://anilist.co/api/v2/oauth/authorize?client_id=1549\u0026response_type=token\r\n\r\nMake sure to copy the entire key as it is pretty long and paste that in the settings file under 'access_token', no need to enclose it just paste it as-is.\r\n\r\nThe token is only valid for 1 year, so you'll have to repeat this process yearly.\r\n\r\nAfterwards make sure to also fill in your AniList username as well which is your actual username not your e-mail address like for example:\r\n\r\n```\r\n[ANILIST]\r\nusername = GoblinSlayer\r\naccess_token = iLikeToastyGoblins.\r\n```\r\n\r\n### Step 4 - Install requirements\r\n\r\nInstall the addtional requirements using the Python package installer (pip) from within the project folder:\r\n\r\n`pip install -r requirements.txt`\r\n\r\n\r\n### Step 5 - Start syncing\r\n\r\nNow that configuration is finished and requirements have been installed we can finally start the sync script:\r\n\r\n`python PlexAniSync.py`\r\n\r\nDepending on library size and server can take a few minutes to finish, for scheduled syncing you can create a cronjob, systemd timer or windows task which runs it every 30 minutes for instance.\r\n\r\nSee [Systemd service](https://github.com/RickDB/PlexAniSync/wiki/Systemd-service) for a tutorial on how to set up a timer with systemd.\r\n\r\n## Optional features\r\n\r\n### Custom anime mapping\r\n\r\nYou can manually link a Plex title and season to an AniList ID, to do so:\r\n\r\n- From the project folder copy `custom_mappings.yaml.example` to `custom_mappings.yaml`\r\n- Add new entries there in the following format:\r\n\r\n```yaml\r\n  - title: \"Plex title for series\"\r\n    seasons:\r\n      - season: Plex season\r\n        anilist-id: AniList series ID\r\n      - season: Plex season\r\n        anilist-id: AniList series ID\r\n```\r\n\r\nIf the Plex season should be split into 2 seasons, add an optional `start` parameter to each season like this:\r\n\r\n```yaml\r\n  - title: \"Re:ZERO -Starting Life in Another World-\"\r\n    seasons:\r\n      - season: 2\r\n        anilist-id: 108632\r\n        start: 1\r\n      - season: 2\r\n        anilist-id: 119661\r\n        start: 14\r\n```\r\n\r\nEpisodes 1-13 will be mapped to Re:Zero 2nd Season Part 1, episodes 14 and higher will be mapped to Re:Zero 2nd Season Part 2.\r\n\r\n- To find out the AniList ID you can visit the series page and copy it from the site url, like for example My Shield hero has ID 99263:\r\n\r\nhttps://anilist.co/anime/99263/Tate-no-Yuusha-no-Nariagari\r\n\r\n- You can remove any existing entries from the example file as they are purely instructional\r\n- Upon startup it will check if the file is a valid YAML file. The most likely reason it's not is because you didn't put quotes around an anime title with special characters (e.g. \":\") in it.\r\n\r\n#### Duplicate Plex Titles\r\n\r\nFor Plex shows and movies with the same title, use the optional `guid` field in the mapping.\r\n\r\nFor example, both of these Rurouni Kenshin shows are shown as \"Rurouni Kenshin\" in Plex: \r\n\r\n```yaml\r\n  - title: \"Rurouni Kenshin\"\r\n    guid: plex://show/5d9c07ece264b7001fc38094\r\n    seasons:\r\n      - season: 1\r\n        anilist-id: 45\r\n      - season: 2\r\n        anilist-id: 45\r\n      - season: 3\r\n        anilist-id: 45\r\n\r\n  - title: \"Rurouni Kenshin (2023)\"\r\n    guid: plex://show/6330a57e9705fab2b34f656d\r\n    seasons:\r\n      - season: 1\r\n        anilist-id: 142877\r\n```\r\n\r\nWhen the `guid` field is set, the `title` and `synonyms` fields are ignored. However, you should still use different titles for human readability.\r\n\r\nTo find the guid, perform the following steps:\r\n1. Open this URL in an **incognito browser window**: https://app.plex.tv/desktop/#!/search?pivot=top\u0026query=\r\n2. Search for your series or movie and click on the correct entry\r\n3. Copy everything after `metadata%2F`, so for https://app.plex.tv/desktop/#!/provider/tv.plex.provider.discover/details?key=%2Flibrary%2Fmetadata%2F6330a57e9705fab2b34f656d copy `6330a57e9705fab2b34f656d`\r\n4. If it's a TV show, add `plex://show/` before that identifier, for movies use `plex://movie/`\r\n\r\n#### Community mappings\r\n\r\nThere are some mappings provided by the Github community at https://github.com/RickDB/PlexAniSync-Custom-Mappings/. You can use them by specifying `remote-urls` like in the example mapping file.\r\n\r\nIf the local mapping file contains mappings for the same show as the community mapping, the local one will take precedence.\r\n\r\nThe feature of synonyms was introduced for the community mappings where you can specify that a show can have one of multiple titles but should be mapped the same way. See Shaman King (2021) in the example mapping file.\r\n\r\n### Custom settings file location\r\n\r\nIf you want to load a different settings.in file you can do so by supplying it in the first argument like so:\r\n\r\n`python PlexAniSync.py settings_alternate.ini`\r\n\r\nIn case of the Tautulli sync helper script you can do as well, first argument will then be settings filename and second will be the series name like so:\r\n\r\n`python TautulliSyncHelper.py  settings_alternate.ini \u003cplex show name\u003e`\r\n\r\n### Make Plex watched episode count take priority\r\n\r\nBy default if AniList episode count watched is higher than that of Plex it will skip over, this can be overriden with the setting `plex_episode_count_priority`\r\n\r\nWhen set to True it will update the AniList entry if Plex watched episode count is higher than 0 and will not take into account the AniList watched episode count even if that is higher.\r\n\r\n**Use this with caution as normally this isn't required and only meant for certain use cases.**\r\n\r\n### Use Plex ratings for Anilist scores\r\n\r\nIn Plex you can currently rate shows, seasons and episodes with 1 to 5 stars. On the mobile app and if you're part of the [Discover Together Beta](https://www.plex.tv/de/discover-together-beta/), you can also rate in half star increments.\r\n\r\nSet `sync_ratings = True` to automatically set Anilist scores based on the Plex ratings. This will also change the score of shows you've completed in the past.\r\n\r\nIf one or more Plex seasons are mapped to an Anilist entry, the average of the rated seasons will be used. The raw Anilist score will be `number of Plex stars * 20`. So if you rate 1 season with 3.5 stars and another season with 4 stars, the calculated Anilist score will be 75.\r\n\r\nIf the seasons are not rated, the show rating will be used as fallback.\r\n\r\nEpisode ratings are currently not used.\r\n\r\nThe actual score shown in your anime list depends on the scoring system setting at https://anilist.co/settings/lists\r\n\r\n| Scoring system  | Score shown         |\r\n| --------------- | ------------------- |\r\n| 100 Point       | 75                  | \r\n| 10 Point Decimal| 7.5                 |\r\n| 10 Point        | 7 (rounded down)    |\r\n| 5 Star          | 4 stars (rounded up)|\r\n| 3 Point Smiley  | 🙂                  |\r\n\r\nIn all cases, Anilist stores the raw value of 75, so you can change the scoring system at any point without data loss. But beware that 3 Point Smiley scores cannot be accurately converted, so you should avoid it as best as you can.\r\n\r\n### Skip list updating for testing\r\n\r\nIn your settings file there's a setting called `skip_list_update` which you can set to True or False, if set to True it will **NOT** update your AniList which is useful if you want to do a test run to check if everything lines up properly.\r\n\r\n### Tautulli Sync Helper script\r\n\r\nIn the project folder you will find `TautulliSyncHelper.py` which you can use to sync a single Plex show to AniList for use in Tautulli script notifcations (trigger on playback stop).\r\n\r\nUsage is as follows:\r\n\r\n`python TautulliSyncHelper.py \u003cplex show name\u003e`\r\n\r\nDepending on your OS make sure to place the show name between single or double quotes, for more information see the wiki page:\r\n\r\nhttps://github.com/RickDB/PlexAniSync/wiki/Tautulli-sync-script\r\n\r\n## Docker\r\n\r\nPlexAniSync is available as Docker image.\r\n\r\n[PlexAniSync](https://github.com/RickDB/PlexAniSync/pkgs/container/plexanisync)\u003cbr/\u003e\r\n[Documentation](Docker/PlexAniSync/README.md)\r\n\r\nAnother docker container for Tautulli with built-in PlexAniSync can be found here:\u003cbr/\u003e\r\n[Tautulli-PlexAniSync](https://github.com/RickDB/PlexAniSync/pkgs/container/tautulli-plexanisync)\u003cbr/\u003e \r\n[Documentation](Docker/Tautulli/README.md)\r\n\r\n## Requirements\r\n\r\n[Python 3.8 or higher](https://www.python.org/)\r\n\r\n## Support\r\n\r\n**AniList**\r\n\r\nhttps://anilist.co/forum/thread/6443\r\n\r\n**Discord**\r\n\r\nhttps://discord.gg/a9cu5t5fKc\r\n\r\n## Planned\r\n\r\nCurrently planned for future releases:\r\n\r\n- [ ] XREF title matching based on HAMA which uses custom lists and AniDB\r\n- [ ] Add setting to skip updating shows with dropped state on user list\r\n- [ ] Ignore anime list support (based on content rating and / or title)\r\n- [ ] Improve error handling\r\n\r\n## Credits\r\n\r\n[Python-PlexAPI](https://github.com/pkkid/python-plexapi)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRickDB%2FPlexAniSync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRickDB%2FPlexAniSync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRickDB%2FPlexAniSync/lists"}