From dfdf8580bed2e3bb079afe83184b5ea49960e112 Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 15 Oct 2023 15:11:39 +0600 Subject: [PATCH] fixed slash handling in file names --- package.json | 2 +- src/modules/processing/services/rutube.js | 4 ++-- src/modules/sub/utils.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 04a81ef8..946476c2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cobalt", "description": "save what you love", - "version": "7.6.1", + "version": "7.6.2", "author": "wukko", "exports": "./src/cobalt.js", "type": "module", diff --git a/src/modules/processing/services/rutube.js b/src/modules/processing/services/rutube.js index 6b0c6071..af99a31d 100644 --- a/src/modules/processing/services/rutube.js +++ b/src/modules/processing/services/rutube.js @@ -22,8 +22,8 @@ export default async function(obj) { bestQuality = m3u8.find((i) => (Number(quality) === i["resolution"].height)); } let fileMetadata = { - title: cleanString(play.title.replace(/\p{Emoji}/gu, '').trim()), - artist: cleanString(play.author.name.replace(/\p{Emoji}/gu, '').trim()), + title: cleanString(play.title.trim()), + artist: cleanString(play.author.name.trim()), } return { diff --git a/src/modules/sub/utils.js b/src/modules/sub/utils.js index 28b6abbd..41ee07db 100644 --- a/src/modules/sub/utils.js +++ b/src/modules/sub/utils.js @@ -75,7 +75,7 @@ export function cleanURL(url, host) { } export function cleanString(string) { for (let i in forbiddenCharsString) { - string = string.replaceAll(forbiddenCharsString[i], '') + string = string.replaceAll("/", "_").replaceAll(forbiddenCharsString[i], '') } return string; }