diff --git a/cutter/cutter/upload_backends.py b/cutter/cutter/upload_backends.py index bb59562..7d8e38d 100644 --- a/cutter/cutter/upload_backends.py +++ b/cutter/cutter/upload_backends.py @@ -171,13 +171,13 @@ class Local(UploadBackend): def upload_video(self, title, description, tags, data): video_id = uuid.uuid4() # make title safe by removing offending characters, replacing with '-' - title = re.sub('[^A-Za-z0-9_]', '-', title) + safe_title = re.sub('[^A-Za-z0-9_]', '-', title) # 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) + filename = '{}-{}.{}'.format(safe_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)), 'w') as f: + with open(os.path.join(self.path, '{}-{}.json'.format(safe_title, video_id)), 'w') as f: f.write(json.dumps({ 'title': title, 'description': description,