Skip to content

Instantly share code, notes, and snippets.

@hcooper
Created November 3, 2016 06:40
Show Gist options
  • Save hcooper/ffe491986f916b0bcc635c4c11290a9f to your computer and use it in GitHub Desktop.
Save hcooper/ffe491986f916b0bcc635c4c11290a9f to your computer and use it in GitHub Desktop.
Remotely control roku & plex
#!/usr/bin/env python3
from plexapi.server import PlexServer
from roku import Roku
PLEX_SERVER = 'http://plexserver:32400'
PLEX_TOKEN = '#############'
PLEX_CLIENT = 'Roku 3 - 4E755U058982'
ROKU_HOSTNAME = 'roku'
ROKU_PLEX_APP = 'Plex'
# Launch the plex roku app
roku = Roku(ROKU_HOSTNAME)
roku.launch(roku[ROKU_PLEX_APP])
plex = PlexServer(PLEX_SERVER, PLEX_TOKEN)
movie = plex.library.section('Movies').get('Jurassic Park')
client = plex.client(PLEX_CLIENT)
client.playMedia(movie)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment