Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: I want to save .PLS format playlists (Read 14271 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

I want to save .PLS format playlists

Hi,

I'm a new Foobar2000 user, and wish to preface this post by stating that I LOVE this program! It is vastly superior to any other music player I have ever used, and I'm extremely impressed with its modular, completely customizable, minimalist approach. I love how I can set it up to do exactly what I want--and nothing else! All other music players are "bloatware" by comparison. Fb2k may just be the most impressive piece of software I have ever encountered, anywhere.

Now that I'm through raving, I do have just one small feature request. I have noticed that Fb2k can open .PLS files, but not save them; why is there this limitation, and how can I get around it?

Hitherto, I have always used the .PLS format to save my playlists. I like it better than .M3U for three reasons: (1) my entire 2 TB music collection is already playlisted using this format, and I want to keep that collection consistent going forward (preferably without the need to retroactively convert old playlists to some alternative format, unless there's a clear advantage to the new one); (2) the .PLS format saves all pertinent data about the file (not just location)--admittedly, extd. .M3U can do this as well, but (3) it's the perfect 3-letter extension: ".pls" stands for playlist; what the hell does ".m3u8" stand for?!  I see no advantage to converting, and would rather simply have the ability to save to my trusted format, as I have always done before.

I'm no programmer, but surely it would be trivial to write a plugin giving users this option? . . . I have searched high and low on the internet, yet have been unable to find a PLS component.  Any help in this matter would be greatly appreciated! Thanks in advance.

P.S. Alternatively, if anyone can present cogent arguments as to why extended M3U is even theoretically "better" in any sense, I am willing to listen to reason. They had better be good reasons, though (popularity and compatibility are non-issues for me).  Thanks again!

I want to save .PLS format playlists

Reply #1
foobar natively uses its own playlist format - .fpl . It is readable only by foobar, it is not manually editable (ie. you can not edit it in notepad) but it contains all file's metadata and foobar loads such playlists just in one blingking of your eyes.

I want to save .PLS format playlists

Reply #2
foobar natively uses its own playlist format - .fpl . It is readable only by foobar, it is not manually editable (ie. you can not edit it in notepad) but it contains all file's metadata and foobar loads such playlists just in one blingking of your eyes.


Thanks for (not exactly quite) responding to my post (at all, really). . . .

I had considered mentioning this in another postscript, then deemed it unnecessary, but I stand corrected. I'm not interested in the proprietary format for the following reasons:

(1) I do not ever use metadata (and I remove it from files which contain it): all my files are sorted according to a very rigorous structure, and foldernames/filenames, and the playlists themselves, provide all relevant data about the music. (I also have a single Notes.txt in the folder with albums where additional comments were necessary, such as lineage of the particular remaster, reviews, links to other similar tracks, etc.; though often scans of the liner notes are sufficient for this stuff.) IMHO, metadata is a redundant waste of space and a hassle, even with batch editing.

(2) On that note, FPLs take up considerably more space than other playlist formats. Not that this matters all that much, but in a 2 TB + collection it does add up; and since I have no metadata, anyway, what's the point of using all that extra space? For the same reason I remove metadata, I'd rather every file in there be a few KB smaller if possible.

(3) As you mentioned, it prevents me from being able to edit the files in a text editor, and this is something I actually do want the ability to do, since if I change the name of a file, I can alter it there myself as well without having to redo the entire playlist; and I can replace certain characters in the filenames with special characters there (e.g. ":" and "?"). (This would be the only appeal of metadata to me, but with my playlists there's no need. Besides, I'd rather make those changes once in one file, than redundantly in each individual track.)

(4) It isn't compatible with any other program, and not everyone I share my music with has Foobar (though I will certainly recommend it going forward). When I say popularity of the format is a non-issue for me, I still want to be smart about it. Foobar can open, but not save, PLS; other players can open PLS too, but no other program can even open .FPL. So, that's a step in the wrong direction. ;(

For these 4 reasons, this format provides zero advantage for me over PLS, and I just do not see a reason to switch. So, thanks but no thanks!

Now, where's that plugin for saving .PLS files? I might even be willing to pay for it!

I want to save .PLS format playlists

Reply #3
I don't see any advantage of .PLS over the ubiquitous M3U(8) file format, while the latter has the clear advantage over .PLS in that you can load and save it in foobar2000 (and most other media players). You should reconsider both your choice of playlist format and use of metadata. Storing meta-information on a file in an external file is impractical at best and can lead to catastrophic losses in worst case.
It's only audiophile if it's inconvenient.

I want to save .PLS format playlists

Reply #4
i've never heard of people using .pls playlists for local files??? i've always associated it with online radio.

if you want compatibility with other software, use m3u8.

but if you really must, you can use foo_utils to save a custom text file with any extension you like but it's a bit more effort to setup.

http://foosion.foobar2000.org/components/?...on=0.6.2+beta+6

i think because the component hasn't been updated in some time, you'll find its options hidden under a right click sub-menu named Legacy commands (unsorted).

I want to save .PLS format playlists

Reply #5
By default, M3U stores nothing but the file's location. This is the only plugin I have found which allows one to save Extd. M3U files with Foobar: http://skipyrich.com/wiki/Foobar2000:EXTM3...t_format_plugin It was last updated in 2007. Please note that Extd. M3U is basically the same thing as PLS. No real advantage; I'd consider switching, but only as a last resort, since I know and like PLS.

Storing meta-information on a file in an external file is impractical at best and can lead to catastrophic losses in worst case.

This is absurd. Firstly, meta-information is what .FPL playlists store, not .PLS playlists, so you're a little non sequitur there. Secondly--FYI--here's an example of an entry in one of my playlists:

[blockquote]File5=Albums\Studio\12. Cookin' with the Miles Davis Quintet [1956; XRCD, '98]\5. Tune Up-When Lights Are Low.ape

Title5=5. Tune Up/When Lights Are Low[/blockquote]
"Albums" is a subfolder of Miles Davis, which is a subfolder of Solo Artists/Projects (as oppposed to Bands/Groups, Composers, Soundtracks, Various, etc.) Anyway, via the foldername, alone, I can tell it's his 12th studio album, originally released in 1956, and remastered in XRCD format in 1998. In the filename I have the track number and title of both tunes in the track; the only difference in the playlist, itself, is that I have converted the character separating the two tunes to a forward-slash instead of a hyphen.--There are probably many better examples I could give as to how compulsively thorough my file sorting is, but this is typical.

As you can see, metadata would be superfluous. What other information might I include? (In the liner notes, I have the names of all the people who played with Miles on this album, the label it was released on, etc.) Also, My entire collection is duplicated off-site on a server with a RAID configuration, and every time I change a file on my local copy I change it there as well--a realtime backup. So, what sort of "catastrophic loss" could I possibly be in danger of for the lack of metadata? Likewise, this is hardly "impractical." When I want to find an artist/song, I simply browse to the folder in Explorer and double-click it. I almost don't need playlists at all; I use them as a shortcut (so I don't have to go all the way to the sub-sub folder to get there, and so I can load all the songs at once without dragging the folder to Foobar). They are also useful for linking to files in another artist's folder with whom the current artist collaborated.

True, you can search a library; but you can search in Windows Explorer, too. I have always preferred to do things manually, and to me that's the whole appeal of Foobar in the first place. Anyway, so it can open PLS files; I simply want to know why it can't also save them? Is that such an outrageous feature request?

Thanks for taking the time to respond. I guess I'm just not satisfied with the obvious answers, since they seem more like dodges.

I want to save .PLS format playlists

Reply #6
i've never heard of people using .pls playlists for local files??? i've always associated it with online radio.

As it happens, every radio stream I've ever tuned into employed .m3u or .asx. But this is more than a little irrelevant. . . .

but if you really must, you can use foo_utils to save a custom text file with any extension you like but it's a bit more effort to setup.

So, would I be able to somehow configure it to handle all the formatting as well? (.PLS isn't just an extension, y'know.) I suppose I could create the whole thing from scratch, but the numbers after "Length" aren't quite intuitive for some reason, and for long playlists if I had to specify that manually for each song it would take a while.

I suppose I could just keep Winamp installed solely for the purpose of creating playlists. :-/ That just seems like it should be unnecessary.

I want to save .PLS format playlists

Reply #7
Quote
but if you really must, you can use foo_utils to save a custom text file with any extension you like but it's a bit more effort to setup.

So, would I be able to somehow configure it to handle all the formatting as well? (.PLS isn't just an extension, y'know.) I suppose I could create the whole thing from scratch, but the numbers after "Length" aren't quite intuitive for some reason, and for long playlists if I had to specify that manually for each song it would take a while.

I suppose I could just keep Winamp installed solely for the purpose of creating playlists. :-/ That just seems like it should be unnecessary.


IMHO, marc2003's approach is the most strait-forward way to save current playlist to PLS format. But I guess you'll have to try it first...
The length field, as you probably already know, is track length in seconds, for which you can use %length_seconds% title formatting field.

Another, more exotic, approach would be employing "foobarConverter.jar" from "foobar2000-export" GitHub project. It can decrypt FPL playlists to EXTM3U, so you could for example set foobar playlist's folder as watch folder and assign this command as action to mirror all your current foobar playlists to custom location M3U playlists.
One drawback of this project, is no UTF8 support, but as you have automatic FPL to EXTM3U conversion, making small script to further filter M3U to PLS is trivial task. (Hint: you don't need exact "Length" field for PLS, just bypass it with "-1")

I want to save .PLS format playlists

Reply #8
FYI, here is the preset for foo_utils.
  • Header:
    Code: [Select]
    '['playlist']'$crlf()
    NumberOfEntries=%list_total%$crlf()
    Version=2$crlf()
  • Body:
    Code: [Select]
    // %list_index% is formatted as two digits with leading zero, so reformat.
    $puts(n,$num(%list_index%,1))
    File$get(n)=%path%$crlf()
    // %title% defaults to file name if no title tag is present
    Title$get(n)=%title%$crlf()
    Length$get(n)=%length_seconds%$crlf()
  • Footer: should be empty

I want to save .PLS format playlists

Reply #9
I hacked together a small component which allows to save playlists in PLS format:

Component and source code.

The source code is free as in speech and beer and whatever, so do with it what you like to. I give no warranty that the component will not destroy the solar system, or eat your dog or music files. So please make sure to test the component thoroughly with backups of your files before using it full time.
It's only audiophile if it's inconvenient.

I want to save .PLS format playlists

Reply #10
I hacked together a small component which allows to save playlists in PLS format:

Thanks a million! Your plugin works like a charm.

At the risk of sounding greedy , I do just have two quips about its functionality:

(1) PLS ordinarily lists the relative file path; your plugin lists the complete file path. Since I want the playlists to be functional on my remote copy as well, this won't do. I can of course use Find & Replace in EditPad to fix this manually; but if it's not too much trouble, would it be possible to actually make your plugin less specific?

(2) This plugin doesn't list the Title field, only the File and Length fields. Again, I could add one manually, but that kind of defeats the purpose of having a plugin.

Thanks again for going out of your way to do this for me, I really appreciate it! Also, thanks to everyone else who offered solutions. I'm not a programmer, so I can't really use most of your suggestions, but they do sound quite reasonable and I appreciate having the info.

Cheers


I want to save .PLS format playlists

Reply #12
(2) This plugin doesn't list the Title field, only the File and Length fields. Again, I could add one manually, but that kind of defeats the purpose of having a plugin.
It does, if the track has a title tag...

Fair enough. The way Winamp worked was it always created one anyway; it was just the same as the filename (though without folders/extensions). I could then manually change the occasional special character as needed, after creating the playlist.

That said, I notice Foobar doesn't display alt. characters in the titles when they differ from the filename, anyway (in my case). So, perhaps it isn't even loading PLS files correctly? That is, if it tries to pull fresh info from the disk every time I load a playlist, what's the point of having the playlist? :-/ It's supposed to be a shortcut; I want it to just trust what the list says and not read the disk again until it tries to actually play the file.

Sigh. Maybe you guys are right and I should just start using metadata, after all. I simply don't look forward to adding it to every file in my massive collection, then re-backup those files. . . . Perhaps if I could mass-tag locally and remotely in one pass, or tag everything twice but have it not change the Modified date so that my backup won't initiate (since the files will be identical)? Any suggestions along this line? . . .

Also, that link I provided earlier to the 2007 EXTM3U plugin--is that the best way to go about using that format? Or has someone made a better plugin for that purpose/can the latest version of Foobar use EXTM3U already when metadata is present? Finally, if I use M3U (or FPL), will Foobar skip disk-reading when I load a playlist and just trust what the list says? Alternatively, is there some way to tell it not to do this regardless of the playlist format?

I'm just looking for the most convenient approach in a case where everything is already properly named. Thanks again for all your help.

Edit: It occurs to me that Foobar might not be re-reading from the disk, but rather ignoring the Title field and looking only at the File field. If this is the case, it's still not opening PLS correctly, but at least it's not grinding my disk needlessly either.

I want to save .PLS format playlists

Reply #13
Perhaps if I could mass-tag locally and remotely in one pass, or tag everything twice but have it not change the Modified date so that my backup won't initiate (since the files will be identical)? Any suggestions along this line? . .

You have no control over the last modified tag, but you can back it up using right-click/properties/automatically fill values. Use %last_modified% as source and use whatever made up tag you desire.

(Edit: On a second thought this might not be useful at all, I was thinking about %added% when I wrote this, I believe.)

I want to save .PLS format playlists

Reply #14
Edit: It occurs to me that Foobar might not be re-reading from the disk, but rather ignoring the Title tag and looking only at the File tag. If this is the case, it's still not opening PLS correctly, but at least it's not grinding my disk needlessly either. ;;
As far as foobar2000 is concerned the Title entry in a PLS (or M3U) playlist is just a hint. The definitive source for the file metadata is the tag of the file (ID3, APEv2, Vorbis comment, etc. depending on the file format). foobar2000 uses the modification time of the file to check if its cache contains up-to-date metadata. As the PLS format provides neither a time stamp nor the full metadata of the file, foobar2000 just ignores the Title entry.

I want to save .PLS format playlists

Reply #15
As the PLS format provides neither a time stamp nor the full metadata of the file, foobar2000 just ignores the Title entry.

I see. This explains a lot! I can see that, unless Foobar can be rigged to treat PLS the way Winamp did, there would be no point.

I assume this is also the best reason in favor of using the proprietary format? (M3U doesn't provide timestamps, does it?) I will seriously consider switching to FPL. Can anyone think of any other pros/cons, in terms of FPL vs. M3U?

I want to save .PLS format playlists

Reply #16
I have made a few updates to the plugin (download, details). Please uninstall foo_pls as I renamed the plugin to foo_pls_writer.

Switching to FPL alone is not sufficient as others have mentioned before. You would have to tag your files as well. foobar2000 provides tools for mass tagging, but importing the Title entries from your PLS files could be a little tricky. Before you start tagging your audio files and backups you should perhaps look into solutions which allow you to keep the tags for an audio file in a separate file. This way you would only need to back up the tag files and the new playlist files since your audio files would remain unmodified. For example, see m-Tags.

I want to save .PLS format playlists

Reply #17
I have made a few updates to the plugin[.]

This is perfect! The plugin now does everything I could have wanted; thank you, very much.

This way you would only need to back up the tag files [. . .] since your audio files would remain unmodified.

This was the idea behind the way I've been doing playlists hitherto (~15 years), and the reason I wanted to continue to use PLS.

Well, Foobar still ignores the Title field, but perhaps in a future release this can be fixed. For now, I'm content. Thanks again!

I want to save .PLS format playlists

Reply #18
Well, Foobar still ignores the Title field, but perhaps in a future release this can be fixed. For now, I'm content. Thanks again!
Quite unlikely. The plugin implements a handler for PLS files which supports only saving. There already is a built-in handler for PLS files which supports only loading. If the handler in the plugin also implements loading it would be impossible to predict which one is used. foobar2000 randomizes the order in which it checks these handlers at each start-up. (Actually, it does that for more than just playlist handlers. This is to discourage plugin authors from making assumptions about the loading order of plugins.) So half of the time you would get the plugin handler with metadata and the other half of the time you would get the built-in handler without metadata.

I want to save .PLS format playlists

Reply #19
Quite unlikely. The plugin implements a handler for PLS files which supports only saving. There already is a built-in handler for PLS files which supports only loading.

That's what I meant: perhaps in a future release of the main program, itself, it may be decided that Foobar will no longer ignore Title entries? But if not, it's all good. I may still give that centralized tag idea a try, too.

Thanks again for the lovely plugin.

I want to save .PLS format playlists

Reply #20
One final note. Winamp included spaces (line-breaks) between every line of text in a playlist, thus:

[blockquote][playlist]

File1=Albums\EP\2. Jazzanova [1998]\1. Caravelle.ape

Title1=1. Caravelle

Length1=440

File2=Albums\EP\2. Jazzanova [1998]\2. Konklave.ape

Title2=2. Konklave

Length2=504

File3=Albums\EP\2. Jazzanova [1998]\3. Introspection (for M.N.).ape

Title3=3. Introspection (for M.N.)

Length3=386

NumberOfEntries=3

Version=2[/blockquote]

In contrast, the plugin runs all the lines together, like so:

[blockquote][playlist]
NumberOfEntries=3
File1=Albums\EP\2. Jazzanova [1998]\1. Caravelle.ape
Title1=1. Caravelle
Length1=440
File2=Albums\EP\2. Jazzanova [1998]\2. Konklave.ape
Title2=2. Konklave
Length2=504
File3=Albums\EP\2. Jazzanova [1998]\3. Introspection (for M.N.).ape
Title3=3. Introspection (for M.N.)
Length3=386
Version=2[/blockquote]

I actually prefer to eliminate those empty lines, since it saves a few bytes.  However, for the sake of aesthetics, I find myself tempted to add a space just between the separate entries, like so:

[blockquote][playlist]
NumberOfEntries=3

File1=Albums\EP\2. Jazzanova [1998]\1. Caravelle.ape
Title1=1. Caravelle
Length1=440

File2=Albums\EP\2. Jazzanova [1998]\2. Konklave.ape
Title2=2. Konklave
Length2=504

File3=Albums\EP\2. Jazzanova [1998]\3. Introspection (for M.N.).ape
Title3=3. Introspection (for M.N.)
Length3=386

Version=2[/blockquote]

I think that's the easiest to read, don't you? . . . PLS is an elegant format.

I also notice that the plugin bumps "NumberOfEntries" to the top of the file, rather than the bottom. I like this better, too, since it lets you know at the outset how long the list is. Anyway, am I correct in assuming that these things make no technical difference, but are purely a matter of aesthetic preference? (In other words, the playlist doesn't become unreadable by programs other than Foobar just because it lacks spaces or puts the lines in a different order?)

If it makes no difference, then would it be easy to have it space things like in that third example by default?  And perhaps move "Version=2" to the top as well? (Then every entry would be grouped in sets of 3 lines.) . . . It is of course trivial to add spaces manually if and when I edit a given file, and in the meantime it takes up less space, so it's not critical that it be changed in the component.  The perfectionist in me was just wondering.

I know I don't ask for much.  But I will definitely buy you that beer if we ever meet!

I want to save .PLS format playlists

Reply #21
I also notice that the plugin bumps "NumberOfEntries" to the top of the file, rather than the bottom. I like this better, too, since it lets you know at the outset how long the list is. Anyway, am I correct in assuming that these things make no technical difference, but are purely a matter of aesthetic preference? (In other words, the playlist doesn't become unreadable by programs other than Foobar just because it lacks spaces or puts the lines in a different order?)

If it makes no difference, then would it be easy to have it space things like in that third example by default?  And perhaps move "Version=2" to the top as well? (Then every entry would be grouped in sets of 3 lines.) . . . It is of course trivial to add spaces manually if and when I edit a given file, and in the meantime it takes up less space, so it's not critical that it be changed in the component.  The perfectionist in me was just wondering.
The position of "NumberOfEntries" and "Version" have been implemented according to the spec. De facto it most certainly is pretty unimportant where they show up, but it's always more compatible to adhere to the spec.

I know I don't ask for much.  But I will definitely buy you that beer if we ever meet!
I drink beer, too!
It's only audiophile if it's inconvenient.

I want to save .PLS format playlists

Reply #22
De facto it most certainly is pretty unimportant where they show up, but it's always more compatible to adhere to the spec.

I figured. Good to know, and thanks.

P.S.
I thought of an example of how a playlist can be useful, quite apart from metadata or anything else:

[blockquote][playlist]
Version=2
NumberOfEntries=6

File1=Albums\Box\04. The Complete Studio Recordings of The Miles Davis Quintet, 1965-'68 [1998]\3) 01. Nefertiti.ape
Title1=1. Nefertiti
Length1=475

File2=Albums\Box\04. The Complete Studio Recordings of The Miles Davis Quintet, 1965-'68 [1998]\3) 10. Fall.ape
Title2=2. Fall
Length2=398

File3=Albums\Box\04. The Complete Studio Recordings of The Miles Davis Quintet, 1965-'68 [1998]\3) 06. Hand Jive.ape
Title3=3. Hand Jive
Length3=537

File4=Albums\Box\04. The Complete Studio Recordings of The Miles Davis Quintet, 1965-'68 [1998]\3) 08. Madness.ape
Title4=4. Madness
Length4=453

File5=Albums\Box\04. The Complete Studio Recordings of The Miles Davis Quintet, 1965-'68 [1998]\4) 02. Riot.ape
Title5=5. Riot
Length5=185

File6=Albums\Box\04. The Complete Studio Recordings of The Miles Davis Quintet, 1965-'68 [1998]\4) 01. Pinocchio.ape
Title6=6. Pinocchio
Length6=309
[/blockquote]

This is the album Nefertiti by Miles Davis. Note that the tracks are pulled from discs 3 and 4 of a box set which contains that album (along with every other recording made during the phase of Miles' career with that same lineup of musicians). In the Title fields I have re-numbered the tracks to resemble the order of the original album rather than that of the box set. So, in case I ever want to hear Nefertiti with the tracks in proper order, and without all the other albums and alternate takes thrown in, I can do so simply by opening this playlist.

Useful, no?

Thanks again, everyone, for being so helpful. <3

Re: I want to save .PLS format playlists

Reply #23
The PLS Writer plugin works great! 

I've got a playlist of a few dozen streaming radio stations, and the Title tag in pls is imported by foobar2000.  Some stations immediately replace that title, but many don't, and the default name is kind of gibberish.  Saving the playlist as M3U or FPL doesn't save my title, but at least I can easily edit the titles with notepad afterwards.

Thank you Kohlrabi & foosion!