Plex – Export Playlists to M3U

I spent the last year or so cleaning up my music library. It is now organized how I want it to be. I use two software packages to play my music. At home, on my primary computer, I use Clementine (which is also partly how I organized my library). When I’m away from home, I use Plex. With my music library cleaned up, I have started building a few playlists. Many of my playlists are automated; this tutorial doesn’t apply to those. I have started building just a handful of playlists that are very specific. I was building the playlists in both Clementine and Plex and realized that, if I built the playlist in one of the programs, I’d likely want to have the playlist in the other program as well. The problem I was running into is that there is no native way to import or export playlists to Plex.

This sent me down a weird, tangled path. Let me see if I can summarize the situation briefly. Before September 2018, there were some plugins that allowed some playlist import/export functionality. (NOTE: Until writing this post, I didn’t even know there were Plex plugins.) In September of 2018, the Plex developers announced they were discontinuing plugins. That announcement obviously wasn’t that popular with the Plex users who relied on the plugins. Since then, many of the plugins that previously worked have been discontinued and are no longer updated.

Some programmers have switched from developing plugins to developing stand-alone applications that now interface with the Plex Media Server. These applications are no longer installed in the now-defunct “plugins” directory of Plex. One of these applications, WebTools-NG, has a feature that helps partially solve the playlist import/export problem.

(ASIDE: If you google for exporting playlists from Plex, you’ll likely find a few posts or pages from before 2018 indicating that you could click on the context menu inside a playlist in Plex and find an export option. As of the latest version of Plex – I’m currently running 1.22.3.4392 – that option does not exist. So, don’t bother looking for it.)

As I’m on Linux, the WebTools-NG application is an AppImage – nothing to install, just run the AppImage. Download it and put it somewhere where you will remember. You’ll also want to right-click on it and select “Properties.”

In permissions, select “Allow this file to run as a program.”

Once you’ve done that, double-click the application and you’ll get a log in screen that requires your Plex credentials. Fill those out and log in. Assuming everything works, you’ll get a screen like this:

A couple of things to do before you start messing with the playlists. At the top, select your Plex server. You can see I have selected mine:

If you’re like me, you’re probably wondering why you’d need to select your server. It took me a second to realize that some people have multiple servers. That feature exists so people who have multiple servers can select the one they want to work with. Now, go to Global Settings and change two options. First, set your Export Directory and change the “Timeout when requesting info from PMS in sec” to 99. Without changing that, the application was timing out with some of my requests.

Now, to work with the playlists… click on ExportTools on the left and you’ll get this window:

Since I’m working with an audio playlist, in the Select Export Type, I selected “Playlist.”

In Sub Type, I selected “Audio.”

Then you need to Select Media Library. The one I chose for this example is “Favorite Chill.”

Finally, for Export Level, I chose “All” (FYI, I’m not sure what this does. I’ll mess around with it later.)

Then click “Export Media” and you’ll see the Status box light up with your export:

When it’s done, you’ll have a CSV file with all the relevant information from your playlist from Plex. You’ll open that with a spreadsheet program (I’m using LibreOffice Calc) for the next step. With LibreOffice, it asks for the delimiter (the Unicode character that separates data). By default in WebTools-NG, the delimiter is “|”. So, make sure you set that when you open the CSV file. Here’s how in LibreOffice:

Once you’ve done that, open the file and you’ll see lots of columns with lots of information. To create an M3U playlist, we actually just need one column: “Part File Combined.” That has the location of the file:

To make this as easy possible, I’d suggest deleting all of the other columns. Then, once you’ve deleted them all, you’ll need to do one additional step. Since the location of the music files is on my file server and is the absolute location (i.e., relative to where the OS is installed) and is not a relative location (i.e., relative to where the M3U file is stored), you’ll need to adjust that for where you are going to import your M3U file. Let me be a bit more specific. On my fileserver, my music is stored in a folder called “music” (keeping it simple). But that folder is stored on my ZFS raid which is located in the folder “ZFSNAS.” Thus, the absolute location of my music folder is “/ZFSNAS/music/”. That is different on my desktop computer where I am going to be playing the music. On my desktop computer, my music folder is loaded using NFS into a folder called “Music” but that folder is located in a different absolute location, “/home/ryan/Music/”. So, the final and perhaps most complicated step to creating the M3U file is to replace the absolute location from my fileserver with the absolute file location on my desktop computer. That’s easy enough with a Find and Replace command:

