PlexAutoSkip: Docker image detects intro marker then errors

ERROR - Error seeking
Traceback (most recent call last):
  File "/usr/local/pas/resources/introSkipper.py", line 85, in seekTo
    if self.checkPlayerForMedia(player, mediaWrapper.media):
  File "/usr/local/pas/resources/introSkipper.py", line 102, in checkPlayerForMedia
    return not player.timeline or (player.isPlayingMedia(False) and player.timeline.key == media.key)
  File "/usr/local/pas/venv/lib/python3.6/site-packages/plexapi/client.py", line 584, in timeline
    return next((x for x in self.timelines() if x.state != 'stopped'), None)
  File "/usr/local/pas/venv/lib/python3.6/site-packages/plexapi/client.py", line 576, in timelines
    timelines = self.sendCommand(ClientTimeline.key, wait=wait) or []
  File "/usr/local/pas/venv/lib/python3.6/site-packages/plexapi/client.py", line 231, in sendCommand
    return query(key, headers=headers)
  File "/usr/local/pas/venv/lib/python3.6/site-packages/plexapi/server.py", line 669, in query
    raise BadRequest(message)
plexapi.exceptions.BadRequest: (500) internal_server_error; IP-REMOVED .plex.direct:32400/player/timeline/poll?commandID=338&wait=0 <?xml version='1.0' encoding='utf-8'?> <Response code="2000" status="FrameworkException: Unable to find player with identifier 1c7136cf62378fe0-com-plexapp-android">   <Traceback>Traceback (most recent call last):   File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-f11334058\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-f11334058\System.bundle\Contents\Code\playerservice.py", line 50, in process_remote_command     raise FrameworkException('Unable to find player with identifier %s' % identifier) FrameworkException: Unable to find player with identifier 1c7136cf62378fe0-com-plexapp-android </Traceback> </Response> 

The player is an Nvidia Shield and the Android TV Plex app. Server is Windows, latest public PMS.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 47 (25 by maintainers)

Most upvoted comments

And correct, LAN only for skipping due to API limitations

@mdhiggins I did not need to create a custom IP assignment, I just updated the image 👍

The seekTo API call doesn’t work on non LAN sessions which is how the automatic skipping works.

I have not opened any issues or complained to Plex about this. I believe it’s their intention for security to limit this but you could try to appeal to them.

I don’t have an android phone but according to this

https://support.plex.tv/articles/115002143453-settings-plex-for-android-mobile/

Should be under “Sharing”

Can you test this one more time and make sure things are still working and that I didn’t break anything?

Can confirm it’s working great - and to answer your other question on Reddit, it’s skipping Ads in Recorded content, too.

Perfect 👌🏻

@AndiTails @KnifeFed appreciate all the testing

I just did a huge clean up of the code after figuring out this workaround edefb5eeb34d7aa5e1b0cbc7c16402d77f00a95d

Restructured lots of stuff and simplified things so that these fallbacks and custom clients are called early and then cached and cleaned up all the messy nested exceptions that I had created using recursive functions to handle errors

Can you test this one more time and make sure things are still working and that I didn’t break anything? It seems to be working on all my clients with GDM enabled or disabled and with or without custom clients but just want final confirmation

@AndiTails the custom IP assignment might not be needed anymore either, I wrote some error detection and backup methods that seem to allow access to the player without GDM that’s working now on Android/iOS/Roku on my testing so I would try the latest version first if you’re still having issues

@KnifeFed I have a potential workaround for clients that are having issues or may reside on a separate subnet

Just pushed an update that makes 2 changes

First is a fallback where if you encounter the error you’ve been having it will try and connect to the player using its local IP address and default port instead of using GDM/discovery. In my testing I was able to turn off the GDM option on my server and the recovery method still worked

The other option I added is an additional key for custom.json where you can define your clients IP address and port and instead of accessing the player through the GDM/discovery route it will use the custom IP address. Just make sure the name matches exactly.

These two solutions should allow traversal across subnets and situations where GDM isn’t working

Sample here:

{
    "markers": {
    },
    "allowed": {
        "users": [
        ],
        "keys": [
        ],
        "parents": [
        ],
        "grandparents": [
        ]
    },
    "blocked": {
        "users":[
        ],
        "keys": [
        ],
        "parents": [
        ],
        "grandparents": [
        ]
    },
    "clients": {
        "SHIELD": "http://10.0.1.51:32500"
    }
}

Solution was inspired by this answer https://github.com/pkkid/python-plexapi/issues/776

I am able to reproduce this error by toggling GDM on and off, great work @TChilderhose figuring that out so quickly I also tested toggling the ‘Advertise as player’ option which produces a similar but slightly different error (403 vs 500) I’ve updated the readme to include enabling these options as part of the setup and I’ve also implemented exception catches and logging that instructs people to turn on the respective features depending on the error

Going to close this out for now but please reopen with any issues