azam / jellyfin-plugin-localsubs

Subtitle provider plugin for local subtitle files on Jellyfin
GNU General Public License v3.0
9 stars 0 forks source link

Local Subs

Subtitle provider plugin for a path-configurable local subtitle files for Jellyfin.

Jellyfin by default has a fixed path on detecting subtitle files (srt files, etc.).

This plugin enables importing subtitles from a different path (e.g. in a Subs directory on the media path) by letting library owners to specify where to find subtitles local to the media (video) path via templates.

Templates supports placeholders like filename and language to add a degree of freedom on matching subtitles. For example, a t template of Subs\%fn%.%l%.srt will match to Subs\My.Home.Video.2023.Spanish.srt for media My.Home.Video.2023.mp4. The %l% placeholder will match for 3 variants of language names, the two letter (e.g. es for Spanish), three letter (e.g. spa for Spanish) and english name (e.g. Spanish for Spanish).

Available placeholders are:

Versions

Install plugin version according to your Jellyfin version.

Jellyfin version Plugin version
10.8.* 0.1.*.*
10.9.* 0.2.*.*

Installation

Add repository

The plugin can be installed using a custom plugin repository hosted on Github. This is only done once. To add this repository, follow these steps:

  1. Open Jellyfin admin dashboard and navigate to Plugins.
  2. Select Repositories tab.
  3. Click the plus "+" symbol to add a repository.
  4. Enter Local Subs as the repository name.
  5. Enter https://azam.github.io/jellyfin-plugin-localsubs/repository.json as the repository url.
  6. Click Save.

Install/update plugin

To install or update the plugin, follow these steps:

  1. Open Jellyfin admin dashboard and navigate to Plugins.
  2. Select Catalog tab.
  3. Under Metadata, select Local Subs.
  4. Optional: Select the desired plugin version.
  5. Click Install.
  6. Restart Jellyfin server.

Usage

This plugins depends on a set of string templates to find the desired subtitles. You must define the string templates on the plugin settings page before using it.

Configure templates

  1. Open Jellyfin admin dashboard and navigate to Plugins.
  2. Select Local Subs.
  3. Optional: Add new template.
    1. Type a new template on New template text input.
    2. Click Add.
  4. Optional: Delete existing template.
    1. Select templates to delete.
    2. Click Delete.
  5. Optional: Set default templates. (This will override the current templates)
    1. Click Default.
  6. Optional: Rescan your library to reflect the changes.

Screenshot

Screenshot

Development

DotNet SDK and an editor is the minimum requirement for development.

VS Code launch settings are included to debug the plugin on Jellyfin. Debugging requires a pre-built Jellyfin server and web app. Web app build requires node as well. Simple preparation Powershell script prepare.ps1 is also provided to download and build Jellyfin for debugging purposes.

Debug launch task is provided at .vscode/launch.json and you should change environment specific paths at .vscode/settings.json.

Jellyfin makes it harder to set a custom ffmpeg path, so add the following entry to jellyfin-data/config/encoding.xml to point to your ffmpeg binary.

<EncoderAppPath>C:/path/to/your/ffmpeg/bin/ffmpeg.exe</EncoderAppPath>

Other instructions, please refer to development instructions at jellyfin-plugin-template for detailed steps.

License

GPLv3

Author

Azamshul Azizy azamshul@gmail.com