Once you’ve don’t that, creating the M3U file is super easy. Save your CSV file that now has just one column with a column header. Now, open that file with a text editor. I’m using Kate. Replace the column header “Part File Combined” with “#EXTM3U”. The file format for M3U file is pretty simple – it has to start with #EXTM3U then can literally just consist of the absolute file location of the files.

Then either save the file with the extension “.m3u” or close the file and replace the “.csv” with “.m3u”. You now have an M3U playlist!

The last step is to import the file into your other application. In my case, this is Clementine. First, open a new Playlist in Clementine. This is important because, when you import the M3U playlist, it will get added to whichever playlist you currently have active.

Then click on “Music” -> “Open File.” At the bottom of that window, choose “M3U playlists.” Find your playlist and select it. Then hit “Open.”

And there you have it – your playlist exported from Plex into Clementine:

If you want to save that playlist in Clementine, just click the “Star” at the top of the Playlist and it will get added to your Playlists. You can also save the playlist as an M3U file and Clementine will format it nice and proper.

Some notes…

This is a bit cumbersome. It sure would be nice of the folks at Plex to add a playlist import/export feature. It really wouldn’t be that hard to do this. A simple walk through process that first imports the M3U playlist then either (a) searches the audio library for matching files or (b) just cuts off the absolute location of the audio files and replaces that with the relative location for the audio library would do this.

I’ve noticed that not every song gets properly imported. I’ll probe that issue but I’m guessing it’s songs that have weird characters in their names that are problematic.

This is obviously just a one-way export feature. Right now, I have only figured out a way to export a playlist from Plex using a third application. I’d really love to be able to import playlists into Plex. If anyone has any thoughts on that, I welcome them. I typically create all my playlists in Clementine. For now, I have to go the other way for custom-built playlists that I want in both locations.

 2,119 total views,  1 views today

Plex – Syncing Media to Devices

I love my Plex server. It works pretty flawlessly with devices like my Roku or allowing me to listen or view my media collection online. However, there are occasionally instances when I know I either won’t have internet access (e.g., on a plane or on a hike) and I want to have access to my media. Plex still has me covered with the option of “syncing” media to my phone. However, the process isn’t all that intuitive. So, here’s my guide to syncing audio and video to a phone/tablet.

First, choosing what to sync is done, from what I can tell, almost exclusively from the device (with some minor exceptions). Basically, you have to install the Plex app on your device, open the Plex app, log into your account on your device, then find the media you want to sync. (I’m not going to cover install, opening, or logging in with this tutorial, just synching.)

Let’s say I want to synchronize my Simon & Garfunkel albums to my phone so I can play their music when I don’t have internet access. I first have to open the Plex app:

This is how the app looks once it’s open and connected to your Plex server.

Make sure it has detected my Plex server (which is called NewPlex):

I circled my server in this image.

Then I have to find my collection of Simon & Garfunkel music in the Music tab (at the bottom of the screen):

To move between different collections, you click the buttons at the bottom of the app. In this screenshot, I was looking at my Music collection.
I have now selected my Simon & Garfunkel songs.

Once I have done that, syncing is pretty easy. Look for the “down arrow” and touch it:

When you do, you’ll get this screen:

You set your synching options on this screen.

You’ll have the option of adjusting the audio quality (this makes a lot of sense if you’ve got your files stored in FLAC on your file server but want to save space on your phone; if so, convert them). You can also dictate how many songs you want to synchronize. If you put a limit, I’m assuming Plex will just randomly select which ones will syncronize (you can also just download specific songs or albums). When you’ve made your decisions, you click on Save and the transfer process will start.

Here’s where things get kind of interesting. You can now open your Plex dashboard and look for your sync progress. To illustrate, I picked an album I have stored in FLAC on my server and started the conversion process:

Your “Conversions” page in the Plex server settings shows you the files that are being prepared to be transferred to your device.

Once your server has converted everything, it will be sent to your device and you’ll see a little arrow in the corner of synchronized albums, like this:

All the white arrows in circles indicate that these albums have been synchronized with my device – so they are stored on my device.

