python-plexwebsocket
Async library to react to events issued over Plex websockets.
Example use
import asyncio
import logging
from plexapi.server import PlexServer
from plexwebsocket import PlexWebsocket, SIGNAL_CONNECTION_STATE
logging.basicConfig(level=logging.DEBUG)
baseurl = 'http://<PLEX_SERVER_IP>:32400'
token = '<YOUR_TOKEN_HERE>'
plex = PlexServer(baseurl, token)
def print_info(msgtype, data, error):
if msgtype == SIGNAL_CONNECTION_STATE:
print(f"State: {data} / Error: {error}")
else:
print(f"Data: {data}")
async def main():
ws = PlexWebsocket(plex, print_info, subscriptions=["playing", "status"])
await ws.listen()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Metadata
Release files for plexwebsocket 0.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| plexwebsocket-0.0.14.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| plexwebsocket-0.0.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / plexwebsocket-0.0.14.tar.gz
| Download URL | plexwebsocket-0.0.14.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f90c50c05e0cf2d824b9e3083ad77d843d8ef9d4e80c01ed34181c2ef094f80b
|
|
BLAKE2b-256 checksum How to use checksums |
dd53e37efeb5e29bc2c3036cb4b06257fd2b4699a88a7269cc2233337b93e5c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / plexwebsocket-0.0.14-py3-none-any.whl
| Download URL | plexwebsocket-0.0.14-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f00aa36a42908ca16a8c5a79ddbb99e9b9d98538636a41eb2666edcb85b6141c
|
|
BLAKE2b-256 checksum How to use checksums |
3d87b52611c5009f5b3d1025eec28dbcf04a5a8ddac2883a935a535986bbff09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|