diff --git a/autoProcess.ini.sample b/autoProcess.ini.sample index 43c390ac..079262d9 100644 --- a/autoProcess.ini.sample +++ b/autoProcess.ini.sample @@ -42,6 +42,7 @@ download-artwork=True download-subs=False embed-subs=True sub-providers=addic7ed,podnapisi,thesubdb,opensubtitles +permissions=0777 [CouchPotato] host = localhost diff --git a/mkvtomp4.py b/mkvtomp4.py index d8040b31..34d1c53d 100644 --- a/mkvtomp4.py +++ b/mkvtomp4.py @@ -35,7 +35,8 @@ def __init__( self, settings=None, copyto=None, moveto=None, embedsubs=True, - providers=['addic7ed', 'podnapisi', 'thesubdb', 'opensubtitles']): + providers=['addic7ed', 'podnapisi', 'thesubdb', 'opensubtitles'], + permissions=0777): # Settings self.FFMPEG_PATH=FFMPEG_PATH self.FFPROBE_PATH=FFPROBE_PATH @@ -48,6 +49,7 @@ def __init__( self, settings=None, self.copyto=copyto self.moveto=moveto self.relocate_moov=relocate_moov + self.permissions=permissions # Video settings self.video_codec=video_codec self.video_bitrate=video_bitrate @@ -83,6 +85,7 @@ def importSettings(self, settings): self.copyto=settings.copyto self.moveto=settings.moveto self.relocate_moov = settings.relocate_moov + self.permissions = settings.permissions #Video settings self.video_codec=settings.vcodec self.video_bitrate=settings.vbitrate @@ -416,7 +419,7 @@ def convert(self, inputfile, options, reportProgress=False): pass try: - os.chmod(outputfile, 0777) # Set permissions of newly created file + os.chmod(outputfile, self.permissions) # Set permissions of newly created file except: pass return outputfile, inputfile @@ -444,7 +447,7 @@ def QTFS(self, inputfile): try: processor.process(inputfile, outputfile) try: - os.chmod(outputfile, 0777) + os.chmod(outputfile, self.permissions) except: pass # Cleanup diff --git a/readSettings.py b/readSettings.py index 91cb5a45..9894cecf 100644 --- a/readSettings.py +++ b/readSettings.py @@ -51,7 +51,8 @@ def __init__(self, directory, filename): 'download-artwork': 'True', 'download-subs': 'False', 'embed-subs': 'True', - 'sub-providers': 'addic7ed, podnapisi, thesubdb, opensubtitles' } + 'sub-providers': 'addic7ed, podnapisi, thesubdb, opensubtitles', + 'permissions': '777' } # Default settings for CouchPotato cp_defaults = {'host': 'localhost', 'port': '5050', @@ -190,6 +191,12 @@ def __init__(self, directory, filename): self.embedsubs = config.getboolean(section, 'embed-subs') + self.permissions = config.get(section, 'permissions') + try: + self.permissions = int(self.permissions, 8) + except: + self.permissions = 0777 + #Setup variable for maximum audio channels self.maxchannels = config.get(section, 'max-audio-channels') if self.maxchannels == "":