Uiteindelijk allemaal werkend gekregen met het volgende script:
#!/usr/bin/env python
#
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
#
# Script to rip srt/ssa subtitles out of .mkv files
# Usage: scriptname.py [filename.mkv]
# If the filename isn't specified all .mkv files in the current directory will be processed
# Developed with ffmpeg 2.1.1, you probably want that or higher if this doesn't work
#
##############################################################################
### OPTIONS ###
### NZBGET POST-PROCESSING SCRIPT ###
##############################################################################
import glob, re, argparse, os, sys
from subprocess import call
os.chdir(os.environ['NZBPP_DIRECTORY'])
# Exit codes used by NZBGet
POSTPROCESS_SUCCESS=93
POSTPROCESS_ERROR=94
ffmpeg = '/usr/syno/bin/ffmpeg'
parser = argparse.ArgumentParser(description='Extract subtitles from mkv files.')
parser.add_argument('-f', '--file', help="source filename (mkv) to extract subtitle from")
args = parser.parse_args()
def process(i):
return [ffmpeg, '-i', i, re.sub(r".mkv", ".nl.srt", i)]
if args.file is None:
mkvs = glob.glob("*.mkv")
if (len(mkvs) == 0):
print "No .mkv files in current directory"
for i in mkvs:
call(process(i))
else:
call(process(args.file))
sys.exit(POSTPROCESS_SUCCESS)
Het script exporteert de default sub spoor, in de meeste gevallen zal dit het nl spoor zijn met wat ik download dus voor mij voldoet dit script.
Maar het zal veel geavanceerder kunnen maar voor nu werkt het voor mij.