TheExterminator 1 Posted January 23, 2019 Share Posted January 23, 2019 So when I try to access the playlists endpoint using the url http://myip:8096/emby/Playlists/1/Items?api_key=MYAPIKEY I get an error Unable to cast object of type 'Emby.Server.Implementations.Playlists.PlaylistsFolder' to type 'MediaBrowser.Controller.Playlists.Playlist'. I'm on 4.0.2 Link to comment Share on other sites More sharing options...
Luke 37994 Posted January 23, 2019 Share Posted January 23, 2019 server log? Link to comment Share on other sites More sharing options...
TheExterminator 1 Posted January 23, 2019 Author Share Posted January 23, 2019 I figured out why it wasn't working thanks Link to comment Share on other sites More sharing options...
TheExterminator 1 Posted January 23, 2019 Author Share Posted January 23, 2019 If anyone is interested, I'm working on an app that uses the API to export the playlists in m3u format. Let me know if you're interested Link to comment Share on other sites More sharing options...
Luke 37994 Posted January 23, 2019 Share Posted January 23, 2019 I figured out why it wasn't working thanks What was the solution? Link to comment Share on other sites More sharing options...
TheExterminator 1 Posted January 23, 2019 Author Share Posted January 23, 2019 (edited) I wasn't forming the url correctly. If anyone wants to know what url worked, the url in the format: http://embyurl:8096/emby/Items?format=json&Recursive=true&IncludeItemTypes=Playlist&api_key=MYAPIKEY gives you an object with all playlists. I looped through each playlist in this object and retrieved all of the tracks for the current playlist by calling http://embyurl:8096/emby/Playlists/<playlistid>/Items?Fields=Path&api_key=MYAPIKEY I added Fields=Path because its needed to also include the full path to the track so it can be written to the m3u. I actually finished my app and can now export my Emby playlists in m3u format which can be added to your music folder so it will be picked up as a playlist the next time that you scan your music library. Edited January 23, 2019 by TheExterminator Link to comment Share on other sites More sharing options...
ebr 15186 Posted January 23, 2019 Share Posted January 23, 2019 I actually finished my app and can now export my Emby playlists in m3u format which can be added to your music folder so it will be picked up as a playlist the next time that you scan your music library. What am I missing? If your playlists are in Emby already, why do they need to be exported so that they can be read in by the Emby library scan...? Link to comment Share on other sites More sharing options...
TheExterminator 1 Posted January 24, 2019 Author Share Posted January 24, 2019 (edited) You might of missed my other post but the reason that I did this is because I have 2 playlists that for some reason are stored as XML, not m3u8 and I want to have them all as m3u8. I looked online but didn't find a reliable XML to m3u8 converter so I made my own tool to export the playlists as m3u8 Edited January 24, 2019 by TheExterminator Link to comment Share on other sites More sharing options...
Luke 37994 Posted January 24, 2019 Share Posted January 24, 2019 Truthfully when i have chance i would just like to deprecate our playlist xml and build them based on m3u8. Not sure when I will get to that though. Link to comment Share on other sites More sharing options...
TheExterminator 1 Posted January 24, 2019 Author Share Posted January 24, 2019 Well in the meantime, if anyone has an xml playlist, my app seems to work well at saving playlists as m3u so you can replace your xml playlist Link to comment Share on other sites More sharing options...
ebr 15186 Posted January 24, 2019 Share Posted January 24, 2019 Okay. Thanks for the explanation. Link to comment Share on other sites More sharing options...
Newvalho 0 Posted May 27, 2021 Share Posted May 27, 2021 I know this is an old topic however @TheExterminator, is your xml to m3u conversion available for public usage. I created a playlist within Emby and didn't realize it would save as XML and would like to convert to M3U Link to comment Share on other sites More sharing options...
marcsimus 5 Posted October 14, 2021 Share Posted October 14, 2021 @TheExterminator, I would also be interested in this plugin. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now