RunScripts
Run Scripts is a Jellyfin Plugin that let's you run custom scripts after events like playback start and stop.
Currently only PlaybackStart
and PlaybackStopped
are implemented.
Plugin Repository
Add the repository to Jellyfin under Dashboard -> Plugins -> Repositories.
- Name: RunScripts Stable
- URL: https://lmaonator.github.io/jellyfin-plugin-runscripts/manifest.json
Usage
Go to the plugin configuration page and set commands for users.
Commands have to be set using absolute paths, eg.
/home/user/scripts/jellyfin.py
.
Commands are simply split by spaces and everything after the
first space is passed as arguments. Escaping spaces or using quotes
will not work, you should handle everything in the script itself
using the environment variable EVENT_ARGS
.
Currently the plugin simply passes the JSON serialized event arguments
(eg PlaybackStopEventArgs
) as an environment variable EVENT_ARGS
.
Properties with null values are ignored during serialization.
You can see the available fields by using a python script like this and checking the Jellyfin log:
#!/usr/bin/env python3
import os
import json
data = json.loads(os.environ["EVENT_ARGS"])
print(json.dumps(data, indent=2))
Use with Docker
The Jellyfin Docker container doesn't come with python or most other scripting languages.
You will have to compile your scripts into standalone executables or mount a portable interpreter into docker and run it with that.
An easy way for python scripts is to make your script standalone with PyInstaller.
Build Process
-
Clone or download this repository
-
Ensure you have .NET Core SDK setup and installed
-
Build the plugin with the following command:
dotnet publish --configuration Release --output bin
- Place
Jellyfin.Plugin.RunScripts.dll
andMedallionShell.dll
into a subdirectoryRunScripts_1.1.0.0
in the Jellyfinplugins
directory