feat(flows): add extractSrtSubtitles plugin #860
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This flow will extract text based subtitle into
.srtfile.Text based
codec_namethat can be converted byffmpegshould works, but for now I hardcoded the supported codecs to besubrip, srt, ass, ssa.It supports detecting
forced,default,hearing_impairedsubtitle and add them to the filename so Plex and Jellyfin can display it correctly.Everything can be tuned in the inputs, like selecting
languages,inputCodecs,enableHI,enableForced,enableDefault,overwriteFile,useISO6391, etc.I needed to include some objects from https://github.com/wooorm/iso-639-2 (because it will need to be also in the server and worker node to use it as npm module), they're just mapping for ISO 639-2 to ISO 639-1 language code. This is because Bazarr create subtitle files using ISO 639-1 instead of ISO 639-2 so some people (myself included) prefer to follow the naming scheme to avoid having multiple files for same language.
Extracted subtitles will be in the same directory as the input file.
I can actually just create this as the ffmpegCommand flow but because this will output subtitle files instead of just a video file I think it's better that it is a standalone flow because it's definitely not compatible with the "Remove Subtitle" flow and it might not even be compatible with other ffmpegCommand flows because of how
ffmpegcommand arguments order matter when you want one command to output multiple files.Also the fact that I personally will use this flow like so:
The flow will output 1 if there are subtitles extracted and 2 if there's no subtitle extracted.