|
|
@ -171,13 +171,13 @@ class Local(UploadBackend):
|
|
|
|
def upload_video(self, title, description, tags, data):
|
|
|
|
def upload_video(self, title, description, tags, data):
|
|
|
|
video_id = uuid.uuid4()
|
|
|
|
video_id = uuid.uuid4()
|
|
|
|
# make title safe by removing offending characters, replacing with '-'
|
|
|
|
# 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
|
|
|
|
# If fast cut enabled, use .ts, otherwise use .mp4
|
|
|
|
ext = 'ts' if self.encoding_settings is None else '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)
|
|
|
|
filepath = os.path.join(self.path, filename)
|
|
|
|
if self.write_info:
|
|
|
|
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({
|
|
|
|
f.write(json.dumps({
|
|
|
|
'title': title,
|
|
|
|
'title': title,
|
|
|
|
'description': description,
|
|
|
|
'description': description,
|
|
|
|