Skip to content

Latest commit

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

python-plexwebsocket

Async library to react to events issued over Plex websockets.

Example use

importasyncioimportloggingfromplexapi.serverimportPlexServerfromplexwebsocketimportPlexWebsocket, SIGNAL_CONNECTION_STATElogging.basicConfig(level=logging.DEBUG)
baseurl='http://<PLEX_SERVER_IP>:32400'token='<YOUR_TOKEN_HERE>'plex=PlexServer(baseurl, token)
defprint_info(msgtype, data, error):
ifmsgtype==SIGNAL_CONNECTION_STATE:
print(f"State: {data} / Error: {error}")
else:
print(f"Data: {data}")
asyncdefmain():
ws=PlexWebsocket(plex, print_info, subscriptions=["playing", "status"])
awaitws.listen()
if__name__=='__main__':
loop=asyncio.get_event_loop()
loop.run_until_complete(main())

About

Async library to react to events issued over Plex websockets.

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages