3 releases
0.1.2 | Nov 30, 2023 |
---|---|
0.1.1 | Nov 10, 2023 |
0.1.0 | Oct 10, 2023 |
#1226 in Command line utilities
21 downloads per month
33KB
334 lines
PlexMALScrobbler
PlexMALScrobbler is a Plex webhook listener, which will update anime watch progress to MyAnimeList using it's API.
Installation
Requirements
- Requires Plex Pass to work (webhooks)
- Plex on same server
- MAL API account
From crates.io
- Install PlexMALScrobbler:
cargo install plex-mal-scrobbler
- Copy config.yml.sample sample file to
~/.config/plex-mal-scrobbler/config.yml
- See Configure for configuration
- Configure Plex to send webhooks to PlexMALScrobbler
- When running the program for the first time
- You will be asked to visit a page to allow API access for your account
- After allowing access, app redirect URL specified in the API settings will be opened
- The program wants you to copy the
code
parameter value from the URL
- Run the program again to start scrobbling
- See Usage
From source
- Clone this repo:
git clone https://gitlab.com/miicat/plex-mal-scrobbler.git
- Compile the program:
cargo build --release
- Copy the compiled program (
plex-mal-scrobbler/target/release/plex-mal-scrobbler
) to a folder you will run the program in (e.g.~/plexmalscrobbler/
) - Copy
config.yml.sample
sample file to~/.config/plex-mal-scrobbler/config.yml
- See Configure for configuration
- Configure Plex to send webhooks to PlexMALScrobbler
- When running the program for the first time
- You will be asked to visit a page to allow API access for your account
- After allowing access, app redirect URL specified in the API settings will be opened
- The program wants you to copy the
code
parameter value from the URL
- Run the program again to start scrobbling
- See Usage
Configure
config.yml
The file should be in ~/.config/plex-mal-scrobbler/config.yml
, it will contain your MAL API tokens and other scrobbling related settings
mal_client_id
is MALclient_id
obtained from MAL API page. See [Obtaining MAL API key](###Obtaining MAL API key)plex_users
is a list of users to scrobble. Comment the line out, if you want to scrobble all users (note that all scrobbles will be made for your account)plex_libraries
is a list of libraries to scrobble. Comment the line out, if you want to scrobble all libraries (not recommended)scrobble_last_ep
if enabled, the program will mark anime as complete, after watching last episoderequire_match
if enabled, the program will scrobble anime only if the title matches some anime in your watching listport
port the program will listen on. By default it's8000
- Following fields will be filled by the program, please do not edit
mal_access_token
mal_refresh_token
mal_token_expires_in
test
is testing flag, will print anime update info and won't scrobble if enabled
Example configuration:
mal_client_id: abcd123456789efghijk
plex_users:
- MyNeatUserName22
plex_libraries:
- Anime
- Other animes
scrobble_last_ep: false
require_match: false
test: false
Obtaining MAL API key
- Go to MAL API page
- Click Create ID
- Select other from App Type dropdown field
- Select non-commercial from Commercial / Non-Commercial dropdown field
- Fill all other required fields and submit the form
- If not shown after submitting, click Edit button for the just created MAL API ID/client
- The text next to Client ID is your
mal_client_id
Plex webhook
Plex will send webhooks to your URL whenever you play, pause, stop or scrobble videos on your Plex server. Plex sends scrobble webhook, when you have watched past the 90% mark.
PlexMALScrobbler as the name suggests will only act when getting scrobble webhook.
- Login to Plex
- Go to: Settings -> Webhooks (link)
- Click Add webhook
- Type the URL, where your program will be listening for the webhook to the URL field
- The URL will most likely be
http://127.0.0.1:8000/plex/webhook
- The URL will most likely be
- Click Save Changes to save the webhook
Usage
PlexMALScrobbler will try to match the anime to an anime on your currently watching list
- Have PlexMALScrobbler running in the background
- Add anime you are watching to your currently watching list
- Watch anime (past the 90% mark, usually around 20min in)
- Anime wathing progress will be automatically updated
Contributing
PlexMALScrobbler is free, open-source software licensed under AGPLv3.
You can open issues for bugs you've found or features you think are missing. You can also submit pull requests to this repository.
Authors and acknowledgment
- Miika Launiainen / Miicat_47
Support
If you want to support me, feel free to use paypal
License
This library is licensed under AGPLv3
Dependencies
~21–52MB
~899K SLoC