URL Service not found anymore after a while

Hi,

 

I'm new to the API and the framework. I wrote a little channel plugin and a url service. It seems to work (tried with latest iOS and Andriod clients) but after a while (a few minutes) I'm getting "An unknown error occured (0)" on iOS and "The folder seems to be empty" on my Android phone. The log of my plugin shows this error message:

...
2013-04-19 09:19:55,466 (-4b1ae470) :  DEBUG (networking:172) - Requesting 'http://www.sandmaennchen.de/rbb/san/mediabox.media.!etc!medialib!rbb!san!sendung!sendung_20130418_18_miffy.html'
2013-04-19 09:19:55,541 (-4b1ae470) :  DEBUG (networking:172) - Requesting 'http://www.sandmaennchen.de/rbb/san/mediabox.media.!etc!medialib!rbb!san!sendung!sendung_20130418_18_miffy.html'
2013-04-19 09:19:55,610 (-4b1ae470) :  DEBUG (services:602) - No service found for URL 'http://www.sandmaennchen.de/rbb/san/mediabox.media.!etc!medialib!rbb!san!sendung!sendung_20130418_18_miffy.html'
2013-04-19 09:19:55,612 (-4b1ae470) :  DEBUG (services:617) - No matching services found for 'http://www.sandmaennchen.de/rbb/san/mediabox.media.!etc!medialib!rbb!san!sendung!sendung_20130418_18_miffy.html'
2013-04-19 09:19:55,614 (-4b1ae470) :  DEBUG (services:41) - Loading service code for Fallback (URLServiceRecord)
2013-04-19 09:19:56,326 (-4b1ae470) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-04-19 09:19:56,333 (-4b1ae470) :  DEBUG (services:602) - No service found for URL 'http://www.sandmaennchen.de/rbb/san/mediabox.media.!etc!medialib!rbb!san!sendung!sendung_20130418_18_miffy.html'
2013-04-19 09:19:56,339 (-4b1ae470) :  CRITICAL (runtime:943) - Exception when constructing response (most recent call last):
...

My ServiceInfo.plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>



	URL
	
		Sandmann
		
			TestURLs
			
				http://www.sandmaennchen.de
			
			URLPatterns
			
				^http://www.sandmaennchen.de/rbb/san/mediabox.media.+
			
		
	


The ServiceCode.pys file I've attached.

 

What I'm doing wrong? Or do I miss something? Any help would be much appreciated.

Cheers,

Jens

...
2013-04-19 14:03:47,350 (-4b1d7470) :  DEBUG (networking:172) - Requesting 'http://www.sandmaennchen.de/rbb/san/mediabox.media.!etc!medialib!rbb!san!sendung!sendung_20130418_18_miffy.html'
2013-04-19 14:03:47,425 (-4b1d7470) :  DEBUG (networking:172) - Requesting 'http://www.sandmaennchen.de/rbb/san/mediabox.media.!etc!medialib!rbb!san!sendung!sendung_20130418_18_miffy.html'
2013-04-19 14:03:47,493 (-4b1d7470) :  DEBUG (services:615) - Found a service matching 'http://www.sandmaennchen.de/rbb/san/mediabox.media.!etc!medialib!rbb!san!sendung!sendung_20130418_18_miffy.html' - Sandmann (com.plexapp.plugins.sandmann)
2013-04-19 14:03:47,495 (-4b1d7470) :  DEBUG (services:41) - Loading service code for Sandmann (URLServiceRecord)
2013-04-19 14:03:47,614 (-4b1d7470) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-04-19 14:03:47,619 (-4b1d7470) :  DEBUG (services:41) - Loading service code for Fallback (URLServiceRecord)
2013-04-19 14:03:48,322 (-4b1d7470) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-04-19 14:03:48,330 (-4b1d7470) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-04-19 14:03:48,336 (-4b1d7470) :  DEBUG (services:615) - Found a service matching 'http://www.sandmaennchen.de/rbb/san/mediabox.media.!etc!medialib!rbb!san!sendung!sendung_20130418_18_miffy.html' - Sandmann (com.plexapp.plugins.sandmann)
2013-04-19 14:03:48,341 (-4b1d7470) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-04-19 14:03:48,348 (-4b1d7470) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-04-19 14:03:48,353 (-4b1d7470) :  DEBUG (services:615) - Found a service matching 'http://www.sandmaennchen.de/rbb/san/mediabox.media.!etc!medialib!rbb!san!sendung!sendung_20130418_18_miffy.html' - Sandmann (com.plexapp.plugins.sandmann)
2013-04-19 14:03:48,358 (-4b1d7470) :  DEBUG (runtime:49) - Received packed state data (80 bytes)
2013-04-19 14:03:48,364 (-4b1d7470) :  WARNING (objectkit:193) - The 'platforms' attribute is deprecated and should not be assigned.
2013-04-19 14:03:48,365 (-4b1d7470) :  WARNING (objectkit:193) - The 'protocols' attribute is deprecated and should not be assigned.
2013-04-19 14:03:48,367 (-4b1d7470) :  WARNING (objectkit:193) - Media part has no streams - attempting to synthesize
2013-04-19 14:03:48,374 (-4b1d7470) :  DEBUG (runtime:106) - Sending packed state data (109 bytes)
2013-04-19 14:03:48,376 (-4b1d7470) :  DEBUG (runtime:897) - Response: [200] MediaContainer, 1918 bytes

