Jump to content

Recommended Posts

adminExitium
Posted

Auto Sync for Subtitles was recently added in Plex: https://support.plex.tv/articles/auto-sync-subtitles/

It uses the voice activity data so doesn't deal with signs etc. like in ASS subtitles, but it is still a significant improvement, especially when downloading subtitles on demand from OpenSubtitles etc.

  • Like 6
  • Agree 2
  • Thanks 1
  • 2 months later...
AlexandreSOLA
Posted

Hi I do not know if this would help, but I installed this docker image :  https://hub.docker.com/r/domainvault/subsync.smacke

And then used this code : 

#!/bin/bash

/volume1/@appstore/inotify-tools/bin/inotifywait -m -r -e create --format '%w%f' "/movie1" "/movie2" "/series" | while read -r NEW_FILE
do
  if [[ "$NEW_FILE" == *.srt ]]; then
    # Extract the directory and base name
    DIR=$(dirname "$NEW_FILE")
    BASE_NAME=$(basename "$NEW_FILE" | sed -E 's/(\.[0-9]*)?(\.[a-z]{2})?(\.sdh)?(\.forced)?\.srt$//')
    VIDEO_FILE="$DIR/$BASE_NAME.mkv"
    
    if [[ -f "$VIDEO_FILE" ]]; then
    #subsync is used via docker to sync the newly added subtitle. ffsubsync is the container name.  
    sudo docker exec ffsubsync subsync "$VIDEO_FILE" -i "$NEW_FILE" -o "$NEW_FILE" >> log.txt 2>&1
    else
      echo "Video file $VIDEO_FILE not found for subtitle $NEW_FILE" >> log.txt 2>&1
    fi
  fi
done >> log.txt 2>&1

For me it does the trick. Everytime a new .srt is added to my folders with Emby subtitle download feature, then this script is trigerred  and the subtitle is synced to the associated video file. 

It is necessary to install inotifywait also which is available on the synology app store for me. 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...