From 67a9ce0a5a07b83cf9b63b4cbcad33f53fde2af1 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Fri, 3 Nov 2023 06:52:58 +1100 Subject: [PATCH] cuter: local upload backends: Use _ instead of - as replacement char This is apparently nicer to deal with in URLs. --- cutter/cutter/upload_backends.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cutter/cutter/upload_backends.py b/cutter/cutter/upload_backends.py index 31124a3..202ea37 100644 --- a/cutter/cutter/upload_backends.py +++ b/cutter/cutter/upload_backends.py @@ -305,8 +305,8 @@ class Local(UploadBackend): def upload_video(self, title, description, tags, public, data): video_id = str(uuid.uuid4()) - # make title safe by removing offending characters, replacing with '-' - safe_title = re.sub('[^A-Za-z0-9_]', '-', title) + # make title safe by removing offending characters, replacing with '_' + safe_title = re.sub('[^A-Za-z0-9_]', '_', title) ext = 'ts' filename = '{}-{}.{}'.format(safe_title, video_id, ext) filepath = os.path.join(self.path, filename) @@ -355,8 +355,8 @@ class LocalArchive(Local): def upload_video(self, title, description, tags, public, data): tempfiles = data - # make title safe by removing offending characters, replacing with '-' - safe_title = re.sub('[^A-Za-z0-9_]', '-', title) + # make title safe by removing offending characters, replacing with '_' + safe_title = re.sub('[^A-Za-z0-9_]', '_', title) # To aid in finding the "latest" version if re-edited, prefix with current time. prefix = str(time.time()) video_dir = "{}-{}".format(prefix, safe_title)