2.5 Invoking scribbu m3u

scribbu m3u will walk each file and/or directory specified (recursing directories) and print extended M3U entries for each. By default, it will print EXTM3U entries to stdout for all files named (directly or indirectly) on the command line. If an argument is a directory, this command will operate recursively on all files therein (the order of traversal is unspecified).

Each extended M3U entry takes the form:

    # EXINF:<duration-in-seconds>,<display title>
    <path-to-file>

The display title will be "Artist - Title" if those two items can be derived from ID3 tags; otherwise the file basename will be used. The text forming the artist & title tags will be assumed to be in the system locale’s encoding. To override this, specify the -s flag (for source encoding).

The entry’s path will be relative or absolute, according to the argument (i.e. specifying an absolute path to a file or directory will produce absolute paths, a relative path to a file or directory relative paths in the output).

When writing entries to stdout, all text will be written in the system locale’s text encoding.

If the -o option is given, the output will be written to the file named as the option’s value. By convention, files ending in .m3u8 are UTF-8 encoded and files ending in .m3u are written in an unspecified encoding. Given that M3U is a de facto standard, scribbu does not enforce this (or any other naming convention).

In this case, a new file will be created with the #EXTM3U header line, unless the -a (append) flag is given, in which case the output will be appended to the (presumably existing) file.

By default, output will be in the system locale’s text encoding. To force UTF-8 output, specify the -8 option.

So, for instance, if your system locale’s encoding is ISO-8859-1, and your tags are written in, say, Windows Code Page 1251, but you would like an M3U playlist in UTF-8 format, say:

scribbu m3u -s CP1251 -o test.m3u8 -8 some-directory/