Cross platform/device compatibility

Hey all, thanks so much for your help over the last few days and putting up with me spamming this forum.   So I've got working prototype of my new channel up and running.  Its for the website KissAnime.com and you can check it out at github or on the forum page.  Just wondering, at this stage, it doesn't seem to be working with any other clients other than PMC so I was curious about cross platform compatibility.  Is there a particular format that works best?  At the moment, the videos are being served as h.264, aac mp4/flv files.  These open fine on PMC but I get an error when using Plex/Web or the Android client.

 

This log from trying in Plex/Web shows that there's obviously a problem with the URL service, but it works fine on PMC?!

 

2013-08-14 14:02:12,091 (1774) :  DEBUG (services:23) - Looking up URL 'http://kissanime.com/Anime/One-Piece/Episode-001?id=13843'
2013-08-14 14:02:12,092 (1774) :  DEBUG (services:615) - Found a service matching 'http://kissanime.com/Anime/One-Piece/Episode-001?id=13843' - KissAnime (com.plexapp.plugins.kissanime)
2013-08-14 14:02:12,092 (1774) :  DEBUG (services:41) - Loading service code for KissAnime (URLServiceRecord)
2013-08-14 14:02:12,108 (1774) :  DEBUG (services:41) - Loading service code for Fallback (URLServiceRecord)
2013-08-14 14:02:12,194 (1774) :  DEBUG (services:615) - Found a service matching 'http://kissanime.com/Anime/One-Piece/Episode-001?id=13843' - KissAnime (com.plexapp.plugins.kissanime)
2013-08-14 14:02:12,196 (1774) :  DEBUG (networking:172) - Requesting 'http://kissanime.com/Anime/One-Piece/Episode-001?id=13843'
2013-08-14 14:02:14,086 (1774) :  CRITICAL (core:561) - Exception when calling function 'MetadataObjectForURL' (most recent call last):
  File "C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 294, in call_named_function
    result = f(*args, **kwargs)
  File "C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\KissAnime.bundle\Contents\Services\URL\KissAnime\ServiceCode.pys", line 10, in MetadataObjectForURL
    meta_data = HTML.ElementFromURL(url.rsplit(["/"[1]])[0])
  File "C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 110, in 
    _getitem_           = lambda x, y: x.__getitem__(y),
IndexError: string index out of range

2013-08-14 14:02:14,086 (1774) : CRITICAL (services:744) - Exception calling function in URL service “KissAnime” (com.plexapp.plugins.kissanime)
2013-08-14 14:02:14,088 (1774) : CRITICAL (core:561) - Exception (most recent call last):
File “C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py”, line 837, in handle_request
result = f(**d)
File “C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\handlers\services.py”, line 26, in url_lookup
c = self._core.services.metadata_object_for_url(url, in_container=True)
File “C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\services.py”, line 724, in metadata_object_for_url
return self._get_result_from_function_for_url(self.metadata_object_for_url_from_service, url, do_normalization, dict(add_items_automatically = add_items_automatically, allow_deferred = allow_deferred, in_container = in_container))
File “C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\services.py”, line 740, in _get_result_from_function_for_url
result = func(url, service, **kwargs)
File “C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\services.py”, line 641, in metadata_object_for_url_from_service
metadata = self._call_named_function_in_service(METADATA_OBJECT_FUNCTION_NAME, service, )
File “C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\services.py”, line 588, in _call_named_function_in_service
return self._call_named_function_in_sandbox(service.sandbox, fname, None, f_args, f_kwargs, allow_deferred, raise_exceptions, f_optional)
File “C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\services.py”, line 572, in _call_named_function_in_sandbox
result = sandbox.call_named_function(fname, allow_deferred=allow_deferred, raise_exceptions=raise_exceptions, args=f_args, kwargs=f_kwargs, mod_name=mod_name, optional_kwargs=f_optional)
File “C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py”, line 294, in call_named_function
result = f(*args, **kwargs)
File “C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\KissAnime.bundle\Contents\Services\URL\KissAnime\ServiceCode.pys”, line 10, in MetadataObjectForURL
meta_data = HTML.ElementFromURL(url.rsplit(["/"[1]])[0])
File “C:\Users\Jamieson\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py”, line 110, in
getitem = lambda x, y: x.getitem(y),
IndexError: string index out of range

2013-08-14 14:02:14,089 (1774) : DEBUG (runtime:106) - Sending packed state data (99 bytes)
2013-08-14 14:02:14,089 (1774) : DEBUG (runtime:911) - Response: [500] 3065 bytes

 

There's an error in the MetadataForURL() fuction of the URL Service. PMC is the only client that doesn't make a request to that function when requesting playback. That's why it's the only client that works for you currently.  You would likely see an error in the log if you tried to get more info about a video in PMC by pressing 'i' on your keyboard. That would hit the MetadataForURL() function and run into the same error you're seeing now.

Looks to me like there are 2 possible problems with line 10 in MetadataObjectForURL. First, it looks like you're passing args to rsplit inside a set of "[]". Try removing those. I also don't think that you should need the '[0]' at the end of that line. I would try it like this:

meta_data = HTML.ElementFromURL(url.rsplit("/",[1])) 

Yep sorry, should have got back here and replied.  Squashed that one myself.  Thanks again.

No worries :)

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