Code Monkey home page Code Monkey logo

Comments (9)

EnorMOZ avatar EnorMOZ commented on August 13, 2024 1

Well I feel stupid now.... It would actually help if webhooks was turned on in plex 🤦‍♂️
Webhooks This feature enables your server to send events to external services

from goplaxt.

crlshn avatar crlshn commented on August 13, 2024

I just deploy via docker a moment ago, same interest... playing a tv episodes to test this out.
my nginx reverse proxy ssl may be the way... I'll keep posting.

from goplaxt.

EnorMOZ avatar EnorMOZ commented on August 13, 2024

I don't even see any requests hitting the container's reverse proxy other than my tests of just hitting the url. I wonder if its something on the plex server side just not sending it out.

from goplaxt.

XanderStrike avatar XanderStrike commented on August 13, 2024

The webhook is triggered whenever you play, pause, or stop media on Plex. Pick a movie or TV show and once it starts playing you should see info in the logs.

Did you set up the link correctly in Plex? Is your app accessible from the internet (can you view it from your phone with wifi turned off)?

from goplaxt.

EnorMOZ avatar EnorMOZ commented on August 13, 2024

The following is in the goplaxt docker logs

2018/12/19 14:17:58 Handling auth request for enormoz
2018/12/19 14:17:58 Authorized as XXXXXXXXXXX

In the reverse proxy

nginx.1    | goplaxt.domain 1.1.1.1 - - [19/Dec/2018:14:17:51 -0500] "GET / HTTP/2.0" 200 3771 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
nginx.1    | goplaxt.domain 1.1.1.1 - - [19/Dec/2018:14:17:58 -0500] "GET /authorize?username=enormoz&code=XXXXXXXXXX HTTP/2.0" 200 3552 "https://goplaxt.domain/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"

In plex I put

https://goplaxt.domain/api?id=XXXXXXXXX

After that nothing in any of the logs.

from goplaxt.

EnorMOZ avatar EnorMOZ commented on August 13, 2024

Not sure if this is the right way to test an actual webhook call to it but I ran this:

curl --request POST
--url 'https://goplaxt.domain/api?id=XXXXXXXXXXX'
--form 'payload={
"event": "media.scrobble",
"user": true,
"owner": true,
"Account": {
"id": 1,
"thumb": "https://plex.tv/users/xxx/avatar?c=xxx",
"title": "EnorMOZ"
},
"Server": {
"title": "TVTime Fake Server",
"uuid": "xxx"
},
"Player": {
"local": true,
"publicAddress": "172.17.0.1",
"title": "Firefox",
"uuid": "xxx"
},
"Metadata": {
"librarySectionType": "show",
"ratingKey": "83782",
"key": "/library/metadata/83782",
"parentRatingKey": "83764",
"grandparentRatingKey": "83763",
"guid": "com.plexapp.agents.thetvdb://76156/1/18?lang=en",
"librarySectionTitle": "Series",
"librarySectionID": 2,
"librarySectionKey": "/library/sections/2",
"type": "episode",
"title": "Episode 18",
"grandparentKey": "/library/metadata/83763",
"parentKey": "/library/metadata/83764",
"grandparentTitle": "Scrubs",
"parentTitle": "Season 1",
"contentRating": "TV-PG",
"summary": "",
"index": 1,
"parentIndex": 1,
"viewCount": 1,
"lastViewedAt": 1537996938,
"thumb": "/library/metadata/83782/thumb/1535581275",
"art": "/library/metadata/83763/art/1535581275",
"parentThumb": "/library/metadata/83764/thumb/1535581275",
"grandparentThumb": "/library/metadata/83763/thumb/1535581275",
"grandparentArt": "/library/metadata/83763/art/1535581275",
"addedAt": 1535581221,
"updatedAt": 1535581275
}
}'

and got the following:

2018/12/19 16:28:58 Webhook call for XXXXXXXXXXX
2018/12/19 16:28:58 http: panic serving 172.18.0.9:45614: runtime error: index out of range
goroutine 22 [running]:
net/http.(*conn).serve.func1(0xc420430780)
/usr/local/go/src/net/http/server.go:1726 +0xd0
panic(0x75fa00, 0x9bff40)
/usr/local/go/src/runtime/panic.go:502 +0x229
github.com/xanderstrike/goplaxt/lib/plex.HandleWebhook(0xc420364000, 0x6d0, 0xe00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/github.com/xanderstrike/goplaxt/lib/plex/main.go:13 +0x1b9
main.api(0x8108e0, 0xc42040cd20, 0xc420140700)
/go/src/github.com/xanderstrike/goplaxt/main.go:68 +0x305
net/http.HandlerFunc.ServeHTTP(0x7e1348, 0x8108e0, 0xc42040cd20, 0xc420140700)
/usr/local/go/src/net/http/server.go:1947 +0x44
github.com/xanderstrike/goplaxt/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0xc420012240, 0x8108e0, 0xc42040cd20, 0xc420140700)
/go/src/github.com/xanderstrike/goplaxt/vendor/github.com/gorilla/mux/mux.go:215 +0xed
net/http.serverHandler.ServeHTTP(0xc420098d00, 0x8108e0, 0xc42040cd20, 0xc420140400)
/usr/local/go/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc420430780, 0x810be0, 0xc4201ba5c0)
/usr/local/go/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2795 +0x27b

In nginx-proxy logs:

nginx.1 | 2018/12/19 16:28:58 [error] 309#309: *41638 upstream prematurely closed connection while reading response header from upstream, client: 1.1.1.1, server: goplaxt.domain, request: "POST /api?id=XXXXXXXXX HTTP/2.0", upstream: "http://172.18.0.16:8000/api?id=XXXXXXX", host: "goplaxt.domain"
nginx.1 | goplaxt.domain 1.1.1.1 - - [19/Dec/2018:16:28:58 -0500] "POST /api?id=XXXXXXX HTTP/2.0" 502 173 "-" "curl/7.54.0"

However I still don't see any normal plex calls to it

from goplaxt.

XanderStrike avatar XanderStrike commented on August 13, 2024

If you're not seeing anything in the logs, and you know you're playing movies or tv shows, either Plex is set up wrong or your app isn't accessible on the public internet.

If you turn off wifi on your phone, can you access your instance of Plaxt?

Have you tried re-doing the authentication and pasting the link into Plex?

from goplaxt.

EnorMOZ avatar EnorMOZ commented on August 13, 2024

from goplaxt.

crlshn avatar crlshn commented on August 13, 2024

I found on the console (plex/settings) some logs regarding the selftsigned certificate, remove https and re-deploy with http and works out of the box with the instructions provided

from goplaxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.