Can Plexamp read and use m3u playlists?

Hi,

I can’t get it to work.

I looked up the section ID and tested with browsing to
http://localhost:32400/library/sections/1/all?X-Plex-Token=blablabla

→ I get a XML view with all music artists

I’m using postman and changed “get” to “post” with following URL
http://localhost:32400/playlists/upload?sectionID=1&path=C:\Users\skite\Documents\plexplaylists\list.m3u&X-Plex-Token=blablabla

→ I get an Internal 500 error back?

The path to the list.m3u exists
I already opened postman as administrator

no luck at all :frowning:

the content in list.m3u is tested with ANSI and UTF-8 coding and exists of 1 entry:
\\fietology.zilverlinde.home\stufjes\Music\Albums\Rudimental\Home\112_Rudimental_-_Free.flac

This matches 100% when I look at the XML view in Plex with getinfo on that musicfile

help is welcome

thanks

Log error:

Mar 13, 2019 12:45:42.025 [12684] DEBUG - Request: [127.0.0.1:10632 (Loopback)] POST /playlists/upload?sectionID=1&path=C:%5CUsers%5Cskite%5CDocuments%5Cplexplaylists%5Clist.m3u (8 live) Signed-in Token (stinuz86)
Mar 13, 2019 12:45:42.027 [12684] DEBUG - Added new metadata item (list) with ID 66832
Mar 13, 2019 12:45:42.040 [12684] WARN - Could not find path: C:\Users\skite\Documents\plexplaylists\\fietology.zilverlinde.home\stufjes\Music\Albums\Rudimental\Home\112_Rudimental_-_Free.flac
Mar 13, 2019 12:45:42.040 [12684] ERROR - Playlist importer: Couldn’t import playlist “C:\Users\skite\Documents\plexplaylists\list.m3u”, deleting.
Mar 13, 2019 12:45:42.041 [12684] DEBUG - Destroying metadata item 66832 (list)
Mar 13, 2019 12:45:42.048 [8576] DEBUG - Completed: [127.0.0.1:10632] 500 POST /playlists/upload?sectionID=1&path=C:%5CUsers%5Cskite%5CDocuments%5Cplexplaylists%5Clist.m3u (8 live) 23ms 325 bytes (pipelined: 2)

Hi all! I just finished re-writing the bash script I posted above in Python, this time it’s much more in-depth. It can sync both ways between Plex and .m3u playlists in a local directory. You can find it here, maybe it will work for some of you?

XDGFX,

Thanks for the script. I am a Python newbie, but understand scripts well enough to interpret what they are doing.

That being said, the only thing I had to do to get the scrip to run after filling out all the necessary information was install the requests module.

Here is the breakdown:

  1. Backs up the local playlists
  2. Gets playlists from my Plex server (of which I don’t have any)
  3. Copies the playlists
  4. Finds the new playlists
  5. Sends updated playlist to Plex
  6. Copies updated playlist to the local folder
  7. Says “Complete!”

Again, no errors, but no playlists show up in Plex. What am I missing?

I don’t think you should need to install the module - are you using python 3?

Installed Python 3.7.2. When I ran it out of the box, it complained about the requests module. After I installed the module (python.exe -m pip install requests…I believe this was the command) and after the install, the script worked fine to the point that I received no errors and it appeared to do everything it was supposed to.

Sounds good. @elan can you provide an update on this much desired feature?

No updates, sorry. APIs still exist on the server, but no updates in terms of UI for them being exposed.

Why you guys haven’t added that yet?

1 Like

Here’s a synopsis of what I did over the past two days to import an m3u after reading mutiple posts here and other sites. My m3u file was exported from MusicBee. My Plex runs on a CentOS 7 box.

Find and replace all Windows paths to Linux paths
Find and replace all " " (spaces) with %20
Use POSTMAN on Winodws to upload m3u files through the Plex API
	Google how to find your Plex Music SectionID
	The X-Plex-Token is temporary, use Get Info on a track, open the XML, look in the URL address of the record
	http://{YourIP}:32400/playlists/upload?sectionID={sectionID}&path={Path%20to%20Your%20Music}/{Your%20Playlist%20Name}.m3u&X-Plex-Token=xxxXXxxxxXXXXxxxxXXX

I’ve been keeping an eye on this tread for a year now & have unsuccessfully tried a few of the reported solutions. And by all the activity I see on this thread I have to assume that my request to import m3u playlists is something many many other PLEX users would like to be able to do themselves.
Unfortunately I’m done with it. All I want to do is listen to my music on my computer while I do my work. I’m sticking with Winamp as its so easy to use and reads all my m3u playlists.
PLEX has become an electronic/virtual paperweight.

2 Likes

Yea… like many things in Plexworld… very frustrating.

I’d say 80%+ of people that have an organized music library have several m3u playlists. Almost every other media software plays nice with them. If Plex wants to be considered a serious alternative for music libraries, this is a must. My music is still loaded in Plex, but I rarely listen to it in Plex because of this lack of m3u playlist support.

Please Plex devs… get this one figured out!

4 Likes

I tried everything (with postman etc…) however I just received 500 internal server error every time.

So, finally, Plex how many years do you need to develop a simple m3u import feature? This is frustrating not only me when I see all those comments in this topic.

Thx for having this feature delivered this year.

1 Like

I followed the whole discussion and tried to get it done over hours and hours but did not succeed. I think it must be a tiny fault but I can not figure out where I made the mistake.

I have a pi 3 as plex server.
My laptop runs Windows 10 with chrome and Postman app all latest release.

the Pi 3 has a “128GB” usb drive as media storage and that is mounted to
//media/pi/ as
//media/pi/128GB/

This USB stick root directory contains a folder per book like “THE INNOVATORS” with all its mp3 files

Here is the content of the m3u files saved as utf-8 on my windows laptop

#EXTM3U
#EXTINF:177,Walter Isaacson - 001
//media/pi/128GB/THE%20INNOVATORS/The%20Innovators%20-%20001.mp3

I replaced spaces in the filenames by %20 as recommanded for the pi location

In my postman command I also replaced spaces too and this is the POST command
http://192.168.0.4:32400/playlists/upload?sectionID=21&path=C:\Users\1\THE%20INNOVATORS.m3u&X-Plex-Token=123

In the beginning I had the 500 / 401 or so errors which had gone after changing to utf-8 and taking care for / or \

But it did not work - no playlist imported but also no error in postman.

What can I do now ? thx

While on discussion of m3u, why limit to music/Plexamp?
There’s a ton of news/weather cams/community service type video streams in the world that you can access from an m3u playlist. I happen to use VLC on my computer to watch some (such as any in the US collection of this list).
I want to use Plex for devices that won’t run VLC (Roku/etc.)

1 Like

Getting error 400 Bad request when attempting to use this form code in a html page from a LAN local html server.
I’m not at a spot I can look at logs at the moment, but does anything stand out as incorrect to anyone?


<form action="http://my.server.lan.ip:32400/playlists/upload" method="post"> 
Library section number:<br> 
<input type="text" name="sectionID" value="13"> <br> 
File path:<br> 
<input type="text" name="path" value="D:\PlexCache\M3U_Music.m3u"> <br>
<br> <input type="submit" value="Submit"> </form>

“13” is the key for my music library

@Elan - Will this be included in UNO?

“In case you missed it, UNO is our latest effort to streamline the process of searching, discovering and enjoying your content in your Plex library—no matter the type, no matter the source, no matter the format. It’s an easy, elegant, and powerful system that’s consistent no matter where and how you Plex. It gives you the ultimate control over how you navigate your collection.”

HA, hahaha

It’s not related to the UI refresh, sorry.

Just wanted to chime in here, I’ve managed to use Postman and sending a post to Plex with some success. Though it (for the most part) imports correctly, there is some strange behaviours:

For example with every single playlist I import any playlist it always adds a specific track (’…/Ørjan Nilsen/No Saint Out Of Me/08 Violetta.mp3’, for those wondering) and it cannot be removed without causing issues. If the track is removed the playlist stops working properly, forever saying “Loading” at the bottom on desktop and giving sporadic track totals on mobile. To fix it, you have to use WebTools to download the .m3u8 file from Plex, forcibly remove the offending track, then reimport it. Very very strange.

