mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-01 04:36:02 +00:00
fixed slash handling in file names
This commit is contained in:
parent
f1a35a0c6d
commit
dfdf8580be
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "cobalt",
|
"name": "cobalt",
|
||||||
"description": "save what you love",
|
"description": "save what you love",
|
||||||
"version": "7.6.1",
|
"version": "7.6.2",
|
||||||
"author": "wukko",
|
"author": "wukko",
|
||||||
"exports": "./src/cobalt.js",
|
"exports": "./src/cobalt.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -22,8 +22,8 @@ export default async function(obj) {
|
||||||
bestQuality = m3u8.find((i) => (Number(quality) === i["resolution"].height));
|
bestQuality = m3u8.find((i) => (Number(quality) === i["resolution"].height));
|
||||||
}
|
}
|
||||||
let fileMetadata = {
|
let fileMetadata = {
|
||||||
title: cleanString(play.title.replace(/\p{Emoji}/gu, '').trim()),
|
title: cleanString(play.title.trim()),
|
||||||
artist: cleanString(play.author.name.replace(/\p{Emoji}/gu, '').trim()),
|
artist: cleanString(play.author.name.trim()),
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -75,7 +75,7 @@ export function cleanURL(url, host) {
|
||||||
}
|
}
|
||||||
export function cleanString(string) {
|
export function cleanString(string) {
|
||||||
for (let i in forbiddenCharsString) {
|
for (let i in forbiddenCharsString) {
|
||||||
string = string.replaceAll(forbiddenCharsString[i], '')
|
string = string.replaceAll("/", "_").replaceAll(forbiddenCharsString[i], '')
|
||||||
}
|
}
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue