Jump to content

Recommended Posts

Posted (edited)

Hey guys,

 

I'm wondering if you know a way to automate with lets say Task Scheduler a task which would do the following:

- find all .srt files, set character from iso-8859-1 to iso-8859-2 and then convert and save them to UTF-8?

 

I tried and adapted this script by miquelx,

but I get "sh: line 7: inotifywait: command not found"

#!/bin/bash
# Srt Encoder
WATCH_PATH="/volume1/MOVIES/"
FROM="iso-8859-2"
TO="utf-8"
ICONV="iconv -f $FROM -t $TO"

inotifywait -m --format '%w%f' -e create -e moved_to -e modify -r $WATCH_PATH |
	while read file; do
		EXT=${file##*.}
		if [ $EXT = "srt" ]
		then
			IS_TARGET=`file "${file}" | grep -i iso-8859`
			if [ "$IS_TARGET" != "" ]; then
				echo "${file} ---- Will be converted!"
				cp "${file}" "${file}.bak"
				$ICONV < "${file}.bak" > "${file}"
			fi
		fi
	done

Any help?

Edited by ciss
Posted

Have you tried it in SubtitleEdit ? It has a batch functionality that can pretty much do that in a jiffy.

Posted

thanks, will try it out, but I'd prefer a task/script to be run every hour/s.

  • 4 months later...
Posted

We have a new installation procedure for Synology users. It's very easy and is now on our website:

 

http://emby.media/nas-server.html

 

All Synology users are recommended to use this going forward (if your model supports it).

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...