PLS has no official specification. It is an INI-style text file whose rules were worked out from what players write and accept. The fullest text is The Unofficial M3U and PLS Specification, posted on the Winamp forum in 2001, which this page follows. It is backed by Wikipedia’s description and by the source code of VLC, mpv, Audacious and Totem’s playlist parser, which shows what readers really accept.
Layout
[playlist]
File1=https://radio.example.com/stream
Title1=Example Radio
Length1=-1
File2=Music/First Song.mp3
Title2=Artist Name - First Song
Length2=215
NumberOfEntries=2
Version=2
The file begins with a section header. The entries follow as numbered
key=value lines, with the two summary keys at the end (the Winamp
example puts them there; Audacious and Totem write NumberOfEntries first,
and no reader depends on the position). Each value runs to the end of the line.
Audacious’s INI reader skips a line that begins # or ;
and Totem skips one that begins #; the Winamp text defines no comment.
Keys
| Key | Required | Value | Meaning |
|---|---|---|---|
[playlist] | yes | a section header | Marks the file as a playlist. The Winamp text says it is case sensitive; VLC, mpv, Audacious and Totem all match [playlist] in any case. |
FileN | yes | path or URL | The location of entry N. A local path, an absolute path, a path with environment variables, or a URL. It may point to another playlist. |
TitleN | no | text | A title for entry N. If the file has its own title in its metadata, some players show that instead. |
LengthN | no | integer | The length of entry N in seconds. -1 means indefinite, as for a stream (“it tells the program to ignore the time entry”). |
NumberOfEntries | yes | integer | How many entries there are. The Winamp text says it “should match the last number on the File#, Title# and Length# fields”. VLC only logs it, and Audacious and mpv ignore it. |
Version | yes | 2 | The playlist version. The Winamp text calls it a “required entry near the bottom” that older playlists lacked; Wikipedia says only 2 is valid. VLC only logs it. |
GenreN | no | text | Not in the Winamp text. Some stream directories write it; it is in Totem’s test file missing-items.pls, and Totem’s writer also writes X-GNOME-Title, the title of the whole playlist. |
Numbering and matching
- Entry numbers begin at 1 and are the link between a
Fileand itsTitleandLength. - Case. The Winamp text says every name is case sensitive:
[playlist],File#,Title#,Length#,NumberOfEntriesandVersion. The readers are not: VLC compares every key withstrcasecmp, mpv and Audacious match the section and theFileprefix without regard to case, and Totem lower-cases every key. Real files rely on it: Totem’s test fileBassDrive.plswritesnumberofentriesand itsmissing-items.plswritesfile1. A writer should use the capitalisation above; a reader should accept any. - Which keys are read. Audacious and mpv read only the
Filelines (any key that begins withfile, in file order). VLC readsFile,TitleandLength, takes the number from the key to tell entries apart (so entries need not be consecutive) and logs a warning for a key it does not know. mpv strips double quotes around a value. - Duplicates and gaps. A key that appears twice, or an entry with a
Titlebut noFile, is not defined by the Winamp text. VLC reports an entry with noFileand skips it. Totem’sBassDrive.plsrepeatsLength1for every entry, which shows generators make that mistake.
Paths and portability
Windows and Unix-like systems differ in path separators (\ and
/), drive letters and environment variables, so a playlist with absolute
paths, or paths outside the playlist’s folder, works on only one kind of system. URLs
work on all of them.
Identification and encoding
| Property | Value |
|---|---|
| Extension | .pls |
| Media type | audio/x-scpls |
| Recognising a file | A first line of [playlist], in any case |
| Text encoding | Not stated in the Winamp text or Wikipedia. Practice: VLC reads a line that is not valid UTF-8 as ISO 8859-1; mpv guesses the character set of every line; Totem replaces a non-UTF-8 character with ?. The explorer reads the bytes as UTF-8 and, when they are not valid UTF-8, as Windows-1252, and says which. |
| Line endings | Not stated. Audacious’s INI reader splits at LF and trims the CR; Totem splits at CR and LF; mpv splits at LF and strips white space, so a CR before it goes. For VLC the source read does not show the rule (it uses its own stream line reader). |
| Byte order mark | Not mentioned by any source read; mpv skips a byte order mark and reads UTF-16 when one says so (demux_playlist.c, stream_skip_bom). |
Where the format began
The Winamp Online Documentation, in an excerpt of the book MP3 Power! with Winamp (Frankel, Sawyer and Greely), says: “The PLS format was originally part of the MuseArc program, an earlier player, while M3U was used by the Winplay3 player. The PLS format contains a bit more information, although neither contains a ton of track information.” Wikipedia adds that MuseArc was by codeArts, and that SHOUTcast and Icecast later used the format; the Winamp text does not name codeArts, so that part rests on Wikipedia alone.