[solved] Extras from youtube urls (s1001: Network)

Server Version#: Windows 1.21.1.3876
Player Version#: Web 4.47.3 (player doesn’t matter, also tried on shield, roku, etc.)

I am having problem playing extras which are urls. This is only affecting extras, not all videos (so not an issue with pre-rolls as many similar posts suggest).

This is from the metadata agent log when I attempt to play the extra. It is a youtube video and trying to use Plex’s com.plexapp.plugins.youtube from the services bundle. I don’t think there is anything wrong with the agent, as it adds the extra object without any problem. And as you can test for yourself, the url is a real youtube video.

2021-01-20 15:34:38,076 (522c) :  DEBUG (networking:143) - Requesting 'https://www.youtube.com/watch?v=QIOX44m8ktc'
2021-01-20 15:34:38,700 (522c) :  CRITICAL (core:574) - Exception when calling function 'PlayVideo' (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-3c3adfcb4\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 294, in call_named_function
    result = f(*args, **kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-3c3adfcb4\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 85, in __call__
    return self._f(*args, **kwargs)
  File "E:\AppData\Plex Media Server\Plug-ins\Services.bundle\Contents\Service Sets\com.plexapp.plugins.youtube\URL\YouTube\ServiceCode.pys", line 259, in PlayVideo
    params = f.split('&')
MediaNotAvailable: (2001, 'This media is not currently available.')

2021-01-20 15:34:38,703 (522c) :  CRITICAL (core:574) - Exception (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-3c3adfcb4\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 843, in handle_request
    result = f(**d)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-3c3adfcb4\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\handlers\services.py", line 150, in call_service_function
    result = self._core.services._call_named_function_in_service(f_name, service, f_args, f_kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-3c3adfcb4\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\services.py", line 589, 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:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-3c3adfcb4\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\services.py", line 573, 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:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-3c3adfcb4\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 294, in call_named_function
    result = f(*args, **kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-3c3adfcb4\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 85, in __call__
    return self._f(*args, **kwargs)
  File "E:\AppData\Plex Media Server\Plug-ins\Services.bundle\Contents\Service Sets\com.plexapp.plugins.youtube\URL\YouTube\ServiceCode.pys", line 259, in PlayVideo
    params = f.split('&')
MediaNotAvailable: (2001, 'This media is not currently available.')

I tried deleting the Services.bundle and had plex recreate it, but the result was the same.

Does the com.plexapp.plugins.youtube plugin still work or is something wrong on my end? Any help would be appreciated and would really like to avoid downloading all these extras locally when they’re freely available on the web.

This is an example of the code where the extra is created in the metadata agent.

metadata.extras.add(extra_type(title=video_title, url=video_url, thumb=video_thumb))

Where:
extra_type = TrailerObject
video_title = ‘“Die Hard (1988)” Theatrical Trailer #1
video_url = ‘"Die Hard (1988)" Theatrical Trailer #1 - YouTube
video_thumb = ‘https://i.ytimg.com/vi/QIOX44m8ktc/hqdefault.jpg

Support for plugins was removed from Plex a couple years ago.

The Services.bundle is provided by Plex.

He was referring to this. Plex no longer supports using these types of plugins.

Edit - Sorry. Wasn’t reading your post correctly. Yes, that is something provided by Plex but it’s not meant to be used that way.

I just got clarification. Those were the old channels/plugins that Plex had. They no longer work, but the files were never removed from PMS. They can’t be used for what you are trying to do now.

I see, thanks for the clarification.

Does anyone know of any metadata agents that can play trailers from youtube or anything I could use as an example to try generating a service file?

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

I am revisiting this, and getting a slightly different error now.

2022-01-01 23:24:34,707 (4424) :  DEBUG (networking:143) - Requesting 'https://www.youtube.com/watch?v=GfGzCw7v_xo'
2022-01-01 23:24:35,520 (4424) :  CRITICAL (core:574) - Exception when calling function 'PlayVideo' (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-c43dc0277\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 294, in call_named_function
    result = f(*args, **kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-c43dc0277\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 85, in __call__
    return self._f(*args, **kwargs)
  File "E:\AppData\Plex Media Server\Plug-ins\Services.bundle\Contents\Service Sets\com.plexapp.plugins.youtube\URL\YouTube\ServiceCode.pys", line 277, in PlayVideo
    video_url = video_url + '&signature=' + decrypt_signature(map['s'], age_gate=age_gate)
MediaNotAvailable: (2001, 'This media is not currently available.')

2022-01-01 23:24:35,522 (4424) :  CRITICAL (core:574) - Exception (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-c43dc0277\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 843, in handle_request
    result = f(**d)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-c43dc0277\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\handlers\services.py", line 150, in call_service_function
    result = self._core.services._call_named_function_in_service(f_name, service, f_args, f_kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-c43dc0277\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\services.py", line 589, 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:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-c43dc0277\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\services.py", line 573, 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:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-c43dc0277\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 294, in call_named_function
    result = f(*args, **kwargs)
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-c43dc0277\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 85, in __call__
    return self._f(*args, **kwargs)
  File "E:\AppData\Plex Media Server\Plug-ins\Services.bundle\Contents\Service Sets\com.plexapp.plugins.youtube\URL\YouTube\ServiceCode.pys", line 277, in PlayVideo
    video_url = video_url + '&signature=' + decrypt_signature(map['s'], age_gate=age_gate)
MediaNotAvailable: (2001, 'This media is not currently available.')

I’ve also tried YouTubeTV.bundle which includes their own service for YouTube, but still no luck.

The service provided by Plex is partially working, which can be seen by going to this url: http://localhost:32400/system/services/url/lookup?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ

I have checked this related issue but no working solutions provided.

I’d probably buy a second plex pass if this ever gets fixed.

I have created a working YouTube URL service that allows playback of YouTube extras. GitHub - LizardByte/PlexyGlass: Plugin for Plex Media Server, that enables additional URL services, including a working YouTube URL service!

This can be closed.