Hi, I’m completely new to Plex channel development, but am very familiar with Python.
I’m trying to create a channel that takes a json file from a hardcoded URL, and takes mp4 streams from that file. That’s the end goal.
So a couple of questions:
Does VideoClipObject support this? I.E. if the url provided is an mp4. Will it work?
Is there a template available somewhere? The one on the development page is not showing up in my channels for some reason. And the development tutorial on this forum only focuses on code, less on the essential files needed to make it show up.
Is there a way to quickly debug without refreshing the library and hoping that it refreshed?
Any and all help would be very much appreciated, thanks!
VideoClipObject is probably what you want it, although there’s a bit more to it. See a tutorial on how to build the metadata.
You need to restart the Plex Server for channels list to update and also sometimes when you make edits to certain areas of the channel code. If the changes you do don’t seem to take any effect, try restarting Plex.
Yes there is. You can view the raw XML output of your channel with your browser, there are log files you can write things to help you understand what’s going on, also there’s a way to unit test channel code and that means the ability to run only certain functions you want to test or debug, although that requires some efforts to setup because it’s not an official way.
The URL where you can see the XML your channel generates would be something like: http://<your_ip_address>:32400/<channel_prefix>/, the prefix is defined in your channel code, in your case it would start with video/. Note about the IP address: since some time ago, Plex doesn’t allow unauthenticated access. There is a way to Change Server Network Authorization Settings (scroll down the page), but it may not work with ‘localhost’ and ‘127.0.0.1’ so you may have to whitelist and use your LAN IP address.
Does VideoClipObject support this? I.E. if the url provided is an mp4. Will it work?
Hi and welcome!
The url value of a VideoClipObject can’t be a direct link to a video file, the value is always a “webpage” that contains the video (embedded for example). From there a URL Service takes over and extracts metadata and the video file.
However, there is a way to write a channel without a URL Service. You still can’t set the url value to a video file, instead you create a callback function that creates the VideoClipObject with all the necessary data.
An example of this can be seen in the Tagesschau channel: https://github.com/plexinc-plugins/Tagesschau.bundle Here the CreateVideoClipObject function is called for every video found in the RSS feed. I creates the VideoClipObject we want and uses the “real” video url for the PartObject.