Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Client request: Plex Media Server #387
Hi, thanks for getting in touch!.
Plex Media Server support?. Of course, that would be amazing. Actually, I'm a big fan, I've been running a Plex server at home for more than 5 years now. So yes, definitely, you are more than welcome if you would like try. I will be happy to help.
Is there an API and/or clients already implemented? Let me know if you need anything.
I started looking at the code, building it for the first time, getting a feel for things.
I noticed early on that all clients, at a top level, are split between a C and C++ interface and a python one; where the C intrafce is based on the C++ one and it, in turn, is based on the Python one.
Is this a requirement for every client or is the design based on the fact that there already were APIs in Python for them and you wanted to reuse as much as you could?
Your analysis is correct. The cloud client libs are most of them based on pre-existing Python APIs. So I wanted to make used of them. To do that, the Python is encapsulated using a C++-based boost::python wrapper, and that in turn is wrapped on a very thin C adapter, so that the whole thing can be driven from within a C-based OpenMAX IL component.
Finally, the Tizonia player is a C++ application that creates pipelines or "graphs" of OpenMAX IL components, like for example this one:
[ audio_source.http.gmusic ] -> [ audio_decoder.mp3 ] -> [alsa or pulseaudio pcm renderer]
So there really is no requirement to use python at all. It is in use for the sake of re-use what it's already out there.
@kicsyromy : I decided I'd give it a try myself. Please have a look at the 'plex' branch, and your are more than welcome to chip in if you want.
I'm using https://github.com/pkkid/python-plexapi, and the results are looking pretty good.
At the moment only mp3 streams can be played and there are 4 search options: tracks, artist, album and playlist.
I believe other formats could be retrieved from the server, like flac, ogg etc. These are not supported at the moment. Also, I'm trying to investigate an issue with casting of Plex URLs to chromecast devices, see balloob/pychromecast#146
Sorry for the silence, I've bee busy chugging away at porting some old Qt dependent code for interacting with a Plex Media Server to pure C++. This was one of the first steps I wanted to take towards implementing this feature.
Just that progress has been slow with real life stuff getting in the way
I'll check out what you've done, maybe I can pitch in since you decided to go with the python implementation.
Thanks for the heads up
No worries. And thanks for getting back to me.
Yes, I decided to go with the python API because it looked pretty easy and well documented. Since all the existing clients in the project are based on third-party Python apis, it was just a matter of following the familiar pattern.
I'm really struggling with something though. And that is the casting of Plex URLs. The process is this: I first retrieve the streaming URLs from the Plex server and after that, I send the URLs to the Chromecast device for playback. This works with all the other services, GMusic, YouTube, SoundCloud, Dirble. With Plex, I'm currently unable to make this scenario work. The Plex URLs retrieved are good since I can receive the mp3 data from the server when consuming the URL with Tizonia or any other streaming client. But it looks as if the Plex server refused to stream the compressed audio to a Chromecast device using that same URL. As discussed in balloob/pychromecast#146, Plex servers may be producing different URLs for Chromecast devices. I was wondering if you would be familiar with this, by any chance.
Regarding the 'plex' branch, FYI, I'm currently using this as a 'develop' branch, so there is some unrelated stuff that I'm also putting in there. I think I'll start using a dedicated 'develop' branch in the next cycle, but for now, it's all going into 'plex'.