Service URL for m3u8 ?

I am getting No service found for URL ‘http://myurl/xyz.m3u8 and AttributeError: ‘NoneType’ object has no attribute ‘sandbox’.

I am using the following code to add the videoclip
oc = ObjectContainer(title2 = title)
oc.add(
VideoClipObject(
url = url,
title = title,
thumb = thumb
))

return oc

My URLs will be either m3u8, mp4 or avi . I don’t understand why would I need URL Service in my case. Any idea ?

* Sorry after looking back at your original post, I realized you hadn’t even created the MediaObject and so I completely rewrote and edited this post*****

Unlike other software, Plex channel plugins do not use the Flash player. So a Plex channel does not just access a web page that plays a video and automatically play that video. In a Plex channel plugin, you may pull metadata like images, titles, and descriptions from the web page that plays a Flash video, but then you have to not only find the actual video file (like the mp4 or m3u8) that is played by Flash on that particular web page, but also build a media object for it. Building the media object with information about the bitrate, resolution, and containers for the media file create an XML file that the Plex player can access to decide how it wants to play that media.

The issue you are running into is because you are just creating a VideoClipObject() and inserting your media file as the value for URL. The url value in a VideoClipObject() is used to include the value of the media webpage (that contains the Flash player) and to call a URL service. Then that URL service uses that URL to find the info and actual media file URL and builds a VideoClipObject() that includes a MediaObject() for all the info for the actual media file. So Plex is searching for the URL service for that URL and since one does not exist, it is failing.

Usually you create a separate URL service when your channel is accessing media webpages (ones that contains a Flash player) that are all from the same base website and you have to pull data from that page to then access additional files, like smils, xml or json, to get the actual URL for the media file (*.mp4 or *.m3u8) and its container info. But if you already have the URLs for the actual media files, it is best to just process them in the channel plugin.

If you already have the actual media file, like the mp4 or m3u8, you want to create a MediaObject() for it as an item value in your VideoClipObject() in order for Plex to play it. The actual media file URL will be the “part” value. But the Plex client also needs to pull the metadata for the play screen first and then access the media object data. So the best thing to do, when you want to process media from within your channel plugin, is to include a separate “CreateObject” function to create the media object. This allows it to loop through twice.

A good basic example of this is HGTV - github.com/plexinc-plugins/HGTV.bundle/blob/master/Contents/Code/init.py#L185. Even though all the videos come from the same base website (www.hgtv.com), the json we use to pull the list of videos includes a direct URL for the mp4, so we do not need a separate URL service find the actual media file played by the web page.

Here is one I created for RSS Feeds that include the direct URLs for media files that can be in a variety of formats, so it shows how I built the containers in the function - github.com/shopgirl284/RSSFeed.bundle/blob/master/Contents/Code/init.py#L286

The include_container is the important part of the function because that is what allows it to loop through twice (see the if/else at the bottom of the function). Also, try to collect as much data about the media as you can to build the media object, since sometimes the Plex client will transcode media it can play directly if there is not enough media data included.