mdhiggins / PlexAutoSkip

Automatically skip content in Plex
MIT License
198 stars 11 forks source link

PlexAutoSkip doesn't seem to be able to reach/control my players at all #24

Closed Keagel closed 1 year ago

Keagel commented 1 year ago

Hello,

I've just installed PlexAutoSkip using your docker container but I can't seem to get it to skip anything. I've tried it on both my Apple TV and iPhone and nothing happens.

Here are the logs:

2022-09-08 18:58:58 - __main__ - INFO - /usr/local/pas/venv/bin/python3
2022-09-08 18:58:58 - __main__ - DEBUG - Loading default config file.
2022-09-08 18:58:58 - __main__ - INFO - Loading config file /usr/local/pas/config/config.ini.
2022-09-08 18:58:58 - __main__ - INFO - Loading custom JSON file /usr/local/pas/config/custom.json
2022-09-08 18:58:58 - __main__ - INFO - Connecting to Plex server...
2022-09-08 18:58:59 - __main__ - INFO - Connected to Plex server PLEX Home using plex.tv account
2022-09-08 18:58:59 - __main__ - DEBUG - IntroSeeker init with leftOffset 1000 rightOffset 1000
2022-09-08 18:58:59 - __main__ - DEBUG - Operating in MODE_TYPES.SKIP mode
2022-09-08 18:58:59 - __main__ - DEBUG - Skip tags ['intro', 'commercial', 'advertisement']
2022-09-08 18:58:59 - __main__ - DEBUG - Skip S01E01 SKIP_TYPES.WATCHED
2022-09-08 18:58:59 - __main__ - DEBUG - Skip S**E01 SKIP_TYPES.ALWAYS
2022-09-08 18:58:59 - __main__ - DEBUG - Skip last chapter 0.0
2022-09-08 18:58:59 - __main__ - INFO - Skipper initiated and ready
2022-09-08 18:58:59 - __main__ - DEBUG - Starting listener
2022-09-08 18:58:59 - websocket - WARNING - websocket connected

As you can see there are no messages indicating that it's finding sessions/detecting intros. GDM is enabled on the server and my Apple TV's Plex app has "Advertise as player" set to on. My Plex server is running in a container too for what it's worth (hotio's image), but both containers are on the same subnet.

Do you have any idea of what could be the problem?

Thanks!

mdhiggins commented 1 year ago

Hm looks like its connecting fine, appreciate the debug logs

I would play something on your Apple TV and look at the "Now Playing" section on Plex web and see how and if it's being reported

Based on the logs the script isn't seeing the playback session at all. The logs won't bother listing the session unless it's a LAN session so make sure that Plex is reporting it as such and that it sees it

But in order for the script to work the playback session needs to show up on "Now Playing" and be recognized as Local

image

Keagel commented 1 year ago

Thanks for the answer! That’s exactly right. Plex says it’s a remote connection but it’s my local IP, I guess it’s thrown off by the subnet of the docker network.

mdhiggins commented 1 year ago

Can fix that in the network settings of plex by including your local network subnet

Plex > Settings > Network

image

Keagel commented 1 year ago

That works for PlexAutoSkip to detect sessions, though now the connection is refused when it tries to skip the intro. The issue is that Plex shows the IP of the client that's currently playing as 192.168.1.254 (IP of the router) when it's actually 192.168.1.218. Using your solution from https://github.com/mdhiggins/PlexAutoSkip/issues/3#issuecomment-1013543649 I was able to hard-code the clients' IPs in custom.json which works although not ideal. Not sure why Plex can't find the correct IP of my clients.

mdhiggins commented 1 year ago

Are you using unbound by chance?

Keagel commented 1 year ago

If you're talking about the DNS resolver, no. I'm using my Pi-Hole as a DHCP server though, but from my Tautulli logs I can see that even dating back before I moved to Pi-Hole as DHCP the recorded IP for all LAN clients is the router's.

Edit: I'm pretty sure the issue is with my plex docker container running in bridged network mode.

mdhiggins commented 1 year ago

Could try running your Plex container in host networking mode if you aren't already

Keagel commented 1 year ago

The issue was that I hadn't set up the custom server access URLs in the UI (ADVERTISE_IP variable from hotio's image: https://hotio.dev/containers/plex/#environment-variables-advertise_ip-and-allowed_networks) so clients couldn't discover the server and were likely going external. I guess the router was doing some hairpinning which resulted in Plex seeing every client as the router's IP. It's all fixed now. Thanks!