At the moment it works again after I've fixed something regarding the URL pattern in the ServiceInfo.plist:

			URLPatterns
			
				^http://www\.sandmaennchen\.de/rbb/san/mediabox\.media.+
			

Still working after 5 minutes. If this the problem was why did it work anyway?

Another question, I don't think I need a service URL, because it's only one mp4 file on a sub page if the base url, only the name is changeing from day to day.

I've tried this to achive it but it didn't work:

			oc.add(VideoClipObject(rating_key="unsersandmaennchenkey",title="test video",
				items=[MediaObject(
						video_codec = VideoCodec.H264,
						audio_codec = AudioCodec.AAC,
						container = 'mp4',
						parts=[PartObject(
						key="http://http-stream.rbb-online.de/san/sendung/sendung_20130418_18_miffy_m_16_9_512x288.mp4"
						)]
					)]
				)
			)

Cheers,

Jens

EDIT: after trying again after finishing this post I get the same error as mentioned above :(

EDIT: after trying again after finishing this post I get the same error as mentioned above :(

Hi!

Where do you place your URL Service code? Inside your plugin bundle or in the global Services bundle?

I’ve placed it under the global service bundle like Vimeo or YouTube does. Didn’t know that’s also possible to place it under the plugin bundle itself :slight_smile:


Cheers Jens

I've placed it under the global service bundle like Vimeo or YouTube does. Didn't know that's also possible to place it under the plugin bundle itself :)

Hello Jens!

This is probably why your service stops working after a while, because Plex Media Server automatically updates the Services.bundle if it finds changes. You can include a URL Service in your channel/plugin bundle. The structure of the bundle should be:

YourChannelName.bundle
    Contents
        Code
            __init__.py
        Resources
            ....
        Services
            Resources
                ....
            URL
                YourChannelName
                    ServiceCode.pys
            ServiceInfo.plist
        Info.plist

Hello Sander,

thx for your reply. This seems to fix the issue with the non matching URL service after a while.
But now both clients can't play the movie itself anymore. Android just says "Can't play the movie" and the iOS client suggests to connect to a plex media server because the video format can't be understood.
It seems the PMS does not transcode anymore if the service is not placed under the global service bundle :(
Any idea what i can do now to have the PMS transcoding it?


EDIT: Just checked with the OSX PHT client, it shows a message "Unable to play video" but after pressing ok the video starts. I can even resume but before start playing the same message dialog appears.

EDIT2: It seems to work now on all my clients! After restarting my NAS (Qnap). Sorry for the confusion and thx a lot for your help! :)

Cheers,
Jens

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.