Skip to content

Special characters not escaped in m3u8 playlist filename #94

@Sharkou-net

Description

@Sharkou-net

Hello there!

I came across a bug while using this version of Zotify (version 1.1.1 from DraftKinner)
I tried to download a playlist with special characters in the name. More specifically, it was the "pipe" character : |

The script has the fonction to sanitize filename of the output folder for the download, but it doesn't apply it to the .m3u8 playlist file.
So when I tried to download the playlist, I got this error as it's not possible to create a file with a pipe in the name:

OSError: [Errno 22] Invalid argument: 'C:\Users\my_user\Music\Zotify Playlists\Roadtrip 2025 | Road trip music | Playlist for driving.m3u8'

I tried to use the --no-playlist-file argument to bypass the problem with no success. It always tried to create that file with the special character in it.

To resolve the problem, I added the "fix_filename" function to the playlist name in the file app.py, line 355 and 358 ( function download_all() )

playlist_file = Path(f"{fix_filename(collection.path)}/{fix_filename(collection.name)}.m3u8")

Image

It's an easy fix to avoid future error when downloading some playlist with special characters in it! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions