Sunday, August 31, 2025

From the treasure chest: Python scripts for specific use cases

 

         

Here are some interesting scripts that aim to help with organizing a music library and specific use cases. Not all may be plex specific, the scripts just caught my eye. Caveat: I haven't tried them out myself unless noted. If you try them, please leave a comment to help others. I plan to update this list from time to time.

Chromatix: Plexamp is an excellent mobile app which can run on desktops - but is not good at that. Chromatix is my favorite when I listen to a specific album. It has a nice UI with a lot of features - not the DJ's and the other stuff dependent on sonic analysis though. In use.

Plex-Music-Organizer: Exporting Plex music metadata and update tags from CSV within the database

AudioMuse AI: Sonic analysis and AI-powered clustering to create smart, tempo and mood based playlists within Jellyfin and Navidrome.

Audiograde: Picks a random album, plays it to help rating its songs.

Plex-mcp-server: transforms libraries into AI-queryable databases



Thursday, June 26, 2025

Discover new Music with LastFM

 

     

The functions of the current streaming providers for discovering new music unfortunately leave to be desired. In my experience, Spotify's algorithm used to be good, but has been changed for the worse. Apple Music does offer the option of listening to music by similar artists, but you can't save it as a playlist. Unfortunately, the integration of Tidal is not continued in Plex.

This is where this script comes in to make such a LastFM function usable for Apple Music. After entering an artist, comparable artists and their tracks or albums are searched for and made available in a file. This does not include artists that can already be found in the plex library. The text file can be read in with a shortcut under ios and a new playlist is generated in apple music.

Sunday, March 23, 2025

Combine playlists

      


If you want to combine 2 or more existing playlists, you will not find a button specifically for that.
Instead you can start playing the first track of  playlist 1 and then select save queue as new items in playlist 2.

Alternatively, you could use a python scriptUsing python would allow you to combine more than just two playlists in one go. This could also be used to realize different sorting options, for example randomly mixing all tracks or sorting them by genre or last play date. An example is this script.

Unfortunately, the year of release of the track is not available as a sorting criterion because the Plex database lacks such a field at track level. If you want to sort in this way, either the original playlists must already be sorted by year or the only option is to export the playlists to an external music management program. There, the tracks can be sorted according to various criteria such as the year of release and the new playlist can be imported back into plex. I have already described how to do this in another article. 



Friday, January 31, 2025

Daylist - Playlists

     


Plex and plexamp already have a number of options for automatically creating playlists: Radios or sound journeys created based on certain criteria. 

The Meloday script, which can be found here, takes a time of day or mood-based approach. Meloday creates playlists for the respective time of day, be it morning, afternoon or late at night. It does this by using tracks that have already been played at those times, and adding tracks with sonic similarities to this framework. 

It even uses artificial intelligence, but not to generate the playlist itself, just to reformulate the names and descriptions of the new playlists.

There are many enthusiastic voices on reddit\/plexamp, even Elan Feingold, one of the founders of Plex, has commented positively - so it's worth giving it a try. 

Tuesday, November 12, 2024

Importing playlists and importing ratings into plex

 

I was recently asked again whether it is possible to import a playlist in .m3u format that exists outside of plex into plex. Also on a regular basis plex users ask whether it is possible to sync track ratings to plex. I have discussed those issues in my blog a while ago but it may be helpful to revisit them now.


Unfortunately, both is not possible out-of-the-box, but there are workarounds. I would like to describe one possible way here. 


Importing playlists

Let us start with importing playlists. Since plex is very picky, you have to proceed very carefully though. The success depends on a number of factors that may be different for each user. That is probably the reason why plex does not offer importing playlists in the first place. 


First of all, it depends on whether plex is running on a Windows or Linux device. In my case, plex runs on a Linux device. So take care that all paths, be it to the .m3u file or  those in the .m3u itself to the .mp3-files comply with Linux conventions. Change the root and any backslashes if you are working in a windows environment for example with the editor. 


Secondly,  I am assuming that the tracks are already in the Plex database and are located at the place mentioned in the m3u. If this is not the case, plex cannot recognize the tracks of course. 


Thirdly, make sure that your .m3u is located somewhere within the folder structure of the Plex library you want the playlist to be added to. If this is not the case, plex cannot see the m3u. 


Now you can use either a curl command or a python script (to be found on github) to import the playlist. I recently tested jaylex32's 's Syncra and it worked well (just make sure that the path to the .m3u is correct, if you are running the .exe on a windows machine. It'll give you a path to the file in windows format and that won't work for a plex server on a linux machine.  


As it may take a while for larger playlists to appear in plex, you may want to reload the playlist view in the web view. 


Importing track ratings

If you want to sync track ratings from the outside world into plex, your first step would be to create one playlist for each rating value, for example one playlist for all your tracks with a Five-Star-Rating. With this playlist, follow the steps to import the playlist to plex. 

As soon as you can see the new playlist, convert it to a collection. You may want to use Casvt's "playlist_to_collection" script for that which is also on github. Once you have the collection, you can tag all the tracks with the rating of your choice. 










Wednesday, May 22, 2024

Sonic Adventure: How to save it as a playlist and more

 




One of the best features of plex and plexamp is the ability to create a smooth audio journey starting with one track and ending with another after an hour or so. You need a server which is able to do a sonic analysis of the tracks in your library and a plex pass to enjoy the feature. 

If you are happy with the journey, you may want to save the track sequence for later which you can do in plexamp by hitting the three dots at the bottom and save the queue as a playlist. 

Or you can create such a playlist right on the server by using a bit of python. This could prove useful, for example, if the two endpoint-tracks are to be determined by certain criteria, such as their genres, certain moods or the date they were added to the library. Here is a link to a script where the user enters the titles of the start and end tracks and has the opportunity to apply filters such as the user rating, the play count or the track genre. Keep in mind that these filters will shorten the resulting playlist, so the outcome very much depends on the size of your library and the filters you apply. If you want the original length of the playlist, leave all filters simply blank. 

Thursday, May 9, 2024

How can I sort the albums in a plex music library in all artist views by regular albums, live albums and compilations in just a few minutes?

 


 . 

Some time ago I mentioned in a post the possibility of choosing between normal albums, live albums, compilations and singles/EPs in the artist view of plex. This is possible because plex can read the RELEASETYPE tag of the audio file. The whole thing looks quite nice, but that is not all. In the plex library, album view, you can filter according to type, e.g. Compilations, Live Albums, Remixes and so forth and also according to format, e.g. album, single, EP. Plexamp, of course, can look at that as well when creating a playlist. 


Those who prefer the differentiating view are faced with the problem that albums already read by plex often have no corresponding tags. This can be done manually with an editor, e.g. mp3tag, but you have to be very careful that you enter the tags exactly as required (e.g. "album;compilation" for a compilation) plex is very picky. Then you also have to refresh the album. This takes a while, first the album disappears from the row of normal albums, then it is sorted correctly with a little delay when you refresh the view. 


However, you can also automate the process using a python script. The python script asks for the name of the album, changes or adds the 'releasetype' tag in the metadata of mp3, flac and mp4 files and finally refreshes the album in plex so that it is regrouped as a live album, compilation or single/EP. The python script is available here