So I’ve been trying out webhook, but it doesn’t seem to work.
I’ve basically created a simple Sanic python program (similar to node.js or Flask)
import os
from sanic import Sanic
from sanic.response import text, HTTPResponse
from pprint import pprint
app = Sanic( "PLEX listener" )
@app.route("/", methods=['POST'])
async def handle_plex( request ):
print( "here" )
pprint( request.body )
return text( "hell", status = 200 )
if __name__ == '__main__':
app.run( host = '0.0.0.0', port = 32401, auto_reload = True, debug = True )
Which basically just try to print out POST request to /. I’ve tested it using curl, and other REST testing tool, and it works. However it doesn’t work on Plex.
I’ve enabled Webhooks on Settings >> Network.
And on Account >> Webhooks, I’ve added
- http://localhost:32401
- http://0.0.0.0:32401
- http://192.168.1.01:32401 (which is the IP of my server)
What else do you need to enable? When is webhook triggered? I tried it by playing and stopping music