[mpg123-users] mpg123 playlist with spaces not working
Brought to you by:
sobukus
From: Will S. <wil...@uw...> - 2022-02-20 20:38:36
|
I´m trying to make a playlist for mpg123 from a directory containing subdirectories. Many of the subdirs and filenames contain spaces. This is using a Raspberry Pi with Raspbian Bullseye, mpg123 1.26.4. I made a playlist where each line is an absolute path enclosed in ¨double quotes¨. mpg123 seems to stop reading the line at the 1st space, and it tells me the file (not really the file, the truncated string) doesn't exist. Whereas, mpg123 does just fine with a single filespec like this: mpg123 "home/me/path to file/a music file.mp3" (The lines in the playlist were like that.) I tried escaping all the spaces with backslashes, eg /home/me/path\ to\ file/a\ music\ file.mp3. mpg123 tells me it can play the file, and it shows me the string it can't play, except all the backslashes have been changed to forward slashes, ie /home/me/path/ to/ file/a/ music/ file.mp3. I´m not much of a bash expert, but in my thrashing around, I got the idea of escaping the spaces with TWO backslashes. mpg123 replaced each \\ with //. It does fine with cat /home/me/path\ to\ file/a\ music\ file.mp3 | mpg123 - Not surprising. I tried putting #M3U as the 1st line of the playlist. That was interesting. It skipped over the 1st file with an error message. The directory name had 2 spaces and the filename had 1 space. It played the 2nd file - in that case, the path had no spaces until the filename, which contained 1 space. I can probably figure out how to write a bash script to change all the directory and file names to remove the spaces But it seems like there must be a way to pass paths full of spaces to mpg123. |