Flawed, but functional :)
If you use discord and want to be automatically notified when Shoko is not able to recognise any media it's found so you can get it added to AniDB, this could be the plugin for you.
This Shoko plugin offers a few different features, some required, some optional. This plugin was built for my own benefit, so forgive me if some things don't make sense.
- Automatic AVDumping of unmatched files (first time unmatched only)
If enabled and provided with a valid webhook URL, when a file cannot be matched by Shoko it will send an embed message to discord.
When a file cannot be automatically matched:
- Provides a link to the
Unrecognised files
utility in the Shoko Web UI. - Provides the result of the AVDump in a copy/paste friendly format.
- Provides links directly to the
Add Release
page for the top three most likely anime matching the file.- If the most directly matching title is R18, you can optionally prevent the message from being sent.
- If any of the top 10 most likely series are R18, you can optionally prevent these individual titles from being linked.
- If a series is deemed by Shoko as being currently airing... It will get bumped to be the first title shown.
- In the footer of the embed, includes:
- The Shoko ID for the file
- The computed CRC for the file.
- If the CRC is not found in the original title of the file... A notification as such will also be shown.
- If the CRC is not found in the original title, the embed colour will also change (not currently configurable).
After a file (previously unmatched) is matched, the previous message will be edited to have:
- A copy of the series poster as a thumbnail
- A link to the series on AniDB
- A link to the episode on AniDB
- A relative timestamp, letting you know in a human-readable format when the file was recognised by Shoko
If enabled, each file that's been handled by this plugin can automatically try get Shoko to match the file again. This can be done in a combination of two ways:
- Scheduled
- Whenever Shoko tries to match a file being managed by the plugin, a future match attempt will be scheduled.
- For each attempt, it will wait
i * 5
minutes before the next attempt is scheduled. - Unless changed, the plugin will only attempt this for up to five match attempts.
- Watching for reactions to the webhook message
- For any webhook sent since Shoko was last restarted, it will check the message state every 15 minutes.
- If the message has any reactions when checked, it will queue a rescan for the file.
- This will continue until there is no reactions, or the file is matched - be warned that this may result in Shoko getting a (temporary) AniDB ban.
File unmatched
File unmatched (Matching CRC not found)
File matched
- Download
WebhookDump.dll
from the latest release (or follow the build instructions to create this) - Find the config directory for Shoko Server.
- Windows:
C:\ProgramData\ShokoServer\
- Docker Compose (recommended on linux):
./shoko-config/Shoko.CLI/
- Linux:
$HOME/.shoko/Shoko.CLI/
- Windows:
- Copy
WebhookDump.dll
into theplugins
directory. You may need to create the directory yourself. - Relaunch Shoko Server (this creates the settings file mentioned below).
- Edit (and save) the configuration file found in the config directory,
WebhookDump.json
. - Relaunch Shoko Server and enjoy!
Everything in the plugin is configured using a JSON file, WebhookDump.json
, created in the Shoko Server config
directory. Unfortunately there's not currently a way of changing the settings in a UI, but who knows what PR's people
may submit?
An example fully configured settings file is shown below
{
"Shoko": {
"ApiKey": "f6207f72-7323-48fd-bbe7-b246a299131e",
"ServerPort": 8111,
"PublicUrl": "https://shoko.mywebsite.com",
"PublicPort": null,
"AutomaticMatch": {
"Enabled": true,
"MaxAttempts": 5,
"WatchReactions": false
}
},
"Webhook": {
"Enabled": false,
"Url": "https://discord.com/api/webhooks/1304522890594488445/XTgEytkQGhHE1w6ANTDavyuJ01ol_2DCt8HAVq0Z6t1wcKscs4rjeJN5qS2kqNf6LSK9",
"Username": "Shoko",
"AvatarUrl": "https://raw.githubusercontent.com/ShokoAnime/ShokoServer/e88bb42b544809334daaf9053ae9582601d90915/.github/images/Shoko.png",
"Matched": {
"MessageText": null,
"EmbedText": "An unmatched file automatically dumped by this plugin has now been matched.",
"EmbedColor": "#57F287"
},
"Unmatched": {
"MessageText": null,
"EmbedText": "The above file has been found by Shoko Server but could not be matched against AniDB. The file has now been dumped with AVDump, result as below.",
"EmbedColor": "#3B82F6"
},
"Restrictions": {
"ShowRestrictedTitles": false,
"PostIfTopMatchRestricted": true
}
}
}
There used to be more documented ways in the past here, but you know what you're doing if you don't want to use this option.
- Log into the Web UI
- Open the Settings.
- Choose the menu option called "API Keys".
- Input a name, click "Generate," and copy the provided key.
- Clone this repository & ensure that at least v8.0 of the .NET Core SDK is installed
- Leave a like, subscribe and smash that bell button
- Run the below commands
dotnet restore
dotnet build -c Release
WebhookDump.dll
should've been built and be ready to copy from thebin/Release/net8.0/
folder.