Dyvinia / PlexampRPC

PlexampRPC displays currently playing Plex music as Discord Rich Presence, while using the proper Album Art
37 stars 3 forks source link

Failing to get this opperational #3

Closed SkinBintinGit closed 1 year ago

SkinBintinGit commented 1 year ago

Spent a while trying to find some help online as to where I have things set up wrong, but having come up empty handed, I'm hoping to get some help here.

The app has my plex profile, and I select my server, but when I play music the preview section never populates with anything, just stays as the default info as when it first launches, with the plex logo for the album art.

It also never displays anything within my discord. I'm running it on the same PC as my Plex Media Server runs on. Is there any additional steps I need to take to get this all functional that I might have missed somewhere?

Sorry I can't provide better info, but I'm not even sure where things are going wrong. I'm running the latest version. Have plexpass, and am listening to my music via the windows version of PlexAmp.

Thank you to anyone that can help me. :)

Dyvinia commented 1 year ago

Sorry about the delay, I pushed an update that may possibly fix it; however in the likely case it does not, open the config.json file and set ShowConsole to true to see a log output

SkinBintinGit commented 1 year ago

Sorry about the delay, I pushed an update that may possibly fix it; however in the likely case it does not, open the config.json file and set ShowConsole to true to see a log output

These are the warnings coming up with logging turned on...

WARN: Unable to get current session: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (203.86.204.220:20388) System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|281_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) WARN: We have been told to terminate by discord: (4000) Invalid Client ID WARN: Unable to get current session: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (203.86.204.220:20388) System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|281_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)

Dyvinia commented 1 year ago

Try reducing the refresh interval in settings, it just seems to be some generic connection issue and my guess is that maybe the frequency of polling the server could maybe be the issue for you

SkinBintinGit commented 1 year ago

Alright thanks for the help. I've made that change, hopefully it comes right eventually. Today it's just a log full of "discord asked us to terminate" and stuff like that. Invalid client ID and empty frame was read etc. Appreciate all the help. :)

Dyvinia commented 1 year ago

If you download the newest version, you can press F5 to open the log and press ctrl-c to copy it to the clipboard. What sorta errors do you mean by the discord stuff

cdrscore commented 1 year ago

This is exactly what I've been looking for to replace PlexRichPresence by Ombrelin (Which works perfectly but without the album art). Sadly I cannot for the life of me get this one to work. I am also having a similar cancellationToken issue that SkinBintinGit is having.

[07:40:12] WARN: Unable to get current session: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (XX.XX.X.XXX:32400) System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)

edit I think I've figured out the issue. My Plex server is running on a dedicated server within my network but PlexampRPC is trying to connect to it utilizing the HTTP protocol as if it was connecting from outside the network and trying to use my remote IP instead of the LAN IP which my router doesn't like if systems are on the same network. Perhaps a future update to allow the addition of manual entry for IP and Port selection?

Dyvinia commented 1 year ago

Could you try this, PlexampRPC.zip, it should have an option in the config file to specify an address, so ip:port/ should theoretically work. networking isnt really a strong suit of mine so im not entire sure if this is the right way at all to tackle this issue

cdrscore commented 1 year ago

Could you try this, PlexampRPC.zip, it should have an option in the config file to specify an address, so ip:port/ should theoretically work. networking isnt really a strong suit of mine so im not entire sure if this is the right way at all to tackle this issue

Thanks for looking into it. Sadly it didn't solve the issue. The log states that the service is still trying to connect to the server via the remote IP instead of the local ip:port added into the config. I tested by add an exception into the Plex server to not require an auth for the specific IP and setting the IP in LAN settings of the server to force it to see it as on the LAN; sadly to no avail.

Dyvinia commented 1 year ago

did you edit the config while the application is running or while its closed?

cdrscore commented 1 year ago

did you edit the config while the application is running or while its closed?

While it was closed. Only opened it first to generate the config file.

Dyvinia commented 1 year ago

actually i think it needs to be "http://ip:port/", does that work if its local?

cdrscore commented 1 year ago

actually i think it needs to be "http://ip:port/", does that work if its local?

Gave it a try to no avail. According to the log it is still attempting to connect to my external IP and not the LAN IP. Once I close it the config reverts back to null as the PlexAddress.

Dyvinia commented 1 year ago

could you try this, it also shouldn't need the specific format and simply ip:port should work PlexampRPC.zip

Dyvinia commented 1 year ago

also the config shouldn't be reverting to null automatically unless its being edited while the application is open

cdrscore commented 1 year ago

could you try this, it also shouldn't need the specific format and simply ip:port should work also the config shouldn't be reverting to null automatically unless its being edited while the application is open

Success! That fixed everything. As for the editing the config it was just reverting back to null in NP++ after it was already closed as something seemed to reset. Regardless, you've completely fixed it. Happy to help with some troubleshooting!

Dyvinia commented 1 year ago

glad i finally was able to resolve the issue!