styxit / HTPC-Manager

A fully responsive interface to manage all your favorite software on your Htpc.
http://htpc.io
MIT License
529 stars 183 forks source link

Plex integration no longer working with latest Plex #317

Closed zbuc closed 9 years ago

zbuc commented 9 years ago

It looks like the root page of Plex Media Server won't respond without authorization any more, so the test for adding the server (and media listing) aren't working.

I verified by making a similar request as to what it looks like modules/plex.py would make via curl:

~ $ curl -H "X-Plex-Username: myusername" -H "Accept: application/json" http://plex.local:32400/
<html><head><title>Unauthorized</title></head><body><h1>401 Unauthorized</h1></body></html>%

Logs:

2014-12-10 20:27:10 :: modules.plex :: ERROR :: Unable to contact Plex via http://plex.local:32400
2014-12-10 20:32:10 :: modules.plex :: ERROR :: Unable to fetch currently playing information! Exception: HTTP Error 401: Unauthorized

I haven't had a chance to dig deeper and see if it is simple to patch

Hellowlol commented 9 years ago

Its becasue of plex home

Hellowlol commented 9 years ago

It isn't possible to fix if users has enabled plex home. The optional text should be removed. Maybe there should be a option regarding plex home so ppl don't lock there account.

5stringdeath commented 9 years ago

There is a way by passing app specific tokens and I believe some work is being done in that arena to address Sickbeard and Couchpotato auto-library updating. However I don't know the specifics but I know it can be done. Myself I'm not using Plex Home features so its still working here.

Hellowlol commented 9 years ago

It's already coded. The user just has to supply the username and password. That was optional before

5stringdeath commented 9 years ago

Well to be clear that we're talking about the same thing - PlexHome is not the same as having a MyPlex account. Its the mulit-user addition to Plex Media Server recently. So are you saying all someone has to do is use the master account login information? Makes sense I guess.

Hellowlol commented 9 years ago

Myplex is used to grab the api token that pms requires if plex home is activated.

needo37 commented 9 years ago

Unfortunately even with specifying a username/password I still receive the 401 error.

Hellowlol commented 9 years ago

What call returns 401? If you give me the url ill see what i can do. It does work here, but they have sent me some email about my account being locked.

needo37 commented 9 years ago

This is what shows up in my Plex Media Server log.

Dec 31, 2014 13:55:35 [0x809129c00] DEBUG - Request: [172.22.1.158:46004] GET /library/sections (13 live)

And HTC-Manager shows up as 401: Unauthorized. According to the debug logs it is not even making it to "Fetch auth token".

5stringdeath commented 9 years ago

Do you have Homes enabled in your server now? I don't and mine is working fine. As I stated earlier I don't think Homes will work any longer with just a username/pw -- its going to need a specific app token to be passed. This is also true of Sickbeard/Couchpotato .. etc.

The app tokens are different than auth tokens that are used previous to Home (multi-user support)

needo37 commented 9 years ago

True. I do have Home enabled.

Hellowlol commented 9 years ago

Is it possible to turn it off home after? I dont see the point with the entire feature to be honest.

needo37 commented 9 years ago

I am working on a patch. Don't know how successful I'll be but worth a shot!

Hellowlol commented 9 years ago

Nice, I was just to post that I'll fix it but I'll leave it up to you then. It's nice to see more people contribute! Thanks

needo37 commented 9 years ago

I just submitted my change...

https://github.com/styxit/HTPC-Manager/pull/323

zbuc commented 9 years ago

@needo37 your patch works for me, I am able to connect to my Plex server and view my media in HTPC Manager

styxit commented 9 years ago

@Hellowlol Do you also agree on merging #323 ?

Hellowlol commented 9 years ago

Well i havnt checked that it solved the issue regarding plex home but i have tested that it dosnt messes up things for non plex home users. So i would merged this

mpguidry commented 8 years ago

i still cant connect to my plex

Hellowlol commented 8 years ago

Are you using ssl?

syrys commented 7 years ago

Sorry to dig up this thread, but this is still an issue.

I recently installed HTPC Manager and tried connecting to my plex, but no luck.

This is what i see in Logs:

2016-10-05 16:59:25 modules.plex    ERROR   Unable to contact Plex via http://192.168.1.50:32400 error HTTP Error 401: Unauthorized

I provided my correct plex username and password. I left the mac addr field blank as i wasent sure what that was for. All other fields were filled correctly. Also the url above (http://192.168.1.50:32400) is also correct and it will open up my plex.

If you want more info, please give me step by step instructions to get them and i would be happy to help. Other services/apps like couchpotato/sickbeard/sonarr/plexpy can all connect and communicate with plex just fine (with the same provided information: host ip, port, username, password).

Hellowlol commented 7 years ago

@syrys Tried a restart of htpc manger?

syrys commented 7 years ago

@Hellowlol i thought you were joking, but that actually fixed it. But why/how?

Hellowlol commented 7 years ago

Depends, are you using my fork or this version?

morpheus65535 commented 7 years ago

Ok... it's freaking... It also work for me. I'm using @Hellowlol version...