Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add watch subcommand to print play events from PMS #148

Merged
merged 3 commits into from
Apr 6, 2021

Conversation

glensc
Copy link
Collaborator

@glensc glensc commented Mar 20, 2021

This adds watch subcommand to print play events from PMS:

➔ ./plex_trakt_sync.sh watch
Listening for events!
INFO: Starting AlertListener: ws://localhost:32400/:/websockets/notifications?X-Plex-Token=<hidden>
{'type': 'playing', 'size': 1, 'PlaySessionStateNotification': [{'sessionKey': '19', 'guid': '', 'ratingKey': '9723', 'url': '', 'key': '/library/metadata/9723', 'viewOffset': 39000, 'playQueueItemID': 17659, 'state': 'playing', 'transcodeSession': '9dd9jn2ci6cx3fynei05gs6p'}]}
{'type': 'playing', 'size': 1, 'PlaySessionStateNotification': [{'sessionKey': '19', 'guid': '', 'ratingKey': '9723', 'url': '', 'key': '/library/metadata/9723', 'viewOffset': 41000, 'playQueueItemID': 17659, 'state': 'stopped', 'transcodeSession': '9dd9jn2ci6cx3fynei05gs6p'}]}

nothing intermediately useful, other than info now.

@glensc glensc self-assigned this Mar 20, 2021
@glensc
Copy link
Collaborator Author

glensc commented Mar 20, 2021

Combining these events, and 'state', 'viewOffset' values, checking movie.playCount, could implement real-time synchronization.

@glensc glensc changed the base branch from master to main April 4, 2021 18:07
@glensc glensc force-pushed the event-listener branch 4 times, most recently from 3f38e03 to b98a6c4 Compare April 6, 2021 13:32
Retrieve media info in watch status
@glensc glensc marked this pull request as ready for review April 6, 2021 16:50
@glensc glensc changed the title Add module for listening Plex events Add watch subcommand to print play events from PMS Apr 6, 2021
@glensc glensc merged commit 076ef54 into Taxel:main Apr 6, 2021
@glensc glensc deleted the event-listener branch April 6, 2021 16:57
Repository owner locked as resolved and limited conversation to collaborators Jan 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant