From 3fbbe59b00d21eca6b197f9d778352558f9f3d60 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Thu, 24 Oct 2019 03:45:20 +1100 Subject: [PATCH] cutter Local backend: Fix typo and file extension when full cutting --- cutter/cutter/upload_backends.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cutter/cutter/upload_backends.py b/cutter/cutter/upload_backends.py index bd3a056..bb59562 100644 --- a/cutter/cutter/upload_backends.py +++ b/cutter/cutter/upload_backends.py @@ -172,10 +172,12 @@ class Local(UploadBackend): video_id = uuid.uuid4() # make title safe by removing offending characters, replacing with '-' title = re.sub('[^A-Za-z0-9_]', '-', title) - filename = '{}-{}.ts'.format(title, video_id) # TODO with re-encoding, this ext must change + # If fast cut enabled, use .ts, otherwise use .mp4 + ext = 'ts' if self.encoding_settings is None else 'mp4' + filename = '{}-{}.{}'.format(title, video_id, ext) filepath = os.path.join(self.path, filename) if self.write_info: - with open(os.path.join(self.path, '{}-{}.json'.format(title, video_id))) as f: + with open(os.path.join(self.path, '{}-{}.json'.format(title, video_id)), 'w') as f: f.write(json.dumps({ 'title': title, 'description': description,