Exporting/Adding iTunes Smart Playlists To Plex

Discussion about programs used to manage files and libraries (Foobar2000, iTunes, Musicbee, DeaDBeeF)
Post Reply
Mr.V600
lvl 1
Posts: 272
Joined: Thu Jul 13, 2023 9:50 am

Exporting/Adding iTunes Smart Playlists To Plex

Post by Mr.V600 »

This is how you can export Smart Playlists from iTunes into Plex using an intermediate program called Postman.

This guide based on Windows operating system. You could replace the iTunes part with creating your own m3u files (through scripting or other music programs) and then submitting them to Plex in the same way.

The general idea is as follows:
  1. Create a Music library in Plex that is same files that iTunes sees
  2. Create a playlist on iTunes. In this case I will be using Smart Playlist that looks at the comment field of each track
  3. Export the Playlist as an m3u file
  4. Make sure the file paths in the m3u are the same as Plex will see
  5. Get some system settings from Plex to put into Postman
  6. Send the playlist m3u file to Plex through http request
  7. Close Plex (click in system tray and select Exit on Plex icon, or close task in Windows Task Manager)
  8. Restart Plex (should be an icon in your Start menu)
  9. Playlist should now show up in your music library
  10. Plex does not seem to automatically pick up changes, and iTunes does not export playlist automatically
  11. Will need to periodically resave m3u file for newer tracks added and re-post through Postman to Plex
  12. Restart Plex after each session of updating playlists
  13. The X-Plex-Token does not seem to change very often (hasn't change for me yet)
  14. Can submit multiple playlists to the same Plex music library
  15. Can save the config settings for each playlist in Postman so it's easy to open and submit quickly
Create a Smart Playlist, using the comment field of tracks
smartplaylist 01.jpg
smartplaylist 01.jpg (43.89 KiB) Viewed 130 times
Edit the comment field of the track to have the keywords
smartplaylist 02.jpg
smartplaylist 02.jpg (66.67 KiB) Viewed 130 times
Can edit the comment field in iTunes
smartplaylist 03.jpg
smartplaylist 03.jpg (60.07 KiB) Viewed 130 times
Or in other media programs, like Foobar2000
smartplaylist 04.jpg
Export the playlist in iTunes through File > Library > Export Playlist...
smartplaylist 05.jpg
smartplaylist 05.jpg (74.55 KiB) Viewed 130 times
Be sure to change the file type to m3u. In my experience m3u will properly show UTF-8 kanji characters, so I do not use the m3u8 file type.
smartplaylist 06.jpg
smartplaylist 06.jpg (37.79 KiB) Viewed 130 times
Here is what the exported file looks like
smartplaylist 07.jpg
smartplaylist 07.jpg (127.33 KiB) Viewed 130 times
I use a Notepad++ macro to remove all the comment lines (# at the beginning of the line)
Cleaned up version of file
smartplaylist 08.jpg
smartplaylist 08.jpg (123.54 KiB) Viewed 130 times
Here is what Postman looks like. Create these 3 keys & values.
  1. sectionID
  2. path
  3. X-Plex-Token
smartplaylist 09.jpg
To get the sectionID and X-Plex-Token, click on Get Info of any song in your music library
smartplaylist 10.jpg
smartplaylist 10.jpg (80.79 KiB) Viewed 130 times
Click on View XML
smartplaylist 11.jpg
smartplaylist 11.jpg (61.74 KiB) Viewed 130 times
From the URL of the browser page get the IP Address and Port of Plex as well as the X-Plex-Token from
smartplaylist 12.jpg
smartplaylist 12.jpg (27.01 KiB) Viewed 123 times
Within the XML get the sectionID
smartplaylist 13.jpg
Once you filled everything out, hit Send
If you just get a blank line at the bottom as the response, then everything is ok
smartplaylist 14.jpg
smartplaylist 14.jpg (66.29 KiB) Viewed 123 times
If you get an error, then that means something you typed in is wrong
smartplaylist 15.jpg
smartplaylist 15.jpg (92.32 KiB) Viewed 123 times
Restart Plex server and you should now see Playlists section
smartplaylist 16.jpg
smartplaylist 16.jpg (69.98 KiB) Viewed 130 times
Post Reply