cglatot / pasta

Audio & Subtitle Track Changer for Plex
https://www.pastatool.com
275 stars 7 forks source link

Unknown Error (0) when accessing via URL #50

Open coralcarl opened 2 years ago

coralcarl commented 2 years ago

I have a local server and I can connect per webapp over http without problems.

When I try via login the server shows up but I can't select a library and sometimes the server crashes.

Via URL/token on the http version I get an unknown error: image

cglatot commented 2 years ago

Hmm... That is an odd one. From the machine where you are trying to use PASTA, if you try going to http://192.168.0.178:32400 in a web browser, does that take you to plex okay?

coralcarl commented 2 years ago

I have a server running on a RPi 4 and am using PASTA on my desktop. I can access the library perfectly fine with the address.

cglatot commented 2 years ago

I can access the library perfectly fine with the address.

From the same desktop that you're trying to use PASTA?

If so, go to PASTA and bring up the Dev Tools (Ctrl + Shift + I on Chrome), go to the Network Tab. Right before you click on "Connect to Plex", at the top left of the Network tab click the "clear" button. (On Chrome it looks like a circle with a line through it)

Click on "Connect to Plex" and then see if there are any errors in the network tab (they'll show up red).

Also check on the "Console" tab to check for any errors.

coralcarl commented 2 years ago

It seems to be requesting via https regardless? image image

Console: image

cglatot commented 2 years ago

Hmm, that is very strange. I just tried it over http and it worked fine, didn't try to go over https. Just to make sure, are you loading PASTA via http as well?

To go back to the main point, can you try the same thing with the network tab and the console tab when trying via the Login via Plex method instead of the token?

coralcarl commented 2 years ago

Login is fine, still trying to request via secure connection. I am 100% on the http version. image

image

MS Edge same behavior but I just deleted the domain security policy for PASTA, which appears to have fixed the forced https requests, still getting no response and an error though: image

With login when clicking on the server: image

lutjasuki commented 2 years ago

Hi.

I've just started getting the same error in chrome for windows 10. It was working a couple of days ago and I think chrome has updated since then

the console error is: (4) Ensure private network requests are made from secure contexts with four blocked requests listed "

Request | Status | Resource Address | Initiator Address | Initiator Context -- | -- | -- | -- | -- sections/ | blocked | Private | Public | insecure sections/ | blocked |   | Public | insecure sections/ | blocked | Private | Public | insecure sections/ | blocked |   | Public | insecure

" I was able to get around the error by logging in (via LAN address and token) using firefox instead (and making sure that the url for pastatool was http

cglatot commented 2 years ago

Hmmmm, yeah, Browsers are constantly updating to prevent insecure access and it's becoming a headache to try to maintain. If you untick the "Connect using local IP address" box it seems to work fine. Likewise, over https it works fine too.

I'll see if I can do something about the insecure local access, but I wouldn't hold my breath.

Mindstorm1750 commented 2 years ago

This is not really a solution to the problem but a work around for users, if you are using chrome you can use this flag chrome://flags/#block-insecure-private-network-requests and set it to disabled, but PLEASE once you are done put it back to default as it is a security issue if left disabled.

ukdtom commented 1 year ago

Could be wrong here, but my guess is that OP configured PMS to only accept secure connections, so a redirect to https will happen.

When doing so, PMS cert is issued to xxxx.plex.direct and not to an IP address, thus making the cert invalid, and that's what the code complains about

Ref: https://stackoverflow.com/questions/25723415/bypassing-ssl-certificate-error-in-jquery-and-ajax

Below is not tested, since as already mentioned, I'm not a Pasta user, just stumbled across a Reddit thread, and then looked in the code ;)

Ref: Reddit Thread: https://www.reddit.com/r/PleX/comments/zh2r38/is_pastatool_not_working/

As a work around, OP could browse normally to https://app.plex.tv/

Then inspect a media, and show the xml Ref: https://support.plex.tv/articles/201998867-investigate-media-information-and-formats/

When looking at the XML page in the browser, it should show a valid url, that could be used instead of an IP address

image

slfight commented 1 year ago

Could be wrong here, but my guess is that OP configured PMS to only accept secure connections, so a redirect to https will happen.

When doing so, PMS cert is issued to xxxx.plex.direct and not to an IP address, thus making the cert invalid, and that's what the code complains about

Ref: https://stackoverflow.com/questions/25723415/bypassing-ssl-certificate-error-in-jquery-and-ajax

Below is not tested, since as already mentioned, I'm not a Pasta user, just stumbled across a Reddit thread, and then looked in the code ;)

Ref: Reddit Thread: https://www.reddit.com/r/PleX/comments/zh2r38/is_pastatool_not_working/

As a work around, OP could browse normally to https://app.plex.tv/

Then inspect a media, and show the xml Ref: https://support.plex.tv/articles/201998867-investigate-media-information-and-formats/

When looking at the XML page in the browser, it should show a valid url, that could be used instead of an IP address

image

Hello, I've tried this method and it doesn't work. I've also tried removing ":32400" and that also doesn't work. I'm using PastaTool via the same machine the server is on. I've also tried using another pc on the same network, same login, to fiddle but also can't access.

I've tried restarting my computer, clearing cookies. Nothing works. I've tried 127.0.0.1 and I can access app.plex.tv that way but doing the same using this method also doesn't work on PastaTool.

None of my libraries show but I can "see" the server if I'm logged in. It doesn't work via Firefox. Oddly Chrome semi-works and can see server name but it cannot see libraries.

I have also tried the Chrome flags suggestion in this thread but that doesn't work for me.

Untitled

sgtsquiggs commented 1 year ago

I had the same error:

  1. I initially put in the wrong URL.
  2. It continued to use that URL regardless of what I input (verified via inspector).

Refreshing the page fixed it for me.