MatteoGuadrini / mkpl

Make M3U format playlist from command line
https://matteoguadrini.github.io/mkpl
GNU General Public License v3.0
23 stars 2 forks source link

mkpl enhancement - Add argument (option) to replace spaces in filenames with %20 (space code) #12

Open masterofobzene opened 1 week ago

masterofobzene commented 1 week ago

Description

Some files I have struggle to play on mpv, some contain ' or - and this when coupled with spaces or double spaces like somefile what' s going on -seg01.mp3 (note the double spaces before -seg01 makes the player refuse to play.

Proposed names of the parameters (short and long)

Additional context

The idea is to pass the proposed "--safe_names" or "-sn" argument to replace spaces with %20 thus making the example file from above to be added like: somefile%20what'%20s%20going%20on%20-seg01.mp3 thus making the file playable again and bypass mpv's strange tendency to read m3u entries as arguments if the files have spaces or special characters.

MatteoGuadrini commented 1 week ago

Hi @masterofobzene, your idea is very beautiful. I like it. In the next release I can implement it. My suggestion is: -U, --url-chars according to table W3: https://www.w3schools.com/tags/ref_urlencode.ASP

Thanks for the proposal

masterofobzene commented 1 week ago

Hi there! thanks for taking this into account; however I must warn you that after extensive testing on MPV player with my "problematic" files, I have found that this change doesn't make them work. At first I thought that it solved the issues with filenames but it doesn't: MPV still sees the URL name with special characters as commands or who-knows-what and refuses to play the files, its not a problem with spaces, its a problem with MPV trying to play files and reading filenames in a playlist as arguments.

On a side note, I've warned MPV devs of this behavior, but they were more concerned on bullying me for not following their incredibly bureaucratic bug checklist.

This change may be useful for others in other situations though, I don't know.