Well the only reason I know this issue exists is because it was logged under system.
2014-03-17 13:28:41,928 (bfc) : DEBUG (runtime:814) - Found route matching /system/services/url/lookup
2014-03-17 13:28:41,928 (bfc) : DEBUG (services:23) - Looking up URL 'http://www.youtube.com/watch?v=JiFnci6qPwE'
2014-03-17 13:28:41,930 (bfc) : DEBUG (services:615) - Found a service matching 'http://www.youtube.com/watch?v=JiFnci6qPwE' - YouTube (com.plexapp.plugins.youtube)
2014-03-17 13:28:41,934 (bfc) : DEBUG (runtime:49) - Received packed state data (80 bytes)
2014-03-17 13:28:41,937 (bfc) : DEBUG (services:615) - Found a service matching 'http://www.youtube.com/watch?v=JiFnci6qPwE' - YouTube (com.plexapp.plugins.youtube)
2014-03-17 13:28:41,940 (bfc) : DEBUG (runtime:49) - Received packed state data (80 bytes)
2014-03-17 13:28:41,953 (bfc) : DEBUG (networking:172) - Requesting 'http://gdata.youtube.com/feeds/api/videos/JiFnci6qPwE?v=2&alt=jsonc'
2014-03-17 13:28:42,051 (bfc) : ERROR (networking:223) - Error opening URL 'http://gdata.youtube.com/feeds/api/videos/JiFnci6qPwE?v=2&alt=jsonc'
2014-03-17 13:28:42,052 (bfc) : CRITICAL (core:561) - Exception when calling function 'MetadataObjectForURL' (most recent call last):
File "C:\Users\No1\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 297, in call_named_function
result = f(*args, **kwargs)
File "C:\Users\No1\AppData\Local\Plex Media Server\Plug-ins\Services.bundle\Contents\Service Sets\com.plexapp.plugins.youtube\URL\YouTube\ServiceCode.pys", line 112, in MetadataObjectForURL
raise Ex.MediaNotAuthorized
MediaNotAuthorized: (2004, 'You are not authorized to access this media.')
2014-03-17 13:28:42,052 (bfc) : CRITICAL (services:744) - Exception calling function in URL service “YouTube” (com.plexapp.plugins.youtube)
2014-03-17 13:28:42,055 (bfc) : CRITICAL (core:561) - Exception (most recent call last):
File “C:\Users\No1\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py”, line 843, in handle_request
result = f(**d)
File “C:\Users\No1\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\No1\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\No1\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\No1\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\No1\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\No1\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\No1\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py”, line 297, in call_named_function
result = f(*args, **kwargs)
File “C:\Users\No1\AppData\Local\Plex Media Server\Plug-ins\Services.bundle\Contents\Service Sets\com.plexapp.plugins.youtube\URL\YouTube\ServiceCode.pys”, line 112, in MetadataObjectForURL
raise Ex.MediaNotAuthorized
MediaNotAuthorized: (2004, ‘You are not authorized to access this media.’)
This does not occur inside of my scripts log at all, just the com.plexapp.system.log file and nothing I do from within my __init__.py seems to catch them?
Initially I was going to write this script without services, then add them in afterwards one at a time as the site I am using embeds players from numerous sources, some of which are not currently compatible. Most of the sources right now are from YouTube, a bunch from Vimeo, and the rest I haven't fully gotten to yet but these random ones are not a huge concern right now.
Currently I am focusing on YouTube and I'd like to add the the objects to the container, and then when pressed have a popup stating it failed due to MediaNotAuthorized, MediaNotAvailable, etc. type errors.
I'm pretty close to something releasable but I'm not really comfortable leaving it to just fail without a cause, especially when as the channel creator I do not have any control on the videos.
Just figure the more detailed I am, the less I'll have to deal with in the long run. ;)
The site I am working on is: http://www.documentaryheaven.com/