Context:
- VLC's M3U parser treats paths without a URL scheme as a relative URL, while every other media player treats them as un-encoded native path names, which means that in VLC any # or % is not URL-encoded when converting the entry into the absolute file URL needed by the VLC playlist. (A relative file URL cannot have a scheme, so there is no way to have a compatible relative playlist with those characters in filenames.)
- The parsing in VLC is intentional, and won't be changed in the in-tree module
- If possible, I'd like to achieve compatibility without having to maintain a fork of the parser
- The simplest fix appears to be checking if the URL is a file URL and, if that file doesn't exist, testing whether URL-encoding any # or apparently-stray % in the URL produces a file that does exist
Is there any hook that can be used either to catch the result from the core parser so I can re-write it there or the URL of the file that's about to be opened? Failing that, is there any way to automatically iterate over the whole playlist? I presume an extension can do that, but the documentation for Lua extensions is "TODO".