The process is similar for movies. Click on the “Movies” tab at the bottom of the screen to look through your movies. Once you find the one you want to syncronize, click on it. That same “down arrow” will show up:

Click on the down arrow to synchronize the movie to your device.

Click on it and you’ll get one of the same options as before to choose the quality of the synchronized file.

Once you click Save, the conversion process will start on your Plex server:

Here’s the Conversion screen showing my movie converting before transfer to my phone.

Once the conversion is complete, the file will be sent to your device and you’ll see, similarly, an arrow on the movie indicating it is synchronized with your device.

Finally, there are a few secrets to accessing your synchronized content quickly and easily. If/When you find yourself without internet access, or if you just want to see what you have synchronized with your device, you can click on your icon at the top left of the app and select “Offline Browsing”:

Once you do that, only synchronized content will show up in your tabs, like you see below:

You can also click on the “Downloads & Sync” option in that same menu and see the content that is currently synchronized with your device:

And you can check in the settings dashboard in your Plex server to see what content is synchronized with which device (you can synchronize with multiple devices):

This makes it easy to see what content is synchronized to which device

One last bit of advice. If you want to remove content from a device, you can do so on your phone/tablet or on your Plex server. On your phone, go to your Downloads & Sync list, then select the sync you want to delete. When you do, in the upper right corner there will be a trashcan. Click on it and you can delete the sync.

On the Plex server, in the “Sync” tab, hover over the sync and you’ll see a red X. Click on it, and the synchronized files will be deleted from that device

And if you want to remove a device from your account altogether and get rid of all the synchronizations tied to that device, that is done on the Plex server web interface as well. In the Settings menu, click on Authorized Devices, find the device you want to remove and click on the red X.

That will remove all the synchronizations and prevent it from being able to access your Plex server.

This website was helpful in figuring all of this out.

 3,822 total views,  1 views today

Plex – How To Create Smart (auto updating) Music Playlists

I love my Plex server. I stream my music basically around the world (I travel regularly). But it took me a while to figure out how to create playlists that automatically update (i.e., “smart playlists”) based on search filters. At home, I use a native music client (e.g., Strawberry or Clementine) to play my music. Clementine, in particular, has excellent smart playlist functionality, allowing me to create a playlist with all of my music in the “Folk” genre or published between 1970 and 1980. With how amazing Plex is, I figured the same functionality had to be possible. I knew I could simply add songs to a playlist manually, but that seemed cumbersome. I’d rather let the software do it for me. Once I figured it out, I thought I’d make the steps clear for others.

Counter-intuitively, the place to start is not in the “Playlists” option on the Plex dashboard, but in the Music panel.

Click on the Music pane, not the Playlists pane.

You’d think that you would create Playlists in the Playlists area, but you don’t. You create all the Playlists in the Music area.

Once you’re viewing your music, you need to look for a drop-down menu. It’s all the way to the left and says “All” with a little arrow next to it.

Click on the little arrow next to “All” to drop down the menu.

What you want to do is click on “Custom Filter.” That will open this option:

Here’s where you create custom filters.

Using that filter option, you can search for, say, all the music in the Genre “Alternative” or “Classic Rock.” Once you’ve entered your search criteria, click the “APPLY” button on the far right and it will apply your search criteria to your music:

Once you apply the search criteria, Plex will show you the music that fits the criteria.

Now, creating a “Smart Playlist” is just one more step. Look to the right of the window for an icon with four little lines and a plus sign. That is the icon for creating a playlist:

This is the icon you want for creating a playlist.

Clicking that button will open a prompt for you to name the new playlist. I typically name mine based on the search criteria, but you can call them whatever you want:

Now, with your Smart Playlist created, you’ll be able to see it in the Playlist area. Click on “Playlists” in the left menu and, assuming you’ve done everything correctly, you’ll see your newly created playlist there:

All of your playlists are in the Playlists area.

The little gear icon that appears in the top left corner of the playlist indicates that it is a “smart playlist” that will automatically update if you add new music to your library that meet your search criteria. Playing the playlist is as easy as hovering over it and then clicking on the play arrow that appears:

Hover over the playlist, then click on the play arrow to play it.

There you go. You can now create as many playlists as you’d like using filtering/search criteria. (This guide helped me figure this out.)

 20,746 total views,  8 views today