Even more confusingly if there’s a track listed on the M3U that isn’t in the Plex database, it seems to pick an alternative track at random, rather than just not importing it, which again is a little odd.

I know that this isn’t exposed via any sort of GUI yet, so I presume that it’s currently in testing to be used later, but just thought I’d bring it to everyone’s attention. I’m not sure if this is terribly useful info for you @elan?

I agree everything should be made to work for both our audio and video libraries.

I have used m3u xspf playlists to handle alternate endings in VLC. One file including an ending and an additional file for each alternate ending. The extended VLC m3u xspf functionality allows time parameters per track. Saves space not having the main body of a movie stored twice. For example:
Track 1 is full-movie.file 0:00-(break point);
Track 2 is alternate-scene.file;
Track 3 is full-movie.file (credits)-(end).
As I recall, VLC played these seamlessly.
Implementing something similar in Plex could also be used for commercial skipping to avoid loss of content from incorrectly marked show segments.

Correction - File format I was using was .xspf not .m3u.
This is one for skipping commercials, same file for each track with time options.

<playlist	version="1"
			xmlns="http://xspf.org/ns/0/"
			xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">
	<title>Big Bang Theory</title>
	<!-- album art -->
	<image>file:///Volumes/My%20Book/EyeTV%20Archive/The%20Big%20Bang%20Theory%20-%20The%20Retraction%20Reaction.eyetv/000000001f830a4b.tiff</image>
	
	<trackList>
		<track>
			<title>The Holiday Summation</title>
			<location>file:///Volumes/My%20Book/EyeTV%20Archive/The%20Big%20Bang%20Theory%20-%20The%20Holiday%20Summation.eyetv/000000001e1f235c.mpg</location>
			<extension application="http://www.videolan.org/vlc/playlist/0">
					<vlc:id>1</vlc:id>
					<vlc:option>start-time=0</vlc:option>
					<vlc:option>stop-time=83</vlc:option>
			</extension>
		</track>
		<track>
			<title>(2/4)  0:09:26</title>
			<location>file:///Volumes/My%20Book/EyeTV%20Archive/The%20Big%20Bang%20Theory%20-%20The%20Holiday%20Summation.eyetv/000000001e1f235c.mpg</location>
			<extension application="http://www.videolan.org/vlc/playlist/0">
					<vlc:id>2</vlc:id>
					<vlc:option>start-time=83</vlc:option>
					<vlc:option>stop-time=649</vlc:option>
			</extension>
		</track>
		<track>
			<title>(3/4)  0:09:13</title>
			<location>file:///Volumes/My%20Book/EyeTV%20Archive/The%20Big%20Bang%20Theory%20-%20The%20Holiday%20Summation.eyetv/000000001e1f235c.mpg</location>
			<extension application="http://www.videolan.org/vlc/playlist/0">
					<vlc:id>3</vlc:id>
					<vlc:option>start-time=649</vlc:option>
					<vlc:option>stop-time=1202</vlc:option>
			</extension>
		</track>
		<track>
			<title>(4/4)  0:00:30</title>
			<location>file:///Volumes/My%20Book/EyeTV%20Archive/The%20Big%20Bang%20Theory%20-%20The%20Holiday%20Summation.eyetv/000000001e1f235c.mpg</location>
			<extension application="http://www.videolan.org/vlc/playlist/0">
					<vlc:id>4</vlc:id>
					<vlc:option>start-time=1202</vlc:option>
					<vlc:option>stop-time=1232</vlc:option>
			</extension>
		</track>
		<track>
	</trackList>

	<extension application="http://www.videolan.org/vlc/playlist/0">
			<vlc:node title="Thursday, January 5, 2017 7:59:08 PM">
					<vlc:item tid="1" />
					<vlc:item tid="2" />
					<vlc:item tid="3" />
					<vlc:item tid="4" />
			</vlc:node>
	</extension>
</playlist>
1 Like