Skip to content

Instantly share code, notes, and snippets.

@fjctp
Created February 20, 2018 03:04
Show Gist options
  • Save fjctp/a34a46a7ecf4347b3ae5e8a4611c6f0b to your computer and use it in GitHub Desktop.
Save fjctp/a34a46a7ecf4347b3ae5e8a4611c6f0b to your computer and use it in GitHub Desktop.
pychromecast
# install pychromecast
pip install pychromecast
# get a patch for YOUTUBE CONTROLLER to work
wget -O PYTHON_DIR/LIB/site-packages/pychromecast/pychromecast/controllers/youtube.py \
https://github.com/ur1katz/pychromecast/raw/master/pychromecast/controllers/youtube.py
import pychromecast as pycast
from pychromecast.controllers.youtube import YouTubeController as ytC
IP_ADDR = ''
youtube_id = 'xrZ8C9QqwkA'
device = pycast.Chromecast(IP_ADDR)
ytH = ytC()
device.register_handler(ytH)
ytH.play_video(youtube_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment