diff --git a/src/client/components/downloaders/Spotify.ts b/src/client/components/downloaders/Spotify.ts index edc6a45..b18dd25 100644 --- a/src/client/components/downloaders/Spotify.ts +++ b/src/client/components/downloaders/Spotify.ts @@ -188,8 +188,11 @@ class SpotifyDownloader extends Downloader #parseFilename (fileName: string) { - const [ name, ext ] = fileName.split('.'); - const [ artist, song, album ] = name.split('---').map(str => str.trim()); + const match = fileName.match(/(?.+)\W---\W(?.+)\W---\W(?.+)(?\.\w+)$/u); + if (!match || !match.groups) + throw new Error('Unknown file name format'); + + const { artist, song, album, ext } = match.groups; return { fileName, artist,