There are a number of ways to do this which I’ll address, I’ve done this with a Windows client and Plex on TrueNAS.
- Using PLEX Import Playlist app maintained on github. https://github.com/gregchak/plex-playlist-import
- Command line using CURL
- Batch files using CURL (and what is different to #2)
Using PLEX Import Playlist
The instructions on the github page explain how to identify your section ID and the token needed for this and the other options below.
If the certificate has expired then just post an issue and the developer will update to a new version with a new certificate.
Command line using CURL
You will need the section ID and token as above which you can find the instructions for on many websites so I won’t repeat them here.
Recreate this command replacing your path, token and section ID as well as all the spaces and characters with the URL code for these:
curl -v -k -X POST “https://192.168.0.100:32400/playlists/upload?sectionID=X&path=/your/media/music/artist-name/album-name/artist-name-plus-album-name.m3u&X-Plex-Token=xxxxxxxxxxxxxx” –ssl-no-revoke
Please note you have to replace lots of characters as they are not allowed in URL paths, here is an example of some:
Reserved characters after percent-encoding (https://www.iplocation.net/url-encodes) ! # $ & ‘ ( ) * + , / : ; = ? @ [ ] ÷ %21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D %C3%B7
Reserved characters after percent-encoding (https://www.iplocation.net/url-encodes) | ||||||||||||||||||
! | # | $ | & | ‘ | ( | ) | * | + | , | / | : | ; | = | ? | @ | [ | ] | ÷ |
%21 | %23 | %24 | %26 | %27 | %28 | %29 | %2A | %2B | %2C | %2F | %3A | %3B | %3D | %3F | %40 | %5B | %5D | %C3%B7 |
If you get any CURL errors it will be due to an unacceptable characters in your path so it is a case of trial and error.
Batch files using CURL
….and what is different to the command line? The main difference is you have to double all the quotes and % symbols. Then you have to escape the & with ^ so a batch file command line looks like this:
curl -v -k -X POST “”https://192.168.0.100:32400/playlists/upload?sectionID=X^&path=/your/media/music/artist-name/album-name/artist-name-plus-album-name.m3u^&X-Plex-Token=xxxxxxxxxxxxxxxxxxx“” –ssl-no-revoke
- “”https…..
- ^&path
- ^&X-Plex-
- “” –ssl-no-revoke
Errors
You should see some codes in the CURL output
- 200 = has worked
- 404 = something wrong in your code, probably a typo or the wrong characters
- 500 = the path to folder or file doesn’t exist on the server. Scan your library and check filenames and path against the one in your